Skip to content

Commit a6bf23e

Browse files
jtlaytonbrauner
authored andcommitted
gfs2: 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 <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240131-flsplit-v3-38-c6129007ee8d@kernel.org Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 966b7bd commit a6bf23e

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

fs/gfs2/file.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/mm.h>
1616
#include <linux/mount.h>
1717
#include <linux/fs.h>
18-
#define _NEED_FILE_LOCK_FIELD_MACROS
1918
#include <linux/filelock.h>
2019
#include <linux/gfs2_ondisk.h>
2120
#include <linux/falloc.h>
@@ -1441,7 +1440,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
14411440
struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host);
14421441
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
14431442

1444-
if (!(fl->fl_flags & FL_POSIX))
1443+
if (!(fl->c.flc_flags & FL_POSIX))
14451444
return -ENOLCK;
14461445
if (gfs2_withdrawing_or_withdrawn(sdp)) {
14471446
if (lock_is_unlock(fl))
@@ -1484,7 +1483,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
14841483
int error = 0;
14851484
int sleeptime;
14861485

1487-
state = (lock_is_write(fl)) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
1486+
state = lock_is_write(fl) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
14881487
flags = GL_EXACT | GL_NOPID;
14891488
if (!IS_SETLKW(cmd))
14901489
flags |= LM_FLAG_TRY_1CB;
@@ -1496,8 +1495,8 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
14961495
if (fl_gh->gh_state == state)
14971496
goto out;
14981497
locks_init_lock(&request);
1499-
request.fl_type = F_UNLCK;
1500-
request.fl_flags = FL_FLOCK;
1498+
request.c.flc_type = F_UNLCK;
1499+
request.c.flc_flags = FL_FLOCK;
15011500
locks_lock_file_wait(file, &request);
15021501
gfs2_glock_dq(fl_gh);
15031502
gfs2_holder_reinit(state, flags, fl_gh);
@@ -1558,7 +1557,7 @@ static void do_unflock(struct file *file, struct file_lock *fl)
15581557

15591558
static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl)
15601559
{
1561-
if (!(fl->fl_flags & FL_FLOCK))
1560+
if (!(fl->c.flc_flags & FL_FLOCK))
15621561
return -ENOLCK;
15631562

15641563
if (lock_is_unlock(fl)) {

0 commit comments

Comments
 (0)