aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-ref.h
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2011-09-12 09:26:38 -0400
committerJan Schmidt <list.btrfs@jan-o-sch.net>2011-12-22 10:22:27 -0500
commit66d7e7f09f77456fe68683247d77721032a00ee5 (patch)
treebbf7df3933ed47aa202d60d835864543d25df82d /fs/btrfs/delayed-ref.h
parentc7d22a3c3cdb73d8a0151e2ccc8cf4a48c48310b (diff)
Btrfs: mark delayed refs as for cow
Add a for_cow parameter to add_delayed_*_ref and pass the appropriate value from every call site. The for_cow parameter will later on be used to determine if a ref will change anything with respect to qgroups. Delayed refs coming from relocation are always counted as for_cow, as they don't change subvol quota. Also pass in the fs_info for later use. btrfs_find_all_roots() will use this as an optimization, as changes that are for_cow will not change anything with respect to which root points to a certain leaf. Thus, we don't need to add the current sequence number to those delayed refs. 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.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index e287e3b0eab0..8316bff18d30 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -151,16 +151,21 @@ static inline void btrfs_put_delayed_ref(struct btrfs_delayed_ref_node *ref)
151 } 151 }
152} 152}
153 153
154int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans, 154int btrfs_add_delayed_tree_ref(struct btrfs_fs_info *fs_info,
155 struct btrfs_trans_handle *trans,
155 u64 bytenr, u64 num_bytes, u64 parent, 156 u64 bytenr, u64 num_bytes, u64 parent,
156 u64 ref_root, int level, int action, 157 u64 ref_root, int level, int action,
157 struct btrfs_delayed_extent_op *extent_op); 158 struct btrfs_delayed_extent_op *extent_op,
158int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans, 159 int for_cow);
160int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info,
161 struct btrfs_trans_handle *trans,
159 u64 bytenr, u64 num_bytes, 162 u64 bytenr, u64 num_bytes,
160 u64 parent, u64 ref_root, 163 u64 parent, u64 ref_root,
161 u64 owner, u64 offset, int action, 164 u64 owner, u64 offset, int action,
162 struct btrfs_delayed_extent_op *extent_op); 165 struct btrfs_delayed_extent_op *extent_op,
163int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans, 166 int for_cow);
167int btrfs_add_delayed_extent_op(struct btrfs_fs_info *fs_info,
168 struct btrfs_trans_handle *trans,
164 u64 bytenr, u64 num_bytes, 169 u64 bytenr, u64 num_bytes,
165 struct btrfs_delayed_extent_op *extent_op); 170 struct btrfs_delayed_extent_op *extent_op);
166 171