On 2018年06月08日 20:47, Nikolay Borisov wrote: > Pull the necessary function, excluding locking. Required to enable > integration of delayed refs. > > Signed-off-by: Nikolay Borisov <[email protected]> > --- > ctree.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/ctree.c b/ctree.c > index 2c51580fec65..7b74716bf92f 100644 > --- a/ctree.c > +++ b/ctree.c > @@ -76,6 +76,18 @@ void add_root_to_dirty_list(struct btrfs_root *root) > } > } > > +static void root_add_used(struct btrfs_root *root, u32 size) > +{ > + btrfs_set_root_used(&root->root_item, > + btrfs_root_used(&root->root_item) + size); > +} > + > +static void root_sub_used(struct btrfs_root *root, u32 size) > +{ > + btrfs_set_root_used(&root->root_item, > + btrfs_root_used(&root->root_item) - size); > +} > + So small that it can be included into the patch which uses this. BTW, it would be better to do some basic underflow check here. No need to return int, but some WARN_ON() would definitely help. Thanks, Qu > int btrfs_copy_root(struct btrfs_trans_handle *trans, > struct btrfs_root *root, > struct extent_buffer *buf, > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
- [PATCH v2] btrfs-progs: Add delayed refs infrastructu... Nikolay Borisov
- Re: [PATCH 11/15] btrfs-progs: Add delayed refs infra... Qu Wenruo
- Re: [PATCH 11/15] btrfs-progs: Add delayed refs i... Nikolay Borisov
- [PATCH 05/15] btrfs-progs: Make update_block_group take fs... Nikolay Borisov
- [PATCH 06/15] btrfs-progs: check: Drop trans/root argument... Nikolay Borisov
- Re: [PATCH 06/15] btrfs-progs: check: Drop trans/root... Qu Wenruo
- Re: [PATCH 06/15] btrfs-progs: check: Drop trans/... Nikolay Borisov
- [PATCH 03/15] btrfs-progs: Add functions to modify the use... Nikolay Borisov
- Re: [PATCH 03/15] btrfs-progs: Add functions to modif... Qu Wenruo
- [PATCH 10/15] btrfs-progs: Add boolean to signal whether w... Nikolay Borisov
- [PATCH 08/15] btrfs-progs: Remove root argument from alloc... Nikolay Borisov
- [PATCH 04/15] btrfs-progs: Refactor the root used bytes ar... Nikolay Borisov
- [PATCH 13/15] btrfs-progs: Add alloc_reserved_tree_block2 ... Nikolay Borisov
- [PATCH 12/15] btrfs-progs: Add __free_extent2 function Nikolay Borisov
- [PATCH 01/15] btrfs-progs: Remove root argument from pin_d... Nikolay Borisov
- [PATCH 15/15] btrfs-progs: Remove old delayed refs infrast... Nikolay Borisov
- [PATCH v2] btrfs-progs: Remove old delayed refs infra... Nikolay Borisov
- [PATCH 02/15] btrfs-progs: Remove root argument from btrfs... Nikolay Borisov
