[PATCH] knfsd: remove nfsd_versbits as intermediate storage for desired versions

We have an array 'nfsd_version' which lists the available versions of nfsd,
and 'nfsd_versions' (poor choice there :-() which lists the currently active
versions.

Then we have a bitmap - nfsd_versbits which says which versions are wanted.
The bits in this bitset cause content to be copied from nfsd_version to
nfsd_versions when nfsd starts.

This patch removes nfsd_versbits and moves information directly from
nfsd_version to nfsd_versions when requests for version changes arrive.

Note that this doesn't make it possible to change versions while the server is
running.  This is because serv->sv_xdrsize is calculated when a service is
created, and used when threads are created, and xdrsize depends on the active
versions.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
NeilBrown
2006-10-02 02:17:46 -07:00
committed by Linus Torvalds
parent 24e36663c3
commit 6658d3a7bb
4 changed files with 62 additions and 70 deletions

View File

@@ -140,6 +140,10 @@ struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
#endif
enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };
int nfsd_vers(int vers, enum vers_op change);
void nfsd_reset_versions(void);
/*
* NFSv4 State

View File

@@ -38,21 +38,6 @@
#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
/*
* Macros used to set version
*/
#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
#define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
#if defined(CONFIG_NFSD_V4)
#define NFSCTL_VERALL (0x1c /* 0b011100 */)
#elif defined(CONFIG_NFSD_V3)
#define NFSCTL_VERALL (0x0c /* 0b001100 */)
#else
#define NFSCTL_VERALL (0x04 /* 0b000100 */)
#endif
/* SVC */
struct nfsctl_svc {
unsigned short svc_port;
@@ -134,8 +119,6 @@ extern int exp_delclient(struct nfsctl_client *ncp);
extern int exp_export(struct nfsctl_export *nxp);
extern int exp_unexport(struct nfsctl_export *nxp);
extern unsigned int nfsd_versbits;
#endif /* __KERNEL__ */
#endif /* NFSD_SYSCALL_H */