]> asedeno.scripts.mit.edu Git - linux.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)
commitdfa03a5f8076c6bf79a9f68ef8f559fb8999cec1
treeb0880e4291183eb569e9a7fcc145e108173f6f70
parentd0641780940a9842cbf62114bc8422012c7d88c4
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