xfs: Specify lockmode when calling xfs_ilock_for_iomap()

This patch changes the helper function xfs_ilock_for_iomap such that the
lock mode must be passed in.

Signed-off-by: Stefan Roesch <shr@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20220623175157.1715274-14-shr@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Stefan Roesch 2022-06-23 10:51:56 -07:00 committed by Jens Axboe
parent 1c849b481b
commit 9641506b2d
1 changed files with 3 additions and 3 deletions

View File

@ -664,7 +664,7 @@ xfs_ilock_for_iomap(
unsigned flags, unsigned flags,
unsigned *lockmode) unsigned *lockmode)
{ {
unsigned mode = XFS_ILOCK_SHARED; unsigned int mode = *lockmode;
bool is_write = flags & (IOMAP_WRITE | IOMAP_ZERO); bool is_write = flags & (IOMAP_WRITE | IOMAP_ZERO);
/* /*
@ -742,7 +742,7 @@ xfs_direct_write_iomap_begin(
int nimaps = 1, error = 0; int nimaps = 1, error = 0;
bool shared = false; bool shared = false;
u16 iomap_flags = 0; u16 iomap_flags = 0;
unsigned lockmode; unsigned int lockmode = XFS_ILOCK_SHARED;
ASSERT(flags & (IOMAP_WRITE | IOMAP_ZERO)); ASSERT(flags & (IOMAP_WRITE | IOMAP_ZERO));
@ -1172,7 +1172,7 @@ xfs_read_iomap_begin(
xfs_fileoff_t end_fsb = xfs_iomap_end_fsb(mp, offset, length); xfs_fileoff_t end_fsb = xfs_iomap_end_fsb(mp, offset, length);
int nimaps = 1, error = 0; int nimaps = 1, error = 0;
bool shared = false; bool shared = false;
unsigned lockmode; unsigned int lockmode = XFS_ILOCK_SHARED;
ASSERT(!(flags & (IOMAP_WRITE | IOMAP_ZERO))); ASSERT(!(flags & (IOMAP_WRITE | IOMAP_ZERO)));