mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-10 15:54:39 +08:00
ocfs2: convert to using new filelock helpers
Convert to using the new file locking helper functions. Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240131-flsplit-v3-13-c6129007ee8d@kernel.org Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
60f3154d19
commit
64f92a554f
@ -27,7 +27,7 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode,
|
||||
struct ocfs2_file_private *fp = file->private_data;
|
||||
struct ocfs2_lock_res *lockres = &fp->fp_flock;
|
||||
|
||||
if (fl->fl_type == F_WRLCK)
|
||||
if (lock_is_write(fl))
|
||||
level = 1;
|
||||
if (!IS_SETLKW(cmd))
|
||||
trylock = 1;
|
||||
@ -107,7 +107,7 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl)
|
||||
ocfs2_mount_local(osb))
|
||||
return locks_lock_file_wait(file, fl);
|
||||
|
||||
if (fl->fl_type == F_UNLCK)
|
||||
if (lock_is_unlock(fl))
|
||||
return ocfs2_do_funlock(file, cmd, fl);
|
||||
else
|
||||
return ocfs2_do_flock(file, inode, cmd, fl);
|
||||
|
@ -744,7 +744,7 @@ static int user_plock(struct ocfs2_cluster_connection *conn,
|
||||
return dlm_posix_cancel(conn->cc_lockspace, ino, file, fl);
|
||||
else if (IS_GETLK(cmd))
|
||||
return dlm_posix_get(conn->cc_lockspace, ino, file, fl);
|
||||
else if (fl->fl_type == F_UNLCK)
|
||||
else if (lock_is_unlock(fl))
|
||||
return dlm_posix_unlock(conn->cc_lockspace, ino, file, fl);
|
||||
else
|
||||
return dlm_posix_lock(conn->cc_lockspace, ino, file, cmd, fl);
|
||||
|
Loading…
Reference in New Issue
Block a user