OSDN Git Service

btrfs: introduce btrfs_write_check()
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Thu, 24 Sep 2020 16:39:15 +0000 (11:39 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:47 +0000 (15:53 +0100)
commitb8d8e1fd570a194904f545b135efc880d96a41a4
tree00f6b7f6e18719abead70cc06033312805e7a06d
parentc86537a42f8661a26c96cbb32352b33cb57ac75c
btrfs: introduce btrfs_write_check()

btrfs_write_check() checks write parameters in one place before
beginning a write. This does away with inode_unlock() after every check.
In the later patches, it will help push inode_lock/unlock() in buffered
and direct write functions respectively.

generic_write_checks needs to be called before as it could truncate
iov_iter and its return used as count.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c