mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
NFSD: Evacuate NFSv4 entry-point prototypes from nfsd.h
nfsd.h is included by nearly every NFSD translation unit, yet the two blocks of NFSv4 lifecycle and control prototypes it carries are referenced by only seven of them (out of over two dozen). The remaining consumers, including the NFSv2 and NFSv3 ACL and XDR paths, parse these declarations for no benefit. The declarations cannot simply move into an NFSv4-only header such as state.h: nfssvc.c, nfsctl.c, vfs.c, and export.c call the routines unconditionally and rely on the CONFIG_NFSD_V4=n stubs, and pulling the heavy state.h types into those lean translation units to obtain a handful of prototypes would trade one form of coupling for a worse one. Reviewed-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260717184112.507548-6-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
parent
c83cb7686e
commit
39647792b7
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "nfsd.h"
|
||||
#include "nfserr.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "nfsfh.h"
|
||||
#include "netns.h"
|
||||
#include "pnfs.h"
|
||||
|
|
|
|||
83
fs/nfsd/nfs4ctl.h
Normal file
83
fs/nfsd/nfs4ctl.h
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Entry points by which the knfsd core drives the optional NFSv4
|
||||
* subsystem: state lifecycle, the laundromat workqueue, the recovery
|
||||
* directory, junctions, the CLD notifier, and leases-net setup.
|
||||
*
|
||||
* Separated from nfsd.h so that the many translation units that
|
||||
* include nfsd.h but call none of these -- among them the NFSv2 and
|
||||
* NFSv3 paths -- do not have to parse them. The CONFIG_NFSD_V4=n
|
||||
* stubs let the version-agnostic callers invoke the routines
|
||||
* unconditionally.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_NFSD_NFS4CTL_H
|
||||
#define LINUX_NFSD_NFS4CTL_H
|
||||
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct net;
|
||||
struct inode;
|
||||
struct dentry;
|
||||
struct svc_rqst;
|
||||
struct nfsd_net;
|
||||
|
||||
#ifdef CONFIG_NFSD_V4
|
||||
extern unsigned long max_delegations;
|
||||
int nfsd4_init_slabs(void);
|
||||
void nfsd4_free_slabs(void);
|
||||
int nfs4_state_start(void);
|
||||
int nfs4_state_start_net(struct net *net);
|
||||
void nfs4_state_shutdown(void);
|
||||
void nfs4_state_shutdown_net(struct net *net);
|
||||
int nfs4_reset_recoverydir(char *recdir);
|
||||
char * nfs4_recoverydir(void);
|
||||
bool nfsd4_spo_must_allow(struct svc_rqst *rqstp);
|
||||
int nfsd4_create_laundry_wq(void);
|
||||
void nfsd4_destroy_laundry_wq(void);
|
||||
bool nfsd_wait_for_delegreturn(struct svc_rqst *rqstp, struct inode *inode);
|
||||
|
||||
extern int nfsd4_is_junction(struct dentry *dentry);
|
||||
extern int register_cld_notifier(void);
|
||||
extern void unregister_cld_notifier(void);
|
||||
#ifdef CONFIG_NFSD_V4_2_INTER_SSC
|
||||
extern void nfsd4_ssc_init_umount_work(struct nfsd_net *nn);
|
||||
#endif
|
||||
|
||||
extern void nfsd4_init_leases_net(struct nfsd_net *nn);
|
||||
|
||||
#else /* CONFIG_NFSD_V4 */
|
||||
static inline int nfsd4_init_slabs(void) { return 0; }
|
||||
static inline void nfsd4_free_slabs(void) { }
|
||||
static inline int nfs4_state_start(void) { return 0; }
|
||||
static inline int nfs4_state_start_net(struct net *net) { return 0; }
|
||||
static inline void nfs4_state_shutdown(void) { }
|
||||
static inline void nfs4_state_shutdown_net(struct net *net) { }
|
||||
static inline int nfs4_reset_recoverydir(char *recdir) { return 0; }
|
||||
static inline char * nfs4_recoverydir(void) {return NULL; }
|
||||
static inline bool nfsd4_spo_must_allow(struct svc_rqst *rqstp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline int nfsd4_create_laundry_wq(void) { return 0; };
|
||||
static inline void nfsd4_destroy_laundry_wq(void) {};
|
||||
static inline bool nfsd_wait_for_delegreturn(struct svc_rqst *rqstp,
|
||||
struct inode *inode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int nfsd4_is_junction(struct dentry *dentry)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void nfsd4_init_leases_net(struct nfsd_net *nn) { };
|
||||
|
||||
#define register_cld_notifier() 0
|
||||
#define unregister_cld_notifier() do { } while(0)
|
||||
|
||||
#endif /* CONFIG_NFSD_V4 */
|
||||
|
||||
#endif /* LINUX_NFSD_NFS4CTL_H */
|
||||
|
|
@ -46,6 +46,7 @@
|
|||
#include "idmap.h"
|
||||
#include "cache.h"
|
||||
#include "xdr4.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "vfs.h"
|
||||
#include "current_stateid.h"
|
||||
#include "netns.h"
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include <linux/nfsd/cld.h>
|
||||
|
||||
#include "nfsd.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "state.h"
|
||||
#include "vfs.h"
|
||||
#include "netns.h"
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include <linux/nfs_ssc.h>
|
||||
|
||||
#include "xdr4.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "xdr4cb.h"
|
||||
#include "vfs.h"
|
||||
#include "current_stateid.h"
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "idmap.h"
|
||||
#include "nfsd.h"
|
||||
#include "nfserr.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "netns.h"
|
||||
#include "stats.h"
|
||||
#include "cache.h"
|
||||
|
|
|
|||
|
|
@ -151,45 +151,6 @@ static inline int nfsd_v4client(struct svc_rqst *rq)
|
|||
return rq && rq->rq_prog == NFS_PROGRAM && rq->rq_vers == 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* NFSv4 State
|
||||
*/
|
||||
#ifdef CONFIG_NFSD_V4
|
||||
extern unsigned long max_delegations;
|
||||
int nfsd4_init_slabs(void);
|
||||
void nfsd4_free_slabs(void);
|
||||
int nfs4_state_start(void);
|
||||
int nfs4_state_start_net(struct net *net);
|
||||
void nfs4_state_shutdown(void);
|
||||
void nfs4_state_shutdown_net(struct net *net);
|
||||
int nfs4_reset_recoverydir(char *recdir);
|
||||
char * nfs4_recoverydir(void);
|
||||
bool nfsd4_spo_must_allow(struct svc_rqst *rqstp);
|
||||
int nfsd4_create_laundry_wq(void);
|
||||
void nfsd4_destroy_laundry_wq(void);
|
||||
bool nfsd_wait_for_delegreturn(struct svc_rqst *rqstp, struct inode *inode);
|
||||
#else
|
||||
static inline int nfsd4_init_slabs(void) { return 0; }
|
||||
static inline void nfsd4_free_slabs(void) { }
|
||||
static inline int nfs4_state_start(void) { return 0; }
|
||||
static inline int nfs4_state_start_net(struct net *net) { return 0; }
|
||||
static inline void nfs4_state_shutdown(void) { }
|
||||
static inline void nfs4_state_shutdown_net(struct net *net) { }
|
||||
static inline int nfs4_reset_recoverydir(char *recdir) { return 0; }
|
||||
static inline char * nfs4_recoverydir(void) {return NULL; }
|
||||
static inline bool nfsd4_spo_must_allow(struct svc_rqst *rqstp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline int nfsd4_create_laundry_wq(void) { return 0; };
|
||||
static inline void nfsd4_destroy_laundry_wq(void) {};
|
||||
static inline bool nfsd_wait_for_delegreturn(struct svc_rqst *rqstp,
|
||||
struct inode *inode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* lockd binding
|
||||
*/
|
||||
|
|
@ -197,28 +158,4 @@ void nfsd_lockd_init(void);
|
|||
void nfsd_lockd_shutdown(void);
|
||||
|
||||
|
||||
#ifdef CONFIG_NFSD_V4
|
||||
|
||||
extern int nfsd4_is_junction(struct dentry *dentry);
|
||||
extern int register_cld_notifier(void);
|
||||
extern void unregister_cld_notifier(void);
|
||||
#ifdef CONFIG_NFSD_V4_2_INTER_SSC
|
||||
extern void nfsd4_ssc_init_umount_work(struct nfsd_net *nn);
|
||||
#endif
|
||||
|
||||
extern void nfsd4_init_leases_net(struct nfsd_net *nn);
|
||||
|
||||
#else /* CONFIG_NFSD_V4 */
|
||||
static inline int nfsd4_is_junction(struct dentry *dentry)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void nfsd4_init_leases_net(struct nfsd_net *nn) { };
|
||||
|
||||
#define register_cld_notifier() 0
|
||||
#define unregister_cld_notifier() do { } while(0)
|
||||
|
||||
#endif /* CONFIG_NFSD_V4 */
|
||||
|
||||
#endif /* LINUX_NFSD_NFSD_H */
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "nfsd.h"
|
||||
#include "nfserr.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "cache.h"
|
||||
#include "vfs.h"
|
||||
#include "netns.h"
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include "nfsd.h"
|
||||
#include "nfserr.h"
|
||||
#include "nfs4ctl.h"
|
||||
#include "netns.h"
|
||||
#include "stats.h"
|
||||
#include "vfs.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user