diff options
Diffstat (limited to 'fs/btrfs/tree-log.h')
-rw-r--r-- | fs/btrfs/tree-log.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h index 91b145fce333..7f5b41bd5373 100644 --- a/fs/btrfs/tree-log.h +++ b/fs/btrfs/tree-log.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #ifndef __TREE_LOG_ | 19 | #ifndef __TREE_LOG_ |
20 | #define __TREE_LOG_ | 20 | #define __TREE_LOG_ |
21 | 21 | ||
22 | #include "ctree.h" | ||
23 | #include "transaction.h" | ||
24 | |||
22 | /* return value for btrfs_log_dentry_safe that means we don't need to log it at all */ | 25 | /* return value for btrfs_log_dentry_safe that means we don't need to log it at all */ |
23 | #define BTRFS_NO_LOG_SYNC 256 | 26 | #define BTRFS_NO_LOG_SYNC 256 |
24 | 27 | ||
@@ -35,6 +38,19 @@ static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx) | |||
35 | INIT_LIST_HEAD(&ctx->list); | 38 | INIT_LIST_HEAD(&ctx->list); |
36 | } | 39 | } |
37 | 40 | ||
41 | static inline void btrfs_set_log_full_commit(struct btrfs_fs_info *fs_info, | ||
42 | struct btrfs_trans_handle *trans) | ||
43 | { | ||
44 | ACCESS_ONCE(fs_info->last_trans_log_full_commit) = trans->transid; | ||
45 | } | ||
46 | |||
47 | static inline int btrfs_need_log_full_commit(struct btrfs_fs_info *fs_info, | ||
48 | struct btrfs_trans_handle *trans) | ||
49 | { | ||
50 | return ACCESS_ONCE(fs_info->last_trans_log_full_commit) == | ||
51 | trans->transid; | ||
52 | } | ||
53 | |||
38 | int btrfs_sync_log(struct btrfs_trans_handle *trans, | 54 | int btrfs_sync_log(struct btrfs_trans_handle *trans, |
39 | struct btrfs_root *root, struct btrfs_log_ctx *ctx); | 55 | struct btrfs_root *root, struct btrfs_log_ctx *ctx); |
40 | int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root); | 56 | int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root); |