btrfs: Factor out write portion of btrfs_get_blocks_direct
authorNikolay Borisov <nborisov@suse.com>
Wed, 2 May 2018 12:19:33 +0000 (15:19 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 May 2018 17:01:44 +0000 (19:01 +0200)
commitc5794e51784a0a96dd82e8f955570a7eccf27e5d
tree4415984aa73ae253d024fe7a52eb4cbc85e33448
parent1c8d0175df47364aa55c568b65ed7a3aee5b9a6d
btrfs: Factor out write portion of btrfs_get_blocks_direct

Now that the read side is extracted into its own function, do the same
to the write side. This leaves btrfs_get_blocks_direct_write with the
sole purpose of handling common locking required. Also flip the
condition in btrfs_get_blocks_direct_write so that the write case
comes first and we check for if (Create) rather than if (!create). This
is purely subjective but I believe makes reading a bit more "linear".
No functional changes.

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