]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use shared lock for direct writes within EOF
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Thu, 24 Sep 2020 16:39:18 +0000 (11:39 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:48 +0000 (15:53 +0100)
commitde76f9c148de8ffe7a9f0f1b5dda87926fb22df9
tree572904723d2f07c1a70bd7895619302ad0b00da8
parentf7b20c895f2727fe59a0df3e11558ba8a14db38e
btrfs: use shared lock for direct writes within EOF

Direct writes within EOF are safe to be performed with inode shared lock
to improve parallelization with other direct writes or reads because EOF
is not changed and there is no race with truncate().

Direct reads are already performed under shared inode lock.

This patch is precursor to removing btrfs_inode->dio_sem.

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