aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-ref.h
diff options
context:
space:
mode:
authorJan Schmidt <list.btrfs@jan-o-sch.net>2012-06-14 10:37:44 -0400
committerJan Schmidt <list.btrfs@jan-o-sch.net>2012-07-12 04:54:38 -0400
commit546adb0d817c34dc2be3a7cb5bba8771f837a562 (patch)
treee287f5cb18b6c97d6acdbc09dbb045dca95e7daa /fs/btrfs/delayed-ref.h
parentbcef60f249034f69e89e544461cbfecb68975595 (diff)
Btrfs: hooks for qgroup to record delayed refs
Hooks into qgroup code to record refs and into transaction commit. This is the main entry point for qgroup. Basically every change in extent backrefs got accounted to the appropriate qgroups. Signed-off-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs/delayed-ref.h')
-rw-r--r--fs/btrfs/delayed-ref.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index 2b5cb27f9861..0d7c90c366b6 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -180,6 +180,25 @@ int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info,
180 u64 seq); 180 u64 seq);
181 181
182/* 182/*
183 * delayed refs with a ref_seq > 0 must be held back during backref walking.
184 * this only applies to items in one of the fs-trees. for_cow items never need
185 * to be held back, so they won't get a ref_seq number.
186 */
187static inline int need_ref_seq(int for_cow, u64 rootid)
188{
189 if (for_cow)
190 return 0;
191
192 if (rootid == BTRFS_FS_TREE_OBJECTID)
193 return 1;
194
195 if ((s64)rootid >= (s64)BTRFS_FIRST_FREE_OBJECTID)
196 return 1;
197
198 return 0;
199}
200
201/*
183 * a node might live in a head or a regular ref, this lets you 202 * a node might live in a head or a regular ref, this lets you
184 * test for the proper type to use. 203 * test for the proper type to use.
185 */ 204 */