]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: clean up locking in xfs_file_iomap_begin
authorDave Chinner <dchinner@redhat.com>
Wed, 2 May 2018 19:54:54 +0000 (12:54 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 May 2018 17:04:01 +0000 (10:04 -0700)
commit83a972999a6f67ebab7af632830c1787f0b56d96
treeb0880e4291183eb569e9a7fcc145e108173f6f70
parent64623fe1015fa9faff2328e52a4d9ff3e7fb2eea
xfs: clean up locking in xfs_file_iomap_begin

Rather than checking what kind of locking is needed in a helper
function and then jumping through hoops to do the locking in line,
move the locking to the helper function that does all the checks
and rename it to xfs_ilock_for_iomap().

This also allows us to hoist all the nonblocking checks up into the
locking helper, further simplifier the code flow in
xfs_file_iomap_begin() and making it easier to understand.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_iomap.c