]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfsd: rename NFS4_SHARE_WANT_* constants to OPEN4_SHARE_ACCESS_WANT_*
authorJeff Layton <jlayton@kernel.org>
Mon, 9 Dec 2024 21:13:56 +0000 (16:13 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 21 Jan 2025 20:30:01 +0000 (15:30 -0500)
Add the OPEN4_SHARE_ACCESS_WANT constants from the nfs4.1 and delstid
draft into the nfs4_1.x file, and regenerate the headers and source
files. Do a mass renaming of NFS4_SHARE_WANT_* to
OPEN4_SHARE_ACCESS_WANT_* in the nfsd directory.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Documentation/sunrpc/xdr/nfs4_1.x
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr_gen.c
fs/nfsd/nfs4xdr_gen.h
include/linux/sunrpc/xdrgen/nfs4_1.h

index ee9f8f249f1e71dbfc383007a6950ebc4104ed67..ca95150a3a29fc5418991bf2395326bd73645ea8 100644 (file)
@@ -138,7 +138,6 @@ pragma public fattr4_open_arguments;
 const FATTR4_OPEN_ARGUMENTS     = 86;
 
 
-const OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000;
 
 
 const OPEN4_RESULT_NO_OPEN_STATEID = 0x00000010;
@@ -161,7 +160,21 @@ pragma public              fattr4_time_deleg_modify;
 const FATTR4_TIME_DELEG_ACCESS  = 84;
 const FATTR4_TIME_DELEG_MODIFY  = 85;
 
+
+
+/* new flags for share_access field of OPEN4args */
+const OPEN4_SHARE_ACCESS_WANT_DELEG_MASK        = 0xFF00;
+const OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE     = 0x0000;
+const OPEN4_SHARE_ACCESS_WANT_READ_DELEG        = 0x0100;
+const OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG       = 0x0200;
+const OPEN4_SHARE_ACCESS_WANT_ANY_DELEG         = 0x0300;
+const OPEN4_SHARE_ACCESS_WANT_NO_DELEG          = 0x0400;
+const OPEN4_SHARE_ACCESS_WANT_CANCEL            = 0x0500;
+
+const OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL = 0x10000;
+const OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED = 0x20000;
 const OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 0x100000;
+const OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000;
 
 enum open_delegation_type4 {
        OPEN_DELEGATE_NONE                  = 0,
index a39c480da327b233203decd5f5c6c2e9ee97704d..0c73cb8fae1944e3ba044ea6365e4bc3ae71c5a2 100644 (file)
@@ -6073,14 +6073,14 @@ static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status)
        else {
                open->op_why_no_deleg = WND4_RESOURCE;
                switch (open->op_deleg_want) {
-               case NFS4_SHARE_WANT_READ_DELEG:
-               case NFS4_SHARE_WANT_WRITE_DELEG:
-               case NFS4_SHARE_WANT_ANY_DELEG:
+               case OPEN4_SHARE_ACCESS_WANT_READ_DELEG:
+               case OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG:
+               case OPEN4_SHARE_ACCESS_WANT_ANY_DELEG:
                        break;
-               case NFS4_SHARE_WANT_CANCEL:
+               case OPEN4_SHARE_ACCESS_WANT_CANCEL:
                        open->op_why_no_deleg = WND4_CANCELLED;
                        break;
-               case NFS4_SHARE_WANT_NO_DELEG:
+               case OPEN4_SHARE_ACCESS_WANT_NO_DELEG:
                        WARN_ON_ONCE(1);
                }
        }
@@ -6210,11 +6210,11 @@ out_no_deleg:
 static void nfsd4_deleg_xgrade_none_ext(struct nfsd4_open *open,
                                        struct nfs4_delegation *dp)
 {
-       if (open->op_deleg_want == NFS4_SHARE_WANT_READ_DELEG &&
+       if (open->op_deleg_want == OPEN4_SHARE_ACCESS_WANT_READ_DELEG &&
            dp->dl_type == OPEN_DELEGATE_WRITE) {
                open->op_delegate_type = OPEN_DELEGATE_NONE_EXT;
                open->op_why_no_deleg = WND4_NOT_SUPP_DOWNGRADE;
-       } else if (open->op_deleg_want == NFS4_SHARE_WANT_WRITE_DELEG &&
+       } else if (open->op_deleg_want == OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG &&
                   dp->dl_type == OPEN_DELEGATE_WRITE) {
                open->op_delegate_type = OPEN_DELEGATE_NONE_EXT;
                open->op_why_no_deleg = WND4_NOT_SUPP_UPGRADE;
@@ -6310,7 +6310,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
        mutex_unlock(&stp->st_mutex);
 
        if (nfsd4_has_session(&resp->cstate)) {
-               if (open->op_deleg_want & NFS4_SHARE_WANT_NO_DELEG) {
+               if (open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_NO_DELEG) {
                        open->op_delegate_type = OPEN_DELEGATE_NONE_EXT;
                        open->op_why_no_deleg = WND4_NOT_WANTED;
                        goto nodeleg;
index b6966acddcb66416f97c10f967f7537be3cb924f..e3f1cb59e1181bdc95697a570955467cfc368a86 100644 (file)
@@ -1067,12 +1067,12 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
        if (!argp->minorversion)
                return nfserr_bad_xdr;
        switch (w & NFS4_SHARE_WANT_MASK) {
-       case NFS4_SHARE_WANT_NO_PREFERENCE:
-       case NFS4_SHARE_WANT_READ_DELEG:
-       case NFS4_SHARE_WANT_WRITE_DELEG:
-       case NFS4_SHARE_WANT_ANY_DELEG:
-       case NFS4_SHARE_WANT_NO_DELEG:
-       case NFS4_SHARE_WANT_CANCEL:
+       case OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE:
+       case OPEN4_SHARE_ACCESS_WANT_READ_DELEG:
+       case OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG:
+       case OPEN4_SHARE_ACCESS_WANT_ANY_DELEG:
+       case OPEN4_SHARE_ACCESS_WANT_NO_DELEG:
+       case OPEN4_SHARE_ACCESS_WANT_CANCEL:
                break;
        default:
                return nfserr_bad_xdr;
index a0e01f50a28d7f6828f3e6ef02f90b84bf180841..a17b5d8e60b3579caa2e2a8b40ed757070e1a622 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 // Generated by xdrgen. Manual edits will be lost.
 // XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x
-// XDR specification modification time: Sat Oct 12 08:10:54 2024
+// XDR specification modification time: Mon Oct 14 09:10:13 2024
 
 #include <linux/sunrpc/svc.h>
 
index 3fc8bde2b3b5db6f80f17b41e7f5991487cfa959..41a0033b72562ee3c1fcdcd4a887ce635385b22b 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /* Generated by xdrgen. Manual edits will be lost. */
 /* XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x */
-/* XDR specification modification time: Sat Oct 12 08:10:54 2024 */
+/* XDR specification modification time: Mon Oct 14 09:10:13 2024 */
 
 #ifndef _LINUX_XDRGEN_NFS4_1_DECL_H
 #define _LINUX_XDRGEN_NFS4_1_DECL_H
index 9ca83a4a04cff8ebb5aafa08a24a2db771d6c1ef..cf21a14aa8850f4b21cd365cb7bc22a02c6097ce 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /* Generated by xdrgen. Manual edits will be lost. */
 /* XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x */
-/* XDR specification modification time: Sat Oct 12 08:10:54 2024 */
+/* XDR specification modification time: Mon Oct 14 09:10:13 2024 */
 
 #ifndef _LINUX_XDRGEN_NFS4_1_DEF_H
 #define _LINUX_XDRGEN_NFS4_1_DEF_H
@@ -84,8 +84,6 @@ typedef struct open_arguments4 fattr4_open_arguments;
 
 enum { FATTR4_OPEN_ARGUMENTS = 86 };
 
-enum { OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000 };
-
 enum { OPEN4_RESULT_NO_OPEN_STATEID = 0x00000010 };
 
 typedef struct nfstime4 fattr4_time_deleg_access;
@@ -96,8 +94,28 @@ enum { FATTR4_TIME_DELEG_ACCESS = 84 };
 
 enum { FATTR4_TIME_DELEG_MODIFY = 85 };
 
+enum { OPEN4_SHARE_ACCESS_WANT_DELEG_MASK = 0xFF00 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE = 0x0000 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_READ_DELEG = 0x0100 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG = 0x0200 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_ANY_DELEG = 0x0300 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_NO_DELEG = 0x0400 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_CANCEL = 0x0500 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL = 0x10000 };
+
+enum { OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED = 0x20000 };
+
 enum { OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 0x100000 };
 
+enum { OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000 };
+
 enum open_delegation_type4 {
        OPEN_DELEGATE_NONE = 0,
        OPEN_DELEGATE_READ = 1,