]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Open-code add_delayed_tree_ref
authorNikolay Borisov <nborisov@suse.com>
Tue, 24 Apr 2018 14:18:20 +0000 (17:18 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:31 +0000 (18:07 +0200)
commitfeaaa6bae7cacea199516da3096c81ef121dd6e8
tree141473dd9562441638807b93c9963c6676a710cf
parentca5caa14bd469a95918aef8ca07ac3df73c3a2ce
btrfs: Open-code add_delayed_tree_ref

Now that the initialization part and the critical section code have been
split it's a lot easier to open code add_delayed_tree_ref. Do so in the
following manner:

1. The comming init code is put immediately after memory-to-be-initialized
   is allocated, followed by the ref-specific member initialization.

2. The only piece of code that remains in the critical section is
   insert_delayed_ref call.

3. Tracing and memory freeing code is put outside of the critical
   section as well.

The only real change here is an overall shorter critical section when
dealing with delayed tree refs. From functional point of view - the code
is unchanged.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c