Skip to content

Commit c8df2cc

Browse files
jtlaytonbrauner
authored andcommitted
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: Jeff Layton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: NeilBrown <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 05580bb commit c8df2cc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

fs/ocfs2/locks.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010
#include <linux/fs.h>
11-
#define _NEED_FILE_LOCK_FIELD_MACROS
1211
#include <linux/filelock.h>
1312
#include <linux/fcntl.h>
1413

@@ -54,8 +53,8 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode,
5453
*/
5554

5655
locks_init_lock(&request);
57-
request.fl_type = F_UNLCK;
58-
request.fl_flags = FL_FLOCK;
56+
request.c.flc_type = F_UNLCK;
57+
request.c.flc_flags = FL_FLOCK;
5958
locks_lock_file_wait(file, &request);
6059

6160
ocfs2_file_unlock(file);
@@ -101,7 +100,7 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl)
101100
struct inode *inode = file->f_mapping->host;
102101
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
103102

104-
if (!(fl->fl_flags & FL_FLOCK))
103+
if (!(fl->c.flc_flags & FL_FLOCK))
105104
return -ENOLCK;
106105

107106
if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) ||
@@ -119,7 +118,7 @@ int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl)
119118
struct inode *inode = file->f_mapping->host;
120119
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
121120

122-
if (!(fl->fl_flags & FL_POSIX))
121+
if (!(fl->c.flc_flags & FL_POSIX))
123122
return -ENOLCK;
124123

125124
return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl);

fs/ocfs2/stack_user.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <linux/module.h>
1111
#include <linux/fs.h>
12-
#define _NEED_FILE_LOCK_FIELD_MACROS
1312
#include <linux/filelock.h>
1413
#include <linux/miscdevice.h>
1514
#include <linux/mutex.h>

0 commit comments

Comments
 (0)