]>
Commit | Line | Data |
---|---|---|
52761858 SL |
1 | From 5a2ee73331c0e4b3d8fbd1fb24aff86e2eb4bebb Mon Sep 17 00:00:00 2001 |
2 | From: Sasha Levin <sashal@kernel.org> | |
3 | Date: Sun, 6 Feb 2022 12:25:47 -0500 | |
4 | Subject: NFSD: Remove CONFIG_NFSD_V3 | |
5 | ||
6 | From: Chuck Lever <chuck.lever@oracle.com> | |
7 | ||
8 | [ Upstream commit 5f9a62ff7d2808c7b56c0ec90f3b7eae5872afe6 ] | |
9 | ||
10 | Eventually support for NFSv2 in the Linux NFS server is to be | |
11 | deprecated and then removed. | |
12 | ||
13 | However, NFSv2 is the "always supported" version that is available | |
14 | as soon as CONFIG_NFSD is set. Before NFSv2 support can be removed, | |
15 | we need to choose a different "always supported" version. | |
16 | ||
17 | This patch removes CONFIG_NFSD_V3 so that NFSv3 is always supported, | |
18 | as NFSv2 is today. When NFSv2 support is removed, NFSv3 will become | |
19 | the only "always supported" NFS version. | |
20 | ||
21 | The defconfigs still need to be updated to remove CONFIG_NFSD_V3=y. | |
22 | ||
23 | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> | |
24 | --- | |
25 | fs/Kconfig | 2 +- | |
26 | fs/nfsd/Kconfig | 12 +----------- | |
27 | fs/nfsd/Makefile | 3 +-- | |
28 | fs/nfsd/nfsfh.c | 4 ---- | |
29 | fs/nfsd/nfsfh.h | 20 -------------------- | |
30 | fs/nfsd/nfssvc.c | 2 -- | |
31 | fs/nfsd/vfs.c | 9 --------- | |
32 | fs/nfsd/vfs.h | 2 -- | |
33 | 8 files changed, 3 insertions(+), 51 deletions(-) | |
34 | ||
35 | diff --git a/fs/Kconfig b/fs/Kconfig | |
36 | index 971339ecc1a2b..9ea9614107a48 100644 | |
37 | --- a/fs/Kconfig | |
38 | +++ b/fs/Kconfig | |
39 | @@ -344,7 +344,7 @@ config LOCKD | |
40 | ||
41 | config LOCKD_V4 | |
42 | bool | |
43 | - depends on NFSD_V3 || NFS_V3 | |
44 | + depends on NFSD || NFS_V3 | |
45 | depends on FILE_LOCKING | |
46 | default y | |
47 | ||
48 | diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig | |
49 | index 6e9ea4ee0f737..b83a6e3bf8080 100644 | |
50 | --- a/fs/nfsd/Kconfig | |
51 | +++ b/fs/nfsd/Kconfig | |
52 | @@ -35,18 +35,9 @@ config NFSD_V2_ACL | |
53 | bool | |
54 | depends on NFSD | |
55 | ||
56 | -config NFSD_V3 | |
57 | - bool "NFS server support for NFS version 3" | |
58 | - depends on NFSD | |
59 | - help | |
60 | - This option enables support in your system's NFS server for | |
61 | - version 3 of the NFS protocol (RFC 1813). | |
62 | - | |
63 | - If unsure, say Y. | |
64 | - | |
65 | config NFSD_V3_ACL | |
66 | bool "NFS server support for the NFSv3 ACL protocol extension" | |
67 | - depends on NFSD_V3 | |
68 | + depends on NFSD | |
69 | select NFSD_V2_ACL | |
70 | help | |
71 | Solaris NFS servers support an auxiliary NFSv3 ACL protocol that | |
72 | @@ -70,7 +61,6 @@ config NFSD_V3_ACL | |
73 | config NFSD_V4 | |
74 | bool "NFS server support for NFS version 4" | |
75 | depends on NFSD && PROC_FS | |
76 | - select NFSD_V3 | |
77 | select FS_POSIX_ACL | |
78 | select SUNRPC_GSS | |
79 | select CRYPTO | |
80 | diff --git a/fs/nfsd/Makefile b/fs/nfsd/Makefile | |
81 | index 3f0983e93a998..805c06d5f1b4b 100644 | |
82 | --- a/fs/nfsd/Makefile | |
83 | +++ b/fs/nfsd/Makefile | |
84 | @@ -12,9 +12,8 @@ nfsd-y += trace.o | |
85 | ||
86 | nfsd-y += nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \ | |
87 | export.o auth.o lockd.o nfscache.o nfsxdr.o \ | |
88 | - stats.o filecache.o | |
89 | + stats.o filecache.o nfs3proc.o nfs3xdr.o | |
90 | nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o | |
91 | -nfsd-$(CONFIG_NFSD_V3) += nfs3proc.o nfs3xdr.o | |
92 | nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o | |
93 | nfsd-$(CONFIG_NFSD_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \ | |
94 | nfs4acl.o nfs4callback.o nfs4recover.o | |
95 | diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c | |
96 | index 145208bcb9bd4..c29baa03dfafd 100644 | |
97 | --- a/fs/nfsd/nfsfh.c | |
98 | +++ b/fs/nfsd/nfsfh.c | |
99 | @@ -611,8 +611,6 @@ fh_update(struct svc_fh *fhp) | |
100 | return nfserr_serverfault; | |
101 | } | |
102 | ||
103 | -#ifdef CONFIG_NFSD_V3 | |
104 | - | |
105 | /** | |
106 | * fh_fill_pre_attrs - Fill in pre-op attributes | |
107 | * @fhp: file handle to be updated | |
108 | @@ -673,8 +671,6 @@ void fh_fill_post_attrs(struct svc_fh *fhp) | |
109 | nfsd4_change_attribute(&fhp->fh_post_attr, inode); | |
110 | } | |
111 | ||
112 | -#endif /* CONFIG_NFSD_V3 */ | |
113 | - | |
114 | /* | |
115 | * Release a file handle. | |
116 | */ | |
117 | diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h | |
118 | index 434930d8a946e..fb9d358a267e5 100644 | |
119 | --- a/fs/nfsd/nfsfh.h | |
120 | +++ b/fs/nfsd/nfsfh.h | |
121 | @@ -90,7 +90,6 @@ typedef struct svc_fh { | |
122 | * operation | |
123 | */ | |
124 | int fh_flags; /* FH flags */ | |
125 | -#ifdef CONFIG_NFSD_V3 | |
126 | bool fh_post_saved; /* post-op attrs saved */ | |
127 | bool fh_pre_saved; /* pre-op attrs saved */ | |
128 | ||
129 | @@ -107,7 +106,6 @@ typedef struct svc_fh { | |
130 | /* Post-op attributes saved in fh_unlock */ | |
131 | struct kstat fh_post_attr; /* full attrs after operation */ | |
132 | u64 fh_post_change; /* nfsv4 change; see above */ | |
133 | -#endif /* CONFIG_NFSD_V3 */ | |
134 | } svc_fh; | |
135 | #define NFSD4_FH_FOREIGN (1<<0) | |
136 | #define SET_FH_FLAG(c, f) ((c)->fh_flags |= (f)) | |
137 | @@ -283,8 +281,6 @@ static inline u32 knfsd_fh_hash(const struct knfsd_fh *fh) | |
138 | } | |
139 | #endif | |
140 | ||
141 | -#ifdef CONFIG_NFSD_V3 | |
142 | - | |
143 | /** | |
144 | * fh_clear_pre_post_attrs - Reset pre/post attributes | |
145 | * @fhp: file handle to be updated | |
146 | @@ -327,22 +323,6 @@ static inline u64 nfsd4_change_attribute(struct kstat *stat, | |
147 | extern void fh_fill_pre_attrs(struct svc_fh *fhp); | |
148 | extern void fh_fill_post_attrs(struct svc_fh *fhp); | |
149 | ||
150 | -#else /* !CONFIG_NFSD_V3 */ | |
151 | - | |
152 | -static inline void fh_clear_pre_post_attrs(struct svc_fh *fhp) | |
153 | -{ | |
154 | -} | |
155 | - | |
156 | -static inline void fh_fill_pre_attrs(struct svc_fh *fhp) | |
157 | -{ | |
158 | -} | |
159 | - | |
160 | -static inline void fh_fill_post_attrs(struct svc_fh *fhp) | |
161 | -{ | |
162 | -} | |
163 | - | |
164 | -#endif /* !CONFIG_NFSD_V3 */ | |
165 | - | |
166 | ||
167 | /* | |
168 | * Lock a file handle/inode | |
169 | diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c | |
170 | index 2f74be98ff2d9..011c556caa1e7 100644 | |
171 | --- a/fs/nfsd/nfssvc.c | |
172 | +++ b/fs/nfsd/nfssvc.c | |
173 | @@ -117,9 +117,7 @@ static struct svc_stat nfsd_acl_svcstats = { | |
174 | ||
175 | static const struct svc_version *nfsd_version[] = { | |
176 | [2] = &nfsd_version2, | |
177 | -#if defined(CONFIG_NFSD_V3) | |
178 | [3] = &nfsd_version3, | |
179 | -#endif | |
180 | #if defined(CONFIG_NFSD_V4) | |
181 | [4] = &nfsd_version4, | |
182 | #endif | |
183 | diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c | |
184 | index 4d07a506164b0..00e956bdefaae 100644 | |
185 | --- a/fs/nfsd/vfs.c | |
186 | +++ b/fs/nfsd/vfs.c | |
187 | @@ -32,9 +32,7 @@ | |
188 | #include <linux/writeback.h> | |
189 | #include <linux/security.h> | |
190 | ||
191 | -#ifdef CONFIG_NFSD_V3 | |
192 | #include "xdr3.h" | |
193 | -#endif /* CONFIG_NFSD_V3 */ | |
194 | ||
195 | #ifdef CONFIG_NFSD_V4 | |
196 | #include "../internal.h" | |
197 | @@ -616,7 +614,6 @@ __be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp, | |
198 | } | |
199 | #endif /* defined(CONFIG_NFSD_V4) */ | |
200 | ||
201 | -#ifdef CONFIG_NFSD_V3 | |
202 | /* | |
203 | * Check server access rights to a file system object | |
204 | */ | |
205 | @@ -728,7 +725,6 @@ nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *suppor | |
206 | out: | |
207 | return error; | |
208 | } | |
209 | -#endif /* CONFIG_NFSD_V3 */ | |
210 | ||
211 | int nfsd_open_break_lease(struct inode *inode, int access) | |
212 | { | |
213 | @@ -1121,7 +1117,6 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, | |
214 | return err; | |
215 | } | |
216 | ||
217 | -#ifdef CONFIG_NFSD_V3 | |
218 | /** | |
219 | * nfsd_commit - Commit pending writes to stable storage | |
220 | * @rqstp: RPC request being processed | |
221 | @@ -1199,7 +1194,6 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, u64 offset, | |
222 | out: | |
223 | return err; | |
224 | } | |
225 | -#endif /* CONFIG_NFSD_V3 */ | |
226 | ||
227 | static __be32 | |
228 | nfsd_create_setattr(struct svc_rqst *rqstp, struct svc_fh *resfhp, | |
229 | @@ -1389,8 +1383,6 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |
230 | rdev, resfhp); | |
231 | } | |
232 | ||
233 | -#ifdef CONFIG_NFSD_V3 | |
234 | - | |
235 | /* | |
236 | * NFSv3 and NFSv4 version of nfsd_create | |
237 | */ | |
238 | @@ -1556,7 +1548,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |
239 | err = nfserrno(host_err); | |
240 | goto out; | |
241 | } | |
242 | -#endif /* CONFIG_NFSD_V3 */ | |
243 | ||
244 | /* | |
245 | * Read a symlink. On entry, *lenp must contain the maximum path length that | |
246 | diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h | |
247 | index 2c43d10e3cab4..ccb87b2864f64 100644 | |
248 | --- a/fs/nfsd/vfs.h | |
249 | +++ b/fs/nfsd/vfs.h | |
250 | @@ -68,7 +68,6 @@ __be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *, | |
251 | __be32 nfsd_create(struct svc_rqst *, struct svc_fh *, | |
252 | char *name, int len, struct iattr *attrs, | |
253 | int type, dev_t rdev, struct svc_fh *res); | |
254 | -#ifdef CONFIG_NFSD_V3 | |
255 | __be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); | |
256 | __be32 do_nfsd_create(struct svc_rqst *, struct svc_fh *, | |
257 | char *name, int len, struct iattr *attrs, | |
258 | @@ -76,7 +75,6 @@ __be32 do_nfsd_create(struct svc_rqst *, struct svc_fh *, | |
259 | u32 *verifier, bool *truncp, bool *created); | |
260 | __be32 nfsd_commit(struct svc_rqst *rqst, struct svc_fh *fhp, | |
261 | u64 offset, u32 count, __be32 *verf); | |
262 | -#endif /* CONFIG_NFSD_V3 */ | |
263 | #ifdef CONFIG_NFSD_V4 | |
264 | __be32 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, | |
265 | char *name, void **bufp, int *lenp); | |
266 | -- | |
267 | 2.43.0 | |
268 |