* Added a transaction listener mechanism to be notified when a
transaction ends or has been aborted. * BFS now listens for transactions when it created an inode to see if the transaction will be aborted without freeing the inode (in which case it will panic for now). * Started implementing tracing support, but it's not working yet. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23492 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2007, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2004-2008, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _FS_CACHE_H
|
||||
@@ -11,7 +11,14 @@
|
||||
#include <fs_interface.h>
|
||||
|
||||
|
||||
typedef void (*transaction_notification_hook)(int32 id, void *data);
|
||||
enum {
|
||||
TRANSACTION_WRITTEN,
|
||||
TRANSACTION_ABORTED,
|
||||
TRANSACTION_ENDED
|
||||
};
|
||||
|
||||
typedef void (*transaction_notification_hook)(int32 id, int32 event,
|
||||
void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -27,6 +34,10 @@ extern int32 cache_detach_sub_transaction(void *_cache, int32 id,
|
||||
transaction_notification_hook hook, void *data);
|
||||
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);
|
||||
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,
|
||||
uint32 *_cookie, off_t *_blockNumber, void **_data,
|
||||
void **_unchangedData);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007, Ingo Weinhold, [email protected].
|
||||
* Copyright 2007-2008, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _FSSH_API_WRAPPER_H
|
||||
@@ -787,6 +787,10 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// #pragma mark - fssh_fs_cache.h
|
||||
|
||||
#define TRANSACTION_WRITTEN FSSH_TRANSACTION_WRITTEN
|
||||
#define TRANSACTION_ABORTED FSSH_TRANSACTION_ABORTED
|
||||
#define TRANSACTION_ENDED FSSH_TRANSACTION_ENDED
|
||||
|
||||
#define transaction_notification_hook fssh_transaction_notification_hook
|
||||
|
||||
/* transactions */
|
||||
@@ -797,6 +801,8 @@
|
||||
#define cache_detach_sub_transaction fssh_cache_detach_sub_transaction
|
||||
#define cache_abort_sub_transaction fssh_cache_abort_sub_transaction
|
||||
#define cache_start_sub_transaction fssh_cache_start_sub_transaction
|
||||
#define cache_add_transaction_listener fssh_cache_add_transaction_listener
|
||||
#define cache_remove_transaction_listener fssh_cache_remove_transaction_listener
|
||||
#define cache_next_block_in_transaction fssh_cache_next_block_in_transaction
|
||||
#define cache_blocks_in_transaction fssh_cache_blocks_in_transaction
|
||||
#define cache_blocks_in_sub_transaction fssh_cache_blocks_in_sub_transaction
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2007, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2004-2008, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _FSSH_FS_CACHE_H
|
||||
@@ -11,7 +11,14 @@
|
||||
#include "fssh_fs_interface.h"
|
||||
|
||||
|
||||
typedef void (*fssh_transaction_notification_hook)(int32_t id, void *data);
|
||||
enum {
|
||||
FSSH_TRANSACTION_WRITTEN,
|
||||
FSSH_TRANSACTION_ABORTED,
|
||||
FSSH_TRANSACTION_ENDED
|
||||
};
|
||||
|
||||
typedef void (*fssh_transaction_notification_hook)(int32_t id, int32_t event,
|
||||
void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -31,6 +38,12 @@ extern fssh_status_t fssh_cache_abort_sub_transaction(void *_cache,
|
||||
int32_t id);
|
||||
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,
|
||||
void *data);
|
||||
extern fssh_status_t fssh_cache_remove_transaction_listener(void *_cache,
|
||||
int32_t id, fssh_transaction_notification_hook hook,
|
||||
void *data);
|
||||
extern fssh_status_t fssh_cache_next_block_in_transaction(void *_cache,
|
||||
int32_t id, uint32_t *_cookie,
|
||||
fssh_off_t *_blockNumber, void **_data,
|
||||
|
||||
Reference in New Issue
Block a user