summaryrefslogtreecommitdiff
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2024-02-01 02:01:52 +0300
committerChristian Brauner <brauner@kernel.org>2024-02-05 15:11:36 +0300
commitd7c9616be0759c1cfb44a68ba838548d22b98484 (patch)
tree3a265887c3767eec2a535133142b170a65d148ad /fs/nfs/write.c
parent872584f1bb983a688547509141b03b37bdb28840 (diff)
downloadlinux-d7c9616be0759c1cfb44a68ba838548d22b98484.tar.xz
nfs: convert to using new filelock helpers
Convert to using the new file locking helper functions. Also, in later patches we're going to introduce some temporary macros with names that clash with the variable name in nfs4_proc_unlck. Rename it. Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240131-flsplit-v3-11-c6129007ee8d@kernel.org Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bb79d3a886ae..d16f2b9d1765 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1301,7 +1301,7 @@ static bool
is_whole_file_wrlock(struct file_lock *fl)
{
return fl->fl_start == 0 && fl->fl_end == OFFSET_MAX &&
- fl->fl_type == F_WRLCK;
+ lock_is_write(fl);
}
/* If we know the page is up to date, and we're not using byte range locks (or
@@ -1341,7 +1341,7 @@ static int nfs_can_extend_write(struct file *file, struct folio *folio,
} else if (!list_empty(&flctx->flc_flock)) {
fl = list_first_entry(&flctx->flc_flock, struct file_lock,
fl_list);
- if (fl->fl_type == F_WRLCK)
+ if (lock_is_write(fl))
ret = 1;
}
spin_unlock(&flctx->flc_lock);