Skip to content

Commit c9c99a3

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: rename NFS4_SHARE_WANT_* constants to OPEN4_SHARE_ACCESS_WANT_*
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 <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 8dfbea8 commit c9c99a3

File tree

6 files changed

+51
-20
lines changed

6 files changed

+51
-20
lines changed

Documentation/sunrpc/xdr/nfs4_1.x

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ pragma public fattr4_open_arguments;
138138
const FATTR4_OPEN_ARGUMENTS = 86;
139139

140140

141-
const OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000;
142141

143142

144143
const OPEN4_RESULT_NO_OPEN_STATEID = 0x00000010;
@@ -161,7 +160,21 @@ pragma public fattr4_time_deleg_modify;
161160
const FATTR4_TIME_DELEG_ACCESS = 84;
162161
const FATTR4_TIME_DELEG_MODIFY = 85;
163162

163+
164+
165+
/* new flags for share_access field of OPEN4args */
166+
const OPEN4_SHARE_ACCESS_WANT_DELEG_MASK = 0xFF00;
167+
const OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE = 0x0000;
168+
const OPEN4_SHARE_ACCESS_WANT_READ_DELEG = 0x0100;
169+
const OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG = 0x0200;
170+
const OPEN4_SHARE_ACCESS_WANT_ANY_DELEG = 0x0300;
171+
const OPEN4_SHARE_ACCESS_WANT_NO_DELEG = 0x0400;
172+
const OPEN4_SHARE_ACCESS_WANT_CANCEL = 0x0500;
173+
174+
const OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL = 0x10000;
175+
const OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED = 0x20000;
164176
const OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 0x100000;
177+
const OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000;
165178

166179
enum open_delegation_type4 {
167180
OPEN_DELEGATE_NONE = 0,

fs/nfsd/nfs4state.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6073,14 +6073,14 @@ static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status)
60736073
else {
60746074
open->op_why_no_deleg = WND4_RESOURCE;
60756075
switch (open->op_deleg_want) {
6076-
case NFS4_SHARE_WANT_READ_DELEG:
6077-
case NFS4_SHARE_WANT_WRITE_DELEG:
6078-
case NFS4_SHARE_WANT_ANY_DELEG:
6076+
case OPEN4_SHARE_ACCESS_WANT_READ_DELEG:
6077+
case OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG:
6078+
case OPEN4_SHARE_ACCESS_WANT_ANY_DELEG:
60796079
break;
6080-
case NFS4_SHARE_WANT_CANCEL:
6080+
case OPEN4_SHARE_ACCESS_WANT_CANCEL:
60816081
open->op_why_no_deleg = WND4_CANCELLED;
60826082
break;
6083-
case NFS4_SHARE_WANT_NO_DELEG:
6083+
case OPEN4_SHARE_ACCESS_WANT_NO_DELEG:
60846084
WARN_ON_ONCE(1);
60856085
}
60866086
}
@@ -6210,11 +6210,11 @@ nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
62106210
static void nfsd4_deleg_xgrade_none_ext(struct nfsd4_open *open,
62116211
struct nfs4_delegation *dp)
62126212
{
6213-
if (open->op_deleg_want == NFS4_SHARE_WANT_READ_DELEG &&
6213+
if (open->op_deleg_want == OPEN4_SHARE_ACCESS_WANT_READ_DELEG &&
62146214
dp->dl_type == OPEN_DELEGATE_WRITE) {
62156215
open->op_delegate_type = OPEN_DELEGATE_NONE_EXT;
62166216
open->op_why_no_deleg = WND4_NOT_SUPP_DOWNGRADE;
6217-
} else if (open->op_deleg_want == NFS4_SHARE_WANT_WRITE_DELEG &&
6217+
} else if (open->op_deleg_want == OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG &&
62186218
dp->dl_type == OPEN_DELEGATE_WRITE) {
62196219
open->op_delegate_type = OPEN_DELEGATE_NONE_EXT;
62206220
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
63106310
mutex_unlock(&stp->st_mutex);
63116311

63126312
if (nfsd4_has_session(&resp->cstate)) {
6313-
if (open->op_deleg_want & NFS4_SHARE_WANT_NO_DELEG) {
6313+
if (open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_NO_DELEG) {
63146314
open->op_delegate_type = OPEN_DELEGATE_NONE_EXT;
63156315
open->op_why_no_deleg = WND4_NOT_WANTED;
63166316
goto nodeleg;

fs/nfsd/nfs4xdr.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,12 +1067,12 @@ static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *sh
10671067
if (!argp->minorversion)
10681068
return nfserr_bad_xdr;
10691069
switch (w & NFS4_SHARE_WANT_MASK) {
1070-
case NFS4_SHARE_WANT_NO_PREFERENCE:
1071-
case NFS4_SHARE_WANT_READ_DELEG:
1072-
case NFS4_SHARE_WANT_WRITE_DELEG:
1073-
case NFS4_SHARE_WANT_ANY_DELEG:
1074-
case NFS4_SHARE_WANT_NO_DELEG:
1075-
case NFS4_SHARE_WANT_CANCEL:
1070+
case OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE:
1071+
case OPEN4_SHARE_ACCESS_WANT_READ_DELEG:
1072+
case OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG:
1073+
case OPEN4_SHARE_ACCESS_WANT_ANY_DELEG:
1074+
case OPEN4_SHARE_ACCESS_WANT_NO_DELEG:
1075+
case OPEN4_SHARE_ACCESS_WANT_CANCEL:
10761076
break;
10771077
default:
10781078
return nfserr_bad_xdr;

fs/nfsd/nfs4xdr_gen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
// Generated by xdrgen. Manual edits will be lost.
33
// XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x
4-
// XDR specification modification time: Sat Oct 12 08:10:54 2024
4+
// XDR specification modification time: Mon Oct 14 09:10:13 2024
55

66
#include <linux/sunrpc/svc.h>
77

fs/nfsd/nfs4xdr_gen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/* Generated by xdrgen. Manual edits will be lost. */
33
/* XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x */
4-
/* XDR specification modification time: Sat Oct 12 08:10:54 2024 */
4+
/* XDR specification modification time: Mon Oct 14 09:10:13 2024 */
55

66
#ifndef _LINUX_XDRGEN_NFS4_1_DECL_H
77
#define _LINUX_XDRGEN_NFS4_1_DECL_H

include/linux/sunrpc/xdrgen/nfs4_1.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/* Generated by xdrgen. Manual edits will be lost. */
33
/* XDR specification file: ../../Documentation/sunrpc/xdr/nfs4_1.x */
4-
/* XDR specification modification time: Sat Oct 12 08:10:54 2024 */
4+
/* XDR specification modification time: Mon Oct 14 09:10:13 2024 */
55

66
#ifndef _LINUX_XDRGEN_NFS4_1_DEF_H
77
#define _LINUX_XDRGEN_NFS4_1_DEF_H
@@ -84,8 +84,6 @@ typedef struct open_arguments4 fattr4_open_arguments;
8484

8585
enum { FATTR4_OPEN_ARGUMENTS = 86 };
8686

87-
enum { OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000 };
88-
8987
enum { OPEN4_RESULT_NO_OPEN_STATEID = 0x00000010 };
9088

9189
typedef struct nfstime4 fattr4_time_deleg_access;
@@ -96,8 +94,28 @@ enum { FATTR4_TIME_DELEG_ACCESS = 84 };
9694

9795
enum { FATTR4_TIME_DELEG_MODIFY = 85 };
9896

97+
enum { OPEN4_SHARE_ACCESS_WANT_DELEG_MASK = 0xFF00 };
98+
99+
enum { OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE = 0x0000 };
100+
101+
enum { OPEN4_SHARE_ACCESS_WANT_READ_DELEG = 0x0100 };
102+
103+
enum { OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG = 0x0200 };
104+
105+
enum { OPEN4_SHARE_ACCESS_WANT_ANY_DELEG = 0x0300 };
106+
107+
enum { OPEN4_SHARE_ACCESS_WANT_NO_DELEG = 0x0400 };
108+
109+
enum { OPEN4_SHARE_ACCESS_WANT_CANCEL = 0x0500 };
110+
111+
enum { OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL = 0x10000 };
112+
113+
enum { OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED = 0x20000 };
114+
99115
enum { OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 0x100000 };
100116

117+
enum { OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000 };
118+
101119
enum open_delegation_type4 {
102120
OPEN_DELEGATE_NONE = 0,
103121
OPEN_DELEGATE_READ = 1,

0 commit comments

Comments
 (0)