Looks like some bloke forgot to commit *some* files that should have been part

of r24768 (block cache notification mechanism rewrite).
Thanks for the note, Vasilis!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24772 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-04-03 14:14:27 +00:00
parent 4b7af69340
commit e63c117011
5 changed files with 23 additions and 23 deletions

View File

@ -11,11 +11,12 @@
#include <fs_interface.h>
/* transaction events */
enum {
TRANSACTION_WRITTEN,
TRANSACTION_ABORTED,
TRANSACTION_ENDED,
TRANSACTION_IDLE
TRANSACTION_WRITTEN = 0x01,
TRANSACTION_ABORTED = 0x02,
TRANSACTION_ENDED = 0x04,
TRANSACTION_IDLE = 0x08
};
typedef void (*transaction_notification_hook)(int32 id, int32 event,
@ -36,7 +37,8 @@ extern int32 cache_detach_sub_transaction(void *_cache, int32 id,
extern status_t cache_abort_sub_transaction(void *_cache, int32 id);
extern status_t cache_start_sub_transaction(void *_cache, int32 id);
extern status_t cache_add_transaction_listener(void *_cache, int32 id,
transaction_notification_hook hook, void *data);
int32 events, transaction_notification_hook hook,
void *data);
extern status_t cache_remove_transaction_listener(void *_cache, int32 id,
transaction_notification_hook hook, void *data);
extern status_t cache_next_block_in_transaction(void *_cache, int32 id,

View File

@ -12,10 +12,10 @@
enum {
FSSH_TRANSACTION_WRITTEN,
FSSH_TRANSACTION_ABORTED,
FSSH_TRANSACTION_ENDED,
FSSH_TRANSACTION_IDLE
FSSH_TRANSACTION_WRITTEN = 0x01,
FSSH_TRANSACTION_ABORTED = 0x02,
FSSH_TRANSACTION_ENDED = 0x04,
FSSH_TRANSACTION_IDLE = 0x08
};
typedef void (*fssh_transaction_notification_hook)(int32_t id, int32_t event,
@ -40,7 +40,8 @@ extern fssh_status_t fssh_cache_abort_sub_transaction(void *_cache,
extern fssh_status_t fssh_cache_start_sub_transaction(void *_cache,
int32_t id);
extern fssh_status_t fssh_cache_add_transaction_listener(void *_cache,
int32_t id, fssh_transaction_notification_hook hook,
int32_t id, int32_t events,
fssh_transaction_notification_hook hook,
void *data);
extern fssh_status_t fssh_cache_remove_transaction_listener(void *_cache,
int32_t id, fssh_transaction_notification_hook hook,

View File

@ -252,7 +252,7 @@ InodeAllocator::Keep()
if (status == B_OK) {
cache_add_transaction_listener(volume->BlockCache(), fTransaction->ID(),
&_TransactionListener, fInode);
TRANSACTION_ABORTED, &_TransactionListener, fInode);
}
fTransaction = NULL;

View File

@ -536,9 +536,6 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void *_logEntry)
{
LogEntry *logEntry = (LogEntry *)_logEntry;
if (event != TRANSACTION_WRITTEN)
return;
PRINT(("Log entry %p has been finished, transaction ID = %ld\n", logEntry,
transactionID));
@ -588,9 +585,6 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void *_logEntry)
/*static*/ void
Journal::_TransactionListener(int32 transactionID, int32 event, void *_journal)
{
if (event != TRANSACTION_IDLE)
return;
// The current transaction seems to be idle - flush it
Journal *journal = (Journal *)_journal;
@ -865,7 +859,7 @@ Journal::Lock(Transaction *owner)
}
cache_add_transaction_listener(fVolume->BlockCache(), fTransactionID,
_TransactionListener, this);
TRANSACTION_IDLE, _TransactionListener, this);
return B_OK;
}

View File

@ -50,7 +50,7 @@ struct cache_hook : DoublyLinkedListLinkImpl<cache_hook> {
void *data;
};
typedef DoublyLinkedList<cache_hook> HookList;
typedef DoublyLinkedList<cache_hook> HookList;
struct cache_transaction {
cache_transaction();
@ -377,7 +377,7 @@ put_cached_block(block_cache *cache, fssh_off_t blockNumber)
fssh_panic("put_cached_block: invalid block number %lld (max %lld)",
blockNumber, cache->max_blocks - 1);
}
cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber);
if (block != NULL)
put_cached_block(cache, block);
@ -974,9 +974,11 @@ fssh_cache_start_sub_transaction(void *_cache, int32_t id)
The listener gets automatically removed in this case.
*/
fssh_status_t
fssh_cache_add_transaction_listener(void *_cache, int32_t id,
fssh_cache_add_transaction_listener(void *_cache, int32_t id, int32_t events,
fssh_transaction_notification_hook hookFunction, void *data)
{
// TODO: this is currently not used in a critical context in BFS
#if 0
block_cache *cache = (block_cache *)_cache;
cache_hook *hook = new(std::nothrow) cache_hook;
@ -995,6 +997,7 @@ fssh_cache_add_transaction_listener(void *_cache, int32_t id,
hook->data = data;
transaction->listeners.Add(hook);
#endif
return FSSH_B_OK;
}
@ -1061,7 +1064,7 @@ fssh_cache_next_block_in_transaction(void *_cache, int32_t id, bool mainOnly,
*_unchangedData = block->original_data;
*_cookie = (fssh_addr_t)block;
return FSSH_B_OK;
return FSSH_B_OK;
}
@ -1130,7 +1133,7 @@ fssh_block_cache_delete(void *_cache, bool allowWrites)
cache->FreeBlock(block);
}
// free all transactions (they will all be aborted)
// free all transactions (they will all be aborted)
cookie = 0;
cache_transaction *transaction;