Commit c8df2cc9 authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner

ocfs2: adapt to breakup of struct file_lock

Most of the existing APIs have remained the same, but subsystems that
access file_lock fields directly need to reach into struct
file_lock_core now.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20240131-flsplit-v3-43-c6129007ee8d@kernel.orgReviewed-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 05580bbf
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
*/ */
#include <linux/fs.h> #include <linux/fs.h>
#define _NEED_FILE_LOCK_FIELD_MACROS
#include <linux/filelock.h> #include <linux/filelock.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
...@@ -54,8 +53,8 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode, ...@@ -54,8 +53,8 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode,
*/ */
locks_init_lock(&request); locks_init_lock(&request);
request.fl_type = F_UNLCK; request.c.flc_type = F_UNLCK;
request.fl_flags = FL_FLOCK; request.c.flc_flags = FL_FLOCK;
locks_lock_file_wait(file, &request); locks_lock_file_wait(file, &request);
ocfs2_file_unlock(file); ocfs2_file_unlock(file);
...@@ -101,7 +100,7 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl) ...@@ -101,7 +100,7 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl)
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
if (!(fl->fl_flags & FL_FLOCK)) if (!(fl->c.flc_flags & FL_FLOCK))
return -ENOLCK; return -ENOLCK;
if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) || if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) ||
...@@ -119,7 +118,7 @@ int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl) ...@@ -119,7 +118,7 @@ int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl)
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
if (!(fl->fl_flags & FL_POSIX)) if (!(fl->c.flc_flags & FL_POSIX))
return -ENOLCK; return -ENOLCK;
return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl); return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl);
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs.h> #include <linux/fs.h>
#define _NEED_FILE_LOCK_FIELD_MACROS
#include <linux/filelock.h> #include <linux/filelock.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/mutex.h> #include <linux/mutex.h>
......
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