Commit 9641506b authored by Stefan Roesch's avatar Stefan Roesch Committed by Jens Axboe

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: default avatarStefan Roesch <shr@fb.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20220623175157.1715274-14-shr@fb.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1c849b48
...@@ -664,7 +664,7 @@ xfs_ilock_for_iomap( ...@@ -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( ...@@ -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( ...@@ -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)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment