summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.h
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2014-04-02 19:51:06 +0800
committerChris Mason <clm@fb.com>2014-06-09 17:20:45 -0700
commit995946dd2961776bb45e653810ae96643fbf4ce8 (patch)
tree98b3e1b9fd72ccdca5a6fe540cf421a58692deba /fs/btrfs/tree-log.h
parent1f21ef0a34c37de0daf66fce7141b23b88630f29 (diff)
downloadlinux-995946dd2961776bb45e653810ae96643fbf4ce8.tar.gz
linux-995946dd2961776bb45e653810ae96643fbf4ce8.tar.bz2
linux-995946dd2961776bb45e653810ae96643fbf4ce8.zip
Btrfs: use helpers for last_trans_log_full_commit instead of opencode
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/tree-log.h')
-rw-r--r--fs/btrfs/tree-log.h16
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 @@
#ifndef __TREE_LOG_
#define __TREE_LOG_
+#include "ctree.h"
+#include "transaction.h"
+
/* return value for btrfs_log_dentry_safe that means we don't need to log it at all */
#define BTRFS_NO_LOG_SYNC 256
@@ -35,6 +38,19 @@ static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx)
INIT_LIST_HEAD(&ctx->list);
}
+static inline void btrfs_set_log_full_commit(struct btrfs_fs_info *fs_info,
+ struct btrfs_trans_handle *trans)
+{
+ ACCESS_ONCE(fs_info->last_trans_log_full_commit) = trans->transid;
+}
+
+static inline int btrfs_need_log_full_commit(struct btrfs_fs_info *fs_info,
+ struct btrfs_trans_handle *trans)
+{
+ return ACCESS_ONCE(fs_info->last_trans_log_full_commit) ==
+ trans->transid;
+}
+
int btrfs_sync_log(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_log_ctx *ctx);
int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root);