Skip to content

Commit 5f9a62f

Browse files
committed
NFSD: Remove CONFIG_NFSD_V3
Eventually support for NFSv2 in the Linux NFS server is to be deprecated and then removed. However, NFSv2 is the "always supported" version that is available as soon as CONFIG_NFSD is set. Before NFSv2 support can be removed, we need to choose a different "always supported" version. This patch removes CONFIG_NFSD_V3 so that NFSv3 is always supported, as NFSv2 is today. When NFSv2 support is removed, NFSv3 will become the only "always supported" NFS version. The defconfigs still need to be updated to remove CONFIG_NFSD_V3=y. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 4d2eeaf commit 5f9a62f

8 files changed

Lines changed: 3 additions & 51 deletions

File tree

fs/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ config LOCKD
344344

345345
config LOCKD_V4
346346
bool
347-
depends on NFSD_V3 || NFS_V3
347+
depends on NFSD || NFS_V3
348348
depends on FILE_LOCKING
349349
default y
350350

fs/nfsd/Kconfig

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,9 @@ config NFSD_V2_ACL
3535
bool
3636
depends on NFSD
3737

38-
config NFSD_V3
39-
bool "NFS server support for NFS version 3"
40-
depends on NFSD
41-
help
42-
This option enables support in your system's NFS server for
43-
version 3 of the NFS protocol (RFC 1813).
44-
45-
If unsure, say Y.
46-
4738
config NFSD_V3_ACL
4839
bool "NFS server support for the NFSv3 ACL protocol extension"
49-
depends on NFSD_V3
40+
depends on NFSD
5041
select NFSD_V2_ACL
5142
help
5243
Solaris NFS servers support an auxiliary NFSv3 ACL protocol that
@@ -70,7 +61,6 @@ config NFSD_V3_ACL
7061
config NFSD_V4
7162
bool "NFS server support for NFS version 4"
7263
depends on NFSD && PROC_FS
73-
select NFSD_V3
7464
select FS_POSIX_ACL
7565
select SUNRPC_GSS
7666
select CRYPTO

fs/nfsd/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ nfsd-y += trace.o
1212

1313
nfsd-y += nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \
1414
export.o auth.o lockd.o nfscache.o nfsxdr.o \
15-
stats.o filecache.o
15+
stats.o filecache.o nfs3proc.o nfs3xdr.o
1616
nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o
17-
nfsd-$(CONFIG_NFSD_V3) += nfs3proc.o nfs3xdr.o
1817
nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o
1918
nfsd-$(CONFIG_NFSD_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \
2019
nfs4acl.o nfs4callback.o nfs4recover.o

fs/nfsd/nfsfh.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,6 @@ fh_update(struct svc_fh *fhp)
611611
return nfserr_serverfault;
612612
}
613613

614-
#ifdef CONFIG_NFSD_V3
615-
616614
/**
617615
* fh_fill_pre_attrs - Fill in pre-op attributes
618616
* @fhp: file handle to be updated
@@ -673,8 +671,6 @@ void fh_fill_post_attrs(struct svc_fh *fhp)
673671
nfsd4_change_attribute(&fhp->fh_post_attr, inode);
674672
}
675673

676-
#endif /* CONFIG_NFSD_V3 */
677-
678674
/*
679675
* Release a file handle.
680676
*/

fs/nfsd/nfsfh.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ typedef struct svc_fh {
9090
* operation
9191
*/
9292
int fh_flags; /* FH flags */
93-
#ifdef CONFIG_NFSD_V3
9493
bool fh_post_saved; /* post-op attrs saved */
9594
bool fh_pre_saved; /* pre-op attrs saved */
9695

@@ -107,7 +106,6 @@ typedef struct svc_fh {
107106
/* Post-op attributes saved in fh_unlock */
108107
struct kstat fh_post_attr; /* full attrs after operation */
109108
u64 fh_post_change; /* nfsv4 change; see above */
110-
#endif /* CONFIG_NFSD_V3 */
111109
} svc_fh;
112110
#define NFSD4_FH_FOREIGN (1<<0)
113111
#define SET_FH_FLAG(c, f) ((c)->fh_flags |= (f))
@@ -283,8 +281,6 @@ static inline u32 knfsd_fh_hash(const struct knfsd_fh *fh)
283281
}
284282
#endif
285283

286-
#ifdef CONFIG_NFSD_V3
287-
288284
/**
289285
* fh_clear_pre_post_attrs - Reset pre/post attributes
290286
* @fhp: file handle to be updated
@@ -327,22 +323,6 @@ static inline u64 nfsd4_change_attribute(struct kstat *stat,
327323
extern void fh_fill_pre_attrs(struct svc_fh *fhp);
328324
extern void fh_fill_post_attrs(struct svc_fh *fhp);
329325

330-
#else /* !CONFIG_NFSD_V3 */
331-
332-
static inline void fh_clear_pre_post_attrs(struct svc_fh *fhp)
333-
{
334-
}
335-
336-
static inline void fh_fill_pre_attrs(struct svc_fh *fhp)
337-
{
338-
}
339-
340-
static inline void fh_fill_post_attrs(struct svc_fh *fhp)
341-
{
342-
}
343-
344-
#endif /* !CONFIG_NFSD_V3 */
345-
346326

347327
/*
348328
* Lock a file handle/inode

fs/nfsd/nfssvc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ static struct svc_stat nfsd_acl_svcstats = {
117117

118118
static const struct svc_version *nfsd_version[] = {
119119
[2] = &nfsd_version2,
120-
#if defined(CONFIG_NFSD_V3)
121120
[3] = &nfsd_version3,
122-
#endif
123121
#if defined(CONFIG_NFSD_V4)
124122
[4] = &nfsd_version4,
125123
#endif

fs/nfsd/vfs.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
#include <linux/writeback.h>
3333
#include <linux/security.h>
3434

35-
#ifdef CONFIG_NFSD_V3
3635
#include "xdr3.h"
37-
#endif /* CONFIG_NFSD_V3 */
3836

3937
#ifdef CONFIG_NFSD_V4
4038
#include "../internal.h"
@@ -608,7 +606,6 @@ __be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp,
608606
}
609607
#endif /* defined(CONFIG_NFSD_V4) */
610608

611-
#ifdef CONFIG_NFSD_V3
612609
/*
613610
* Check server access rights to a file system object
614611
*/
@@ -720,7 +717,6 @@ nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *suppor
720717
out:
721718
return error;
722719
}
723-
#endif /* CONFIG_NFSD_V3 */
724720

725721
int nfsd_open_break_lease(struct inode *inode, int access)
726722
{
@@ -1113,7 +1109,6 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
11131109
return err;
11141110
}
11151111

1116-
#ifdef CONFIG_NFSD_V3
11171112
/**
11181113
* nfsd_commit - Commit pending writes to stable storage
11191114
* @rqstp: RPC request being processed
@@ -1190,7 +1185,6 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, u64 offset,
11901185
out:
11911186
return err;
11921187
}
1193-
#endif /* CONFIG_NFSD_V3 */
11941188

11951189
static __be32
11961190
nfsd_create_setattr(struct svc_rqst *rqstp, struct svc_fh *resfhp,
@@ -1380,8 +1374,6 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
13801374
rdev, resfhp);
13811375
}
13821376

1383-
#ifdef CONFIG_NFSD_V3
1384-
13851377
/*
13861378
* NFSv3 and NFSv4 version of nfsd_create
13871379
*/
@@ -1547,7 +1539,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
15471539
err = nfserrno(host_err);
15481540
goto out;
15491541
}
1550-
#endif /* CONFIG_NFSD_V3 */
15511542

15521543
/*
15531544
* Read a symlink. On entry, *lenp must contain the maximum path length that

fs/nfsd/vfs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ __be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
6868
__be32 nfsd_create(struct svc_rqst *, struct svc_fh *,
6969
char *name, int len, struct iattr *attrs,
7070
int type, dev_t rdev, struct svc_fh *res);
71-
#ifdef CONFIG_NFSD_V3
7271
__be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
7372
__be32 do_nfsd_create(struct svc_rqst *, struct svc_fh *,
7473
char *name, int len, struct iattr *attrs,
7574
struct svc_fh *res, int createmode,
7675
u32 *verifier, bool *truncp, bool *created);
7776
__be32 nfsd_commit(struct svc_rqst *rqst, struct svc_fh *fhp,
7877
u64 offset, u32 count, __be32 *verf);
79-
#endif /* CONFIG_NFSD_V3 */
8078
#ifdef CONFIG_NFSD_V4
8179
__be32 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
8280
char *name, void **bufp, int *lenp);

0 commit comments

Comments
 (0)