Merge tag 'nfs-for-6.9-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[sfrench/cifs-2.6.git] / fs / nfs / nfs4proc.c
index e9c4f7b9d44e97b04eaa3dab4b7abc3e842dbfa7..ea390db94b622f5332f5126ea15f95bc8131344e 100644 (file)
@@ -6795,7 +6795,7 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
        status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
        switch (status) {
                case 0:
-                       request->fl_type = F_UNLCK;
+                       request->c.flc_type = F_UNLCK;
                        break;
                case -NFS4ERR_DENIED:
                        status = 0;
@@ -7013,8 +7013,8 @@ static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
        /* Ensure this is an unlock - when canceling a lock, the
         * canceled lock is passed in, and it won't be an unlock.
         */
-       fl->fl_type = F_UNLCK;
-       if (fl->fl_flags & FL_CLOSE)
+       fl->c.flc_type = F_UNLCK;
+       if (fl->c.flc_flags & FL_CLOSE)
                set_bit(NFS_CONTEXT_UNLOCK, &ctx->flags);
 
        data = nfs4_alloc_unlockdata(fl, ctx, lsp, seqid);
@@ -7040,11 +7040,11 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *
        struct rpc_task *task;
        struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t);
        int status = 0;
-       unsigned char fl_flags = request->fl_flags;
+       unsigned char saved_flags = request->c.flc_flags;
 
        status = nfs4_set_lock_state(state, request);
        /* Unlock _before_ we do the RPC call */
-       request->fl_flags |= FL_EXISTS;
+       request->c.flc_flags |= FL_EXISTS;
        /* Exclude nfs_delegation_claim_locks() */
        mutex_lock(&sp->so_delegreturn_mutex);
        /* Exclude nfs4_reclaim_open_stateid() - note nesting! */
@@ -7068,14 +7068,16 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *
        status = -ENOMEM;
        if (IS_ERR(seqid))
                goto out;
-       task = nfs4_do_unlck(request, nfs_file_open_context(request->fl_file), lsp, seqid);
+       task = nfs4_do_unlck(request,
+                            nfs_file_open_context(request->c.flc_file),
+                            lsp, seqid);
        status = PTR_ERR(task);
        if (IS_ERR(task))
                goto out;
        status = rpc_wait_for_completion_task(task);
        rpc_put_task(task);
 out:
-       request->fl_flags = fl_flags;
+       request->c.flc_flags = saved_flags;
        trace_nfs4_unlock(request, state, F_SETLK, status);
        return status;
 }
@@ -7186,7 +7188,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
                renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
                                data->timestamp);
                if (data->arg.new_lock && !data->cancelled) {
-                       data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
+                       data->fl.c.flc_flags &= ~(FL_SLEEP | FL_ACCESS);
                        if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
                                goto out_restart;
                }
@@ -7287,7 +7289,8 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
        if (nfs_server_capable(state->inode, NFS_CAP_MOVEABLE))
                task_setup_data.flags |= RPC_TASK_MOVEABLE;
 
-       data = nfs4_alloc_lockdata(fl, nfs_file_open_context(fl->fl_file),
+       data = nfs4_alloc_lockdata(fl,
+                                  nfs_file_open_context(fl->c.flc_file),
                                   fl->fl_u.nfs4_fl.owner, GFP_KERNEL);
        if (data == NULL)
                return -ENOMEM;
@@ -7393,10 +7396,10 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
 {
        struct nfs_inode *nfsi = NFS_I(state->inode);
        struct nfs4_state_owner *sp = state->owner;
-       unsigned char fl_flags = request->fl_flags;
+       unsigned char flags = request->c.flc_flags;
        int status;
 
-       request->fl_flags |= FL_ACCESS;
+       request->c.flc_flags |= FL_ACCESS;
        status = locks_lock_inode_wait(state->inode, request);
        if (status < 0)
                goto out;
@@ -7405,7 +7408,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
        if (test_bit(NFS_DELEGATED_STATE, &state->flags)) {
                /* Yes: cache locks! */
                /* ...but avoid races with delegation recall... */
-               request->fl_flags = fl_flags & ~FL_SLEEP;
+               request->c.flc_flags = flags & ~FL_SLEEP;
                status = locks_lock_inode_wait(state->inode, request);
                up_read(&nfsi->rwsem);
                mutex_unlock(&sp->so_delegreturn_mutex);
@@ -7415,7 +7418,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
        mutex_unlock(&sp->so_delegreturn_mutex);
        status = _nfs4_do_setlk(state, cmd, request, NFS_LOCK_NEW);
 out:
-       request->fl_flags = fl_flags;
+       request->c.flc_flags = flags;
        return status;
 }
 
@@ -7557,7 +7560,7 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
        if (!(IS_SETLK(cmd) || IS_SETLKW(cmd)))
                return -EINVAL;
 
-       if (request->fl_type == F_UNLCK) {
+       if (lock_is_unlock(request)) {
                if (state != NULL)
                        return nfs4_proc_unlck(state, cmd, request);
                return 0;
@@ -7566,7 +7569,7 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
        if (state == NULL)
                return -ENOLCK;
 
-       if ((request->fl_flags & FL_POSIX) &&
+       if ((request->c.flc_flags & FL_POSIX) &&
            !test_bit(NFS_STATE_POSIX_LOCKS, &state->flags))
                return -ENOLCK;
 
@@ -7574,7 +7577,7 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
         * Don't rely on the VFS having checked the file open mode,
         * since it won't do this for flock() locks.
         */
-       switch (request->fl_type) {
+       switch (request->c.flc_type) {
        case F_RDLCK:
                if (!(filp->f_mode & FMODE_READ))
                        return -EBADF;
@@ -7596,7 +7599,7 @@ static int nfs4_delete_lease(struct file *file, void **priv)
        return generic_setlease(file, F_UNLCK, NULL, priv);
 }
 
-static int nfs4_add_lease(struct file *file, int arg, struct file_lock **lease,
+static int nfs4_add_lease(struct file *file, int arg, struct file_lease **lease,
                          void **priv)
 {
        struct inode *inode = file_inode(file);
@@ -7614,7 +7617,7 @@ static int nfs4_add_lease(struct file *file, int arg, struct file_lock **lease,
        return -EAGAIN;
 }
 
-int nfs4_proc_setlease(struct file *file, int arg, struct file_lock **lease,
+int nfs4_proc_setlease(struct file *file, int arg, struct file_lease **lease,
                       void **priv)
 {
        switch (arg) {