Commit 89d77c8f authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust

NFS: Convert v4 into a module

This patch exports symbols needed by the v4 module.  In addition, I also
switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or
CONFIG_NFS_V4_MODULE are set.

The module (nfs4.ko) will be created in the same directory as nfs.ko and
will be automatically loaded the first time you try to mount over NFS v4.
Signed-off-by: default avatarBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 1c606fb7
...@@ -72,7 +72,7 @@ config NFS_V3_ACL ...@@ -72,7 +72,7 @@ config NFS_V3_ACL
If unsure, say N. If unsure, say N.
config NFS_V4 config NFS_V4
bool "NFS client support for NFS version 4" tristate "NFS client support for NFS version 4"
depends on NFS_FS depends on NFS_FS
select SUNRPC_GSS select SUNRPC_GSS
select KEYS select KEYS
......
...@@ -9,17 +9,7 @@ nfs-y := client.o dir.o file.o getroot.o inode.o super.o \ ...@@ -9,17 +9,7 @@ nfs-y := client.o dir.o file.o getroot.o inode.o super.o \
write.o namespace.o mount_clnt.o \ write.o namespace.o mount_clnt.o \
dns_resolve.o cache_lib.o dns_resolve.o cache_lib.o
nfs-$(CONFIG_ROOT_NFS) += nfsroot.o nfs-$(CONFIG_ROOT_NFS) += nfsroot.o
nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ nfs-$(CONFIG_SYSCTL) += sysctl.o
nfs4super.o nfs4file.o delegation.o idmap.o \
callback.o callback_xdr.o callback_proc.o \
nfs4namespace.o nfs4getroot.o nfs4client.o
nfs-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o
ifeq ($(CONFIG_SYSCTL), y)
nfs-y += sysctl.o
nfs-$(CONFIG_NFS_V4) += nfs4sysctl.o
endif
nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o
obj-$(CONFIG_NFS_V2) += nfs2.o obj-$(CONFIG_NFS_V2) += nfs2.o
...@@ -29,6 +19,13 @@ obj-$(CONFIG_NFS_V3) += nfs3.o ...@@ -29,6 +19,13 @@ obj-$(CONFIG_NFS_V3) += nfs3.o
nfs3-y := nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o nfs3-y := nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o
nfs3-$(CONFIG_NFS_V3_ACL) += nfs3acl.o nfs3-$(CONFIG_NFS_V3_ACL) += nfs3acl.o
obj-$(CONFIG_NFS_V4) += nfs4.o
nfs4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o \
delegation.o idmap.o callback.o callback_xdr.o callback_proc.o \
nfs4namespace.o nfs4getroot.o nfs4client.o
nfs4-$(CONFIG_SYSCTL) += nfs4sysctl.o
nfs4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o
obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o
nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o
......
...@@ -192,7 +192,7 @@ extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, ...@@ -192,7 +192,7 @@ extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args,
struct cb_process_state *cps); struct cb_process_state *cps);
extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy, extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy,
struct cb_process_state *cps); struct cb_process_state *cps);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt); extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt);
extern void nfs_callback_down(int minorversion); extern void nfs_callback_down(int minorversion);
extern int nfs4_validate_delegation_stateid(struct nfs_delegation *delegation, extern int nfs4_validate_delegation_stateid(struct nfs_delegation *delegation,
......
...@@ -142,24 +142,6 @@ void unregister_nfs_version(struct nfs_subversion *nfs) ...@@ -142,24 +142,6 @@ void unregister_nfs_version(struct nfs_subversion *nfs)
} }
EXPORT_SYMBOL_GPL(unregister_nfs_version); EXPORT_SYMBOL_GPL(unregister_nfs_version);
/*
* Preload all configured NFS versions during module init.
* This function should be edited after each protocol is converted,
* and eventually removed.
*/
int __init nfs_register_versions(void)
{
return init_nfs_v4();
}
/*
* Remove each pre-loaded NFS version
*/
void nfs_unregister_versions(void)
{
exit_nfs_v4();
}
/* /*
* Allocate a shared client record * Allocate a shared client record
* *
...@@ -214,7 +196,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init) ...@@ -214,7 +196,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
} }
EXPORT_SYMBOL_GPL(nfs_alloc_client); EXPORT_SYMBOL_GPL(nfs_alloc_client);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
/* idr_remove_all is not needed as all id's are removed by nfs_put_client */ /* idr_remove_all is not needed as all id's are removed by nfs_put_client */
void nfs_cleanup_cb_ident_idr(struct net *net) void nfs_cleanup_cb_ident_idr(struct net *net)
{ {
...@@ -390,6 +372,7 @@ int nfs_sockaddr_match_ipaddr(const struct sockaddr *sa1, ...@@ -390,6 +372,7 @@ int nfs_sockaddr_match_ipaddr(const struct sockaddr *sa1,
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_sockaddr_match_ipaddr);
#endif /* CONFIG_NFS_V4_1 */ #endif /* CONFIG_NFS_V4_1 */
/* /*
...@@ -456,6 +439,7 @@ int nfs_wait_client_init_complete(const struct nfs_client *clp) ...@@ -456,6 +439,7 @@ int nfs_wait_client_init_complete(const struct nfs_client *clp)
return wait_event_killable(nfs_client_active_wq, return wait_event_killable(nfs_client_active_wq,
nfs_client_init_is_complete(clp)); nfs_client_init_is_complete(clp));
} }
EXPORT_SYMBOL_GPL(nfs_wait_client_init_complete);
/* /*
* Found an existing client. Make sure it's ready before returning. * Found an existing client. Make sure it's ready before returning.
...@@ -530,6 +514,7 @@ nfs_get_client(const struct nfs_client_initdata *cl_init, ...@@ -530,6 +514,7 @@ nfs_get_client(const struct nfs_client_initdata *cl_init,
cl_init->hostname ?: "", PTR_ERR(new)); cl_init->hostname ?: "", PTR_ERR(new));
return new; return new;
} }
EXPORT_SYMBOL_GPL(nfs_get_client);
/* /*
* Mark a server as ready or failed * Mark a server as ready or failed
...@@ -540,6 +525,7 @@ void nfs_mark_client_ready(struct nfs_client *clp, int state) ...@@ -540,6 +525,7 @@ void nfs_mark_client_ready(struct nfs_client *clp, int state)
clp->cl_cons_state = state; clp->cl_cons_state = state;
wake_up_all(&nfs_client_active_wq); wake_up_all(&nfs_client_active_wq);
} }
EXPORT_SYMBOL_GPL(nfs_mark_client_ready);
/* /*
* Initialise the timeout values for a connection * Initialise the timeout values for a connection
...@@ -581,6 +567,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto, ...@@ -581,6 +567,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
BUG(); BUG();
} }
} }
EXPORT_SYMBOL_GPL(nfs_init_timeout_values);
/* /*
* Create an RPC client handle * Create an RPC client handle
...@@ -620,6 +607,7 @@ int nfs_create_rpc_client(struct nfs_client *clp, ...@@ -620,6 +607,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
clp->cl_rpcclient = clnt; clp->cl_rpcclient = clnt;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_create_rpc_client);
/* /*
* Version 2 or 3 client destruction * Version 2 or 3 client destruction
...@@ -706,6 +694,7 @@ int nfs_init_server_rpcclient(struct nfs_server *server, ...@@ -706,6 +694,7 @@ int nfs_init_server_rpcclient(struct nfs_server *server,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_init_server_rpcclient);
/** /**
* nfs_init_client - Initialise an NFS2 or NFS3 client * nfs_init_client - Initialise an NFS2 or NFS3 client
...@@ -932,6 +921,7 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs ...@@ -932,6 +921,7 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs
dprintk("nfs_probe_fsinfo: error = %d\n", -error); dprintk("nfs_probe_fsinfo: error = %d\n", -error);
return error; return error;
} }
EXPORT_SYMBOL_GPL(nfs_probe_fsinfo);
/* /*
* Copy useful information when duplicating a server record * Copy useful information when duplicating a server record
...@@ -948,6 +938,7 @@ void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *sour ...@@ -948,6 +938,7 @@ void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *sour
target->caps = source->caps; target->caps = source->caps;
target->options = source->options; target->options = source->options;
} }
EXPORT_SYMBOL_GPL(nfs_server_copy_userdata);
void nfs_server_insert_lists(struct nfs_server *server) void nfs_server_insert_lists(struct nfs_server *server)
{ {
...@@ -961,6 +952,7 @@ void nfs_server_insert_lists(struct nfs_server *server) ...@@ -961,6 +952,7 @@ void nfs_server_insert_lists(struct nfs_server *server)
spin_unlock(&nn->nfs_client_lock); spin_unlock(&nn->nfs_client_lock);
} }
EXPORT_SYMBOL_GPL(nfs_server_insert_lists);
static void nfs_server_remove_lists(struct nfs_server *server) static void nfs_server_remove_lists(struct nfs_server *server)
{ {
...@@ -1020,6 +1012,7 @@ struct nfs_server *nfs_alloc_server(void) ...@@ -1020,6 +1012,7 @@ struct nfs_server *nfs_alloc_server(void)
return server; return server;
} }
EXPORT_SYMBOL_GPL(nfs_alloc_server);
/* /*
* Free up a server record * Free up a server record
...@@ -1048,6 +1041,7 @@ void nfs_free_server(struct nfs_server *server) ...@@ -1048,6 +1041,7 @@ void nfs_free_server(struct nfs_server *server)
nfs_release_automount_timer(); nfs_release_automount_timer();
dprintk("<-- nfs_free_server()\n"); dprintk("<-- nfs_free_server()\n");
} }
EXPORT_SYMBOL_GPL(nfs_free_server);
/* /*
* Create a version 2 or 3 volume record * Create a version 2 or 3 volume record
...@@ -1193,7 +1187,7 @@ void nfs_clients_init(struct net *net) ...@@ -1193,7 +1187,7 @@ void nfs_clients_init(struct net *net)
INIT_LIST_HEAD(&nn->nfs_client_list); INIT_LIST_HEAD(&nn->nfs_client_list);
INIT_LIST_HEAD(&nn->nfs_volume_list); INIT_LIST_HEAD(&nn->nfs_volume_list);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
idr_init(&nn->cb_ident_idr); idr_init(&nn->cb_ident_idr);
#endif #endif
spin_lock_init(&nn->nfs_client_lock); spin_lock_init(&nn->nfs_client_lock);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifndef FS_NFS_DELEGATION_H #ifndef FS_NFS_DELEGATION_H
#define FS_NFS_DELEGATION_H #define FS_NFS_DELEGATION_H
#if defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V4)
/* /*
* NFSv4 delegation * NFSv4 delegation
*/ */
......
...@@ -936,6 +936,7 @@ void nfs_force_lookup_revalidate(struct inode *dir) ...@@ -936,6 +936,7 @@ void nfs_force_lookup_revalidate(struct inode *dir)
{ {
NFS_I(dir)->cache_change_attribute++; NFS_I(dir)->cache_change_attribute++;
} }
EXPORT_SYMBOL_GPL(nfs_force_lookup_revalidate);
/* /*
* A check for whether or not the parent directory has changed. * A check for whether or not the parent directory has changed.
...@@ -1267,7 +1268,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in ...@@ -1267,7 +1268,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
} }
EXPORT_SYMBOL_GPL(nfs_lookup); EXPORT_SYMBOL_GPL(nfs_lookup);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
static int nfs4_lookup_revalidate(struct dentry *, unsigned int); static int nfs4_lookup_revalidate(struct dentry *, unsigned int);
const struct dentry_operations nfs4_dentry_operations = { const struct dentry_operations nfs4_dentry_operations = {
...@@ -1277,6 +1278,7 @@ const struct dentry_operations nfs4_dentry_operations = { ...@@ -1277,6 +1278,7 @@ const struct dentry_operations nfs4_dentry_operations = {
.d_automount = nfs_d_automount, .d_automount = nfs_d_automount,
.d_release = nfs_d_release, .d_release = nfs_d_release,
}; };
EXPORT_SYMBOL_GPL(nfs4_dentry_operations);
static fmode_t flags_to_mode(int flags) static fmode_t flags_to_mode(int flags)
{ {
...@@ -1419,6 +1421,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, ...@@ -1419,6 +1421,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
return finish_no_open(file, res); return finish_no_open(file, res);
} }
EXPORT_SYMBOL_GPL(nfs_atomic_open);
static int nfs4_lookup_revalidate(struct dentry *dentry, unsigned int flags) static int nfs4_lookup_revalidate(struct dentry *dentry, unsigned int flags)
{ {
...@@ -2142,6 +2145,7 @@ int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags) ...@@ -2142,6 +2145,7 @@ int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags)
{ {
return nfs_do_access(inode, cred, nfs_open_permission_mask(openflags)); return nfs_do_access(inode, cred, nfs_open_permission_mask(openflags));
} }
EXPORT_SYMBOL_GPL(nfs_may_open);
int nfs_permission(struct inode *inode, int mask) int nfs_permission(struct inode *inode, int mask)
{ {
......
...@@ -460,7 +460,7 @@ static void nfs_inode_dio_write_done(struct inode *inode) ...@@ -460,7 +460,7 @@ static void nfs_inode_dio_write_done(struct inode *inode)
inode_dio_done(inode); inode_dio_done(inode);
} }
#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
{ {
struct nfs_pageio_descriptor desc; struct nfs_pageio_descriptor desc;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifdef CONFIG_NFS_USE_KERNEL_DNS #ifdef CONFIG_NFS_USE_KERNEL_DNS
#include <linux/module.h>
#include <linux/sunrpc/clnt.h> #include <linux/sunrpc/clnt.h>
#include <linux/dns_resolver.h> #include <linux/dns_resolver.h>
#include "dns_resolve.h" #include "dns_resolve.h"
...@@ -27,9 +28,11 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, ...@@ -27,9 +28,11 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
kfree(ip_addr); kfree(ip_addr);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(nfs_dns_resolve_name);
#else #else
#include <linux/module.h>
#include <linux/hash.h> #include <linux/hash.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kmod.h> #include <linux/kmod.h>
...@@ -345,6 +348,7 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, ...@@ -345,6 +348,7 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name,
ret = -ESRCH; ret = -ESRCH;
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(nfs_dns_resolve_name);
int nfs_dns_resolver_cache_init(struct net *net) int nfs_dns_resolver_cache_init(struct net *net)
{ {
......
...@@ -53,6 +53,7 @@ int nfs_check_flags(int flags) ...@@ -53,6 +53,7 @@ int nfs_check_flags(int flags)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_check_flags);
/* /*
* Open file * Open file
...@@ -85,6 +86,7 @@ nfs_file_release(struct inode *inode, struct file *filp) ...@@ -85,6 +86,7 @@ nfs_file_release(struct inode *inode, struct file *filp)
nfs_inc_stats(inode, NFSIOS_VFSRELEASE); nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
return nfs_release(inode, filp); return nfs_release(inode, filp);
} }
EXPORT_SYMBOL_GPL(nfs_file_release);
/** /**
* nfs_revalidate_size - Revalidate the file size * nfs_revalidate_size - Revalidate the file size
...@@ -138,6 +140,7 @@ loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) ...@@ -138,6 +140,7 @@ loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
return generic_file_llseek(filp, offset, origin); return generic_file_llseek(filp, offset, origin);
} }
EXPORT_SYMBOL_GPL(nfs_file_llseek);
/* /*
* Flush all dirty pages, and check for write errors. * Flush all dirty pages, and check for write errors.
...@@ -166,6 +169,7 @@ nfs_file_flush(struct file *file, fl_owner_t id) ...@@ -166,6 +169,7 @@ nfs_file_flush(struct file *file, fl_owner_t id)
/* Flush writes to the server and return any errors */ /* Flush writes to the server and return any errors */
return vfs_fsync(file, 0); return vfs_fsync(file, 0);
} }
EXPORT_SYMBOL_GPL(nfs_file_flush);
ssize_t ssize_t
nfs_file_read(struct kiocb *iocb, const struct iovec *iov, nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
...@@ -190,6 +194,7 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov, ...@@ -190,6 +194,7 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
} }
return result; return result;
} }
EXPORT_SYMBOL_GPL(nfs_file_read);
ssize_t ssize_t
nfs_file_splice_read(struct file *filp, loff_t *ppos, nfs_file_splice_read(struct file *filp, loff_t *ppos,
...@@ -212,6 +217,7 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos, ...@@ -212,6 +217,7 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos,
} }
return res; return res;
} }
EXPORT_SYMBOL_GPL(nfs_file_splice_read);
int int
nfs_file_mmap(struct file * file, struct vm_area_struct * vma) nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
...@@ -233,6 +239,7 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma) ...@@ -233,6 +239,7 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
} }
return status; return status;
} }
EXPORT_SYMBOL_GPL(nfs_file_mmap);
/* /*
* Flush any dirty pages for this process, and check for write errors. * Flush any dirty pages for this process, and check for write errors.
...@@ -271,6 +278,7 @@ nfs_file_fsync_commit(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -271,6 +278,7 @@ nfs_file_fsync_commit(struct file *file, loff_t start, loff_t end, int datasync)
ret = status; ret = status;
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(nfs_file_fsync_commit);
static int static int
nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
...@@ -615,6 +623,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -615,6 +623,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
printk(KERN_INFO "NFS: attempt to write to active swap file!\n"); printk(KERN_INFO "NFS: attempt to write to active swap file!\n");
goto out; goto out;
} }
EXPORT_SYMBOL_GPL(nfs_file_write);
ssize_t nfs_file_splice_write(struct pipe_inode_info *pipe, ssize_t nfs_file_splice_write(struct pipe_inode_info *pipe,
struct file *filp, loff_t *ppos, struct file *filp, loff_t *ppos,
...@@ -646,6 +655,7 @@ ssize_t nfs_file_splice_write(struct pipe_inode_info *pipe, ...@@ -646,6 +655,7 @@ ssize_t nfs_file_splice_write(struct pipe_inode_info *pipe,
nfs_add_stats(inode, NFSIOS_NORMALWRITTENBYTES, written); nfs_add_stats(inode, NFSIOS_NORMALWRITTENBYTES, written);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(nfs_file_splice_write);
static int static int
do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
...@@ -806,6 +816,7 @@ int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) ...@@ -806,6 +816,7 @@ int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
out_err: out_err:
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(nfs_lock);
/* /*
* Lock a (portion of) a file * Lock a (portion of) a file
...@@ -835,6 +846,7 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) ...@@ -835,6 +846,7 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)
return do_unlk(filp, cmd, fl, is_local); return do_unlk(filp, cmd, fl, is_local);
return do_setlk(filp, cmd, fl, is_local); return do_setlk(filp, cmd, fl, is_local);
} }
EXPORT_SYMBOL_GPL(nfs_flock);
/* /*
* There is no protocol support for leases, so we have no way to implement * There is no protocol support for leases, so we have no way to implement
...@@ -847,6 +859,7 @@ int nfs_setlease(struct file *file, long arg, struct file_lock **fl) ...@@ -847,6 +859,7 @@ int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
file->f_path.dentry->d_name.name, arg); file->f_path.dentry->d_name.name, arg);
return -EINVAL; return -EINVAL;
} }
EXPORT_SYMBOL_GPL(nfs_setlease);
const struct file_operations nfs_file_operations = { const struct file_operations nfs_file_operations = {
.llseek = nfs_file_llseek, .llseek = nfs_file_llseek,
......
...@@ -82,6 +82,7 @@ int nfs_wait_bit_killable(void *word) ...@@ -82,6 +82,7 @@ int nfs_wait_bit_killable(void *word)
freezable_schedule(); freezable_schedule();
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_wait_bit_killable);
/** /**
* nfs_compat_user_ino64 - returns the user-visible inode number * nfs_compat_user_ino64 - returns the user-visible inode number
...@@ -117,6 +118,7 @@ void nfs_clear_inode(struct inode *inode) ...@@ -117,6 +118,7 @@ void nfs_clear_inode(struct inode *inode)
nfs_access_zap_cache(inode); nfs_access_zap_cache(inode);
nfs_fscache_release_inode_cookie(inode); nfs_fscache_release_inode_cookie(inode);
} }
EXPORT_SYMBOL_GPL(nfs_clear_inode);
void nfs_evict_inode(struct inode *inode) void nfs_evict_inode(struct inode *inode)
{ {
...@@ -393,6 +395,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) ...@@ -393,6 +395,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
dprintk("nfs_fhget: iget failed with error %ld\n", PTR_ERR(inode)); dprintk("nfs_fhget: iget failed with error %ld\n", PTR_ERR(inode));
goto out; goto out;
} }
EXPORT_SYMBOL_GPL(nfs_fhget);
#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN) #define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN)
...@@ -655,6 +658,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f ...@@ -655,6 +658,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f
ctx->mdsthreshold = NULL; ctx->mdsthreshold = NULL;
return ctx; return ctx;
} }
EXPORT_SYMBOL_GPL(alloc_nfs_open_context);
struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx) struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx)
{ {
...@@ -662,6 +666,7 @@ struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx) ...@@ -662,6 +666,7 @@ struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx)
atomic_inc(&ctx->lock_context.count); atomic_inc(&ctx->lock_context.count);
return ctx; return ctx;
} }
EXPORT_SYMBOL_GPL(get_nfs_open_context);
static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync)
{ {
...@@ -689,6 +694,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx) ...@@ -689,6 +694,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx)
{ {
__put_nfs_open_context(ctx, 0); __put_nfs_open_context(ctx, 0);
} }
EXPORT_SYMBOL_GPL(put_nfs_open_context);
/* /*
* Ensure that mmap has a recent RPC credential for use when writing out * Ensure that mmap has a recent RPC credential for use when writing out
...@@ -704,6 +710,7 @@ void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) ...@@ -704,6 +710,7 @@ void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx)
list_add(&ctx->list, &nfsi->open_files); list_add(&ctx->list, &nfsi->open_files);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
} }
EXPORT_SYMBOL_GPL(nfs_file_set_open_context);
/* /*
* Given an inode, search for an open context with the desired characteristics * Given an inode, search for an open context with the desired characteristics
...@@ -1497,11 +1504,12 @@ struct inode *nfs_alloc_inode(struct super_block *sb) ...@@ -1497,11 +1504,12 @@ struct inode *nfs_alloc_inode(struct super_block *sb)
nfsi->acl_access = ERR_PTR(-EAGAIN); nfsi->acl_access = ERR_PTR(-EAGAIN);
nfsi->acl_default = ERR_PTR(-EAGAIN); nfsi->acl_default = ERR_PTR(-EAGAIN);
#endif #endif
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
nfsi->nfs4_acl = NULL; nfsi->nfs4_acl = NULL;
#endif /* CONFIG_NFS_V4 */ #endif /* CONFIG_NFS_V4 */
return &nfsi->vfs_inode; return &nfsi->vfs_inode;
} }
EXPORT_SYMBOL_GPL(nfs_alloc_inode);
static void nfs_i_callback(struct rcu_head *head) static void nfs_i_callback(struct rcu_head *head)
{ {
...@@ -1513,10 +1521,11 @@ void nfs_destroy_inode(struct inode *inode) ...@@ -1513,10 +1521,11 @@ void nfs_destroy_inode(struct inode *inode)
{ {
call_rcu(&inode->i_rcu, nfs_i_callback); call_rcu(&inode->i_rcu, nfs_i_callback);
} }
EXPORT_SYMBOL_GPL(nfs_destroy_inode);
static inline void nfs4_init_once(struct nfs_inode *nfsi) static inline void nfs4_init_once(struct nfs_inode *nfsi)
{ {
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
INIT_LIST_HEAD(&nfsi->open_states); INIT_LIST_HEAD(&nfsi->open_states);
nfsi->delegation = NULL; nfsi->delegation = NULL;
nfsi->delegation_state = 0; nfsi->delegation_state = 0;
...@@ -1562,6 +1571,7 @@ static void nfs_destroy_inodecache(void) ...@@ -1562,6 +1571,7 @@ static void nfs_destroy_inodecache(void)
} }
struct workqueue_struct *nfsiod_workqueue; struct workqueue_struct *nfsiod_workqueue;
EXPORT_SYMBOL_GPL(nfsiod_workqueue);
/* /*
* start up the nfsiod workqueue * start up the nfsiod workqueue
...@@ -1622,90 +1632,80 @@ static int __init init_nfs_fs(void) ...@@ -1622,90 +1632,80 @@ static int __init init_nfs_fs(void)
err = nfs_dns_resolver_init(); err = nfs_dns_resolver_init();
if (err < 0) if (err < 0)
goto out11; goto out10;;
err = register_pernet_subsys(&nfs_net_ops); err = register_pernet_subsys(&nfs_net_ops);
if (err < 0) if (err < 0)
goto out10; goto out9;
err = nfs_fscache_register(); err = nfs_fscache_register();
if (err < 0) if (err < 0)
goto out9; goto out8;
err = nfsiod_start(); err = nfsiod_start();
if (err) if (err)
goto out8; goto out7;
err = nfs_fs_proc_init(); err = nfs_fs_proc_init();
if (err) if (err)
goto out7; goto out6;
err = nfs_init_nfspagecache(); err = nfs_init_nfspagecache();
if (err) if (err)
goto out6; goto out5;
err = nfs_init_inodecache(); err = nfs_init_inodecache();
if (err) if (err)
goto out5; goto out4;
err = nfs_init_readpagecache(); err = nfs_init_readpagecache();
if (err) if (err)
goto out4; goto out3;
err = nfs_init_writepagecache(); err = nfs_init_writepagecache();
if (err) if (err)
goto out3; goto out2;
err = nfs_init_directcache(); err = nfs_init_directcache();
if (err) if (err)
goto out2; goto out1;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
rpc_proc_register(&init_net, &nfs_rpcstat); rpc_proc_register(&init_net, &nfs_rpcstat);
#endif #endif
err = nfs_register_versions();
if (err)
goto out1;
if ((err = register_nfs_fs()) != 0) if ((err = register_nfs_fs()) != 0)
goto out0; goto out0;
return 0; return 0;
out0: out0:
nfs_unregister_versions();
out1:
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
rpc_proc_unregister(&init_net, "nfs"); rpc_proc_unregister(&init_net, "nfs");
#endif #endif
nfs_destroy_directcache(); nfs_destroy_directcache();
out2: out1:
nfs_destroy_writepagecache(); nfs_destroy_writepagecache();
out3: out2:
nfs_destroy_readpagecache(); nfs_destroy_readpagecache();
out4: out3:
nfs_destroy_inodecache(); nfs_destroy_inodecache();
out5: out4:
nfs_destroy_nfspagecache(); nfs_destroy_nfspagecache();
out6: out5:
nfs_fs_proc_exit(); nfs_fs_proc_exit();
out7: out6:
nfsiod_stop(); nfsiod_stop();
out8: out7:
nfs_fscache_unregister(); nfs_fscache_unregister();
out9: out8:
unregister_pernet_subsys(&nfs_net_ops); unregister_pernet_subsys(&nfs_net_ops);
out10: out9:
nfs_dns_resolver_destroy(); nfs_dns_resolver_destroy();
out11: out10:
return err; return err;
} }
static void __exit exit_nfs_fs(void) static void __exit exit_nfs_fs(void)
{ {
#ifdef CONFIG_NFS_V4
exit_nfs_v4();
#endif
nfs_destroy_directcache(); nfs_destroy_directcache();
nfs_destroy_writepagecache(); nfs_destroy_writepagecache();
nfs_destroy_readpagecache(); nfs_destroy_readpagecache();
......
...@@ -262,7 +262,7 @@ extern int nfs3_decode_dirent(struct xdr_stream *, ...@@ -262,7 +262,7 @@ extern int nfs3_decode_dirent(struct xdr_stream *,
struct nfs_entry *, int); struct nfs_entry *, int);
/* nfs4xdr.c */ /* nfs4xdr.c */
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
extern int nfs4_decode_dirent(struct xdr_stream *, extern int nfs4_decode_dirent(struct xdr_stream *,
struct nfs_entry *, int); struct nfs_entry *, int);
#endif #endif
...@@ -272,7 +272,7 @@ extern const u32 nfs41_maxwrite_overhead; ...@@ -272,7 +272,7 @@ extern const u32 nfs41_maxwrite_overhead;
#endif #endif
/* nfs4proc.c */ /* nfs4proc.c */
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
extern struct rpc_procinfo nfs4_procedures[]; extern struct rpc_procinfo nfs4_procedures[];
#endif #endif
...@@ -328,7 +328,7 @@ extern int nfs_wait_bit_killable(void *word); ...@@ -328,7 +328,7 @@ extern int nfs_wait_bit_killable(void *word);
extern const struct super_operations nfs_sops; extern const struct super_operations nfs_sops;
extern struct file_system_type nfs_fs_type; extern struct file_system_type nfs_fs_type;
extern struct file_system_type nfs_xdev_fs_type; extern struct file_system_type nfs_xdev_fs_type;
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
extern struct file_system_type nfs4_xdev_fs_type; extern struct file_system_type nfs4_xdev_fs_type;
extern struct file_system_type nfs4_referral_fs_type; extern struct file_system_type nfs4_referral_fs_type;
#endif #endif
...@@ -364,7 +364,7 @@ struct vfsmount *nfs_do_submount(struct dentry *, struct nfs_fh *, ...@@ -364,7 +364,7 @@ struct vfsmount *nfs_do_submount(struct dentry *, struct nfs_fh *,
/* getroot.c */ /* getroot.c */
extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *, extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *,
const char *); const char *);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *, extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *,
const char *); const char *);
......
...@@ -113,6 +113,7 @@ char *nfs_path(char **p, struct dentry *dentry, char *buffer, ssize_t buflen) ...@@ -113,6 +113,7 @@ char *nfs_path(char **p, struct dentry *dentry, char *buffer, ssize_t buflen)
Elong: Elong:
return ERR_PTR(-ENAMETOOLONG); return ERR_PTR(-ENAMETOOLONG);
} }
EXPORT_SYMBOL_GPL(nfs_path);
/* /*
* nfs_d_automount - Handle crossing a mountpoint on the server * nfs_d_automount - Handle crossing a mountpoint on the server
...@@ -241,6 +242,7 @@ struct vfsmount *nfs_do_submount(struct dentry *dentry, struct nfs_fh *fh, ...@@ -241,6 +242,7 @@ struct vfsmount *nfs_do_submount(struct dentry *dentry, struct nfs_fh *fh,
dprintk("<-- nfs_do_submount() = %p\n", mnt); dprintk("<-- nfs_do_submount() = %p\n", mnt);
return mnt; return mnt;
} }
EXPORT_SYMBOL_GPL(nfs_do_submount);
struct vfsmount *nfs_submount(struct nfs_server *server, struct dentry *dentry, struct vfsmount *nfs_submount(struct nfs_server *server, struct dentry *dentry,
struct nfs_fh *fh, struct nfs_fattr *fattr) struct nfs_fh *fh, struct nfs_fattr *fattr)
......
...@@ -20,7 +20,7 @@ struct nfs_net { ...@@ -20,7 +20,7 @@ struct nfs_net {
wait_queue_head_t bl_wq; wait_queue_head_t bl_wq;
struct list_head nfs_client_list; struct list_head nfs_client_list;
struct list_head nfs_volume_list; struct list_head nfs_volume_list;
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
struct idr cb_ident_idr; /* Protected by nfs_client_lock */ struct idr cb_ident_idr; /* Protected by nfs_client_lock */
#endif #endif
spinlock_t nfs_client_lock; spinlock_t nfs_client_lock;
......
...@@ -21,23 +21,6 @@ struct nfs_subversion { ...@@ -21,23 +21,6 @@ struct nfs_subversion {
struct list_head list; /* List of NFS versions */ struct list_head list; /* List of NFS versions */
}; };
int nfs_register_versions(void);
void nfs_unregister_versions(void);
#ifdef CONFIG_NFS_V4
int init_nfs_v4(void);
void exit_nfs_v4(void);
#else /* CONFIG_NFS_V4 */
static inline int __init init_nfs_v4(void)
{
return 0;
}
static inline void exit_nfs_v4(void)
{
}
#endif /* CONFIG_NFS_V4 */
struct nfs_subversion *get_nfs_version(unsigned int); struct nfs_subversion *get_nfs_version(unsigned int);
void put_nfs_version(struct nfs_subversion *); void put_nfs_version(struct nfs_subversion *);
void register_nfs_version(struct nfs_subversion *); void register_nfs_version(struct nfs_subversion *);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef __LINUX_FS_NFS_NFS4_FS_H #ifndef __LINUX_FS_NFS_NFS4_FS_H
#define __LINUX_FS_NFS_NFS4_FS_H #define __LINUX_FS_NFS_NFS4_FS_H
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
struct idmap; struct idmap;
...@@ -365,11 +365,10 @@ extern const nfs4_stateid zero_stateid; ...@@ -365,11 +365,10 @@ extern const nfs4_stateid zero_stateid;
struct nfs_mount_info; struct nfs_mount_info;
extern struct nfs_subversion nfs_v4; extern struct nfs_subversion nfs_v4;
struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *); struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *);
int init_nfs_v4(void);
void exit_nfs_v4(void);
extern bool nfs4_disable_idmapping; extern bool nfs4_disable_idmapping;
extern unsigned short max_session_slots; extern unsigned short max_session_slots;
extern unsigned short send_implementation_id; extern unsigned short send_implementation_id;
/* nfs4sysctl.c */ /* nfs4sysctl.c */
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
int nfs4_register_sysctl(void); int nfs4_register_sysctl(void);
......
...@@ -332,7 +332,7 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type, ...@@ -332,7 +332,7 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
} }
int __init init_nfs_v4(void) static int __init init_nfs_v4(void)
{ {
int err; int err;
...@@ -358,10 +358,15 @@ int __init init_nfs_v4(void) ...@@ -358,10 +358,15 @@ int __init init_nfs_v4(void)
return err; return err;
} }
void exit_nfs_v4(void) static void __exit exit_nfs_v4(void)
{ {
unregister_nfs_version(&nfs_v4); unregister_nfs_version(&nfs_v4);
unregister_filesystem(&nfs4_fs_type); unregister_filesystem(&nfs4_fs_type);
nfs4_unregister_sysctl(); nfs4_unregister_sysctl();
nfs_idmap_quit(); nfs_idmap_quit();
} }
MODULE_LICENSE("GPL");
module_init(init_nfs_v4);
module_exit(exit_nfs_v4);
...@@ -54,6 +54,7 @@ void nfs_pgheader_init(struct nfs_pageio_descriptor *desc, ...@@ -54,6 +54,7 @@ void nfs_pgheader_init(struct nfs_pageio_descriptor *desc,
if (hdr->completion_ops->init_hdr) if (hdr->completion_ops->init_hdr)
hdr->completion_ops->init_hdr(hdr); hdr->completion_ops->init_hdr(hdr);
} }
EXPORT_SYMBOL_GPL(nfs_pgheader_init);
void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos) void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos)
{ {
...@@ -268,6 +269,7 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc, ...@@ -268,6 +269,7 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
desc->pg_lseg = NULL; desc->pg_lseg = NULL;
desc->pg_dreq = NULL; desc->pg_dreq = NULL;
} }
EXPORT_SYMBOL_GPL(nfs_pageio_init);
/** /**
* nfs_can_coalesce_requests - test two requests for compatibility * nfs_can_coalesce_requests - test two requests for compatibility
...@@ -409,6 +411,7 @@ int nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, ...@@ -409,6 +411,7 @@ int nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
} while (ret); } while (ret);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(nfs_pageio_add_request);
/** /**
* nfs_pageio_complete - Complete I/O on an nfs_pageio_descriptor * nfs_pageio_complete - Complete I/O on an nfs_pageio_descriptor
...@@ -424,6 +427,7 @@ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc) ...@@ -424,6 +427,7 @@ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc)
break; break;
} }
} }
EXPORT_SYMBOL_GPL(nfs_pageio_complete);
/** /**
* nfs_pageio_cond_complete - Conditional I/O completion * nfs_pageio_cond_complete - Conditional I/O completion
......
...@@ -1407,6 +1407,7 @@ static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) ...@@ -1407,6 +1407,7 @@ static void pnfs_writehdr_free(struct nfs_pgio_header *hdr)
put_lseg(hdr->lseg); put_lseg(hdr->lseg);
nfs_writehdr_free(hdr); nfs_writehdr_free(hdr);
} }
EXPORT_SYMBOL_GPL(pnfs_writehdr_free);
int int
pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
...@@ -1561,6 +1562,7 @@ static void pnfs_readhdr_free(struct nfs_pgio_header *hdr) ...@@ -1561,6 +1562,7 @@ static void pnfs_readhdr_free(struct nfs_pgio_header *hdr)
put_lseg(hdr->lseg); put_lseg(hdr->lseg);
nfs_readhdr_free(hdr); nfs_readhdr_free(hdr);
} }
EXPORT_SYMBOL_GPL(pnfs_readhdr_free);
int int
pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc) pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc)
......
...@@ -48,6 +48,7 @@ struct nfs_read_header *nfs_readhdr_alloc(void) ...@@ -48,6 +48,7 @@ struct nfs_read_header *nfs_readhdr_alloc(void)
} }
return rhdr; return rhdr;
} }
EXPORT_SYMBOL_GPL(nfs_readhdr_alloc);
static struct nfs_read_data *nfs_readdata_alloc(struct nfs_pgio_header *hdr, static struct nfs_read_data *nfs_readdata_alloc(struct nfs_pgio_header *hdr,
unsigned int pagecount) unsigned int pagecount)
...@@ -80,6 +81,7 @@ void nfs_readhdr_free(struct nfs_pgio_header *hdr) ...@@ -80,6 +81,7 @@ void nfs_readhdr_free(struct nfs_pgio_header *hdr)
kmem_cache_free(nfs_rdata_cachep, rhdr); kmem_cache_free(nfs_rdata_cachep, rhdr);
} }
EXPORT_SYMBOL_GPL(nfs_readhdr_free);
void nfs_readdata_release(struct nfs_read_data *rdata) void nfs_readdata_release(struct nfs_read_data *rdata)
{ {
...@@ -96,6 +98,7 @@ void nfs_readdata_release(struct nfs_read_data *rdata) ...@@ -96,6 +98,7 @@ void nfs_readdata_release(struct nfs_read_data *rdata)
if (atomic_dec_and_test(&hdr->refcnt)) if (atomic_dec_and_test(&hdr->refcnt))
hdr->completion_ops->completion(hdr); hdr->completion_ops->completion(hdr);
} }
EXPORT_SYMBOL_GPL(nfs_readdata_release);
static static
int nfs_return_empty_page(struct page *page) int nfs_return_empty_page(struct page *page)
...@@ -398,6 +401,7 @@ int nfs_generic_pagein(struct nfs_pageio_descriptor *desc, ...@@ -398,6 +401,7 @@ int nfs_generic_pagein(struct nfs_pageio_descriptor *desc,
return nfs_pagein_multi(desc, hdr); return nfs_pagein_multi(desc, hdr);
return nfs_pagein_one(desc, hdr); return nfs_pagein_one(desc, hdr);
} }
EXPORT_SYMBOL_GPL(nfs_generic_pagein);
static int nfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc) static int nfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc)
{ {
......
...@@ -315,7 +315,7 @@ const struct super_operations nfs_sops = { ...@@ -315,7 +315,7 @@ const struct super_operations nfs_sops = {
}; };
EXPORT_SYMBOL_GPL(nfs_sops); EXPORT_SYMBOL_GPL(nfs_sops);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *); static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *);
static int nfs4_validate_mount_data(void *options, static int nfs4_validate_mount_data(void *options,
struct nfs_parsed_mount_data *args, const char *dev_name); struct nfs_parsed_mount_data *args, const char *dev_name);
...@@ -366,6 +366,7 @@ void nfs_sb_active(struct super_block *sb) ...@@ -366,6 +366,7 @@ void nfs_sb_active(struct super_block *sb)
if (atomic_inc_return(&server->active) == 1) if (atomic_inc_return(&server->active) == 1)
atomic_inc(&sb->s_active); atomic_inc(&sb->s_active);
} }
EXPORT_SYMBOL_GPL(nfs_sb_active);
void nfs_sb_deactive(struct super_block *sb) void nfs_sb_deactive(struct super_block *sb)
{ {
...@@ -374,6 +375,7 @@ void nfs_sb_deactive(struct super_block *sb) ...@@ -374,6 +375,7 @@ void nfs_sb_deactive(struct super_block *sb)
if (atomic_dec_and_test(&server->active)) if (atomic_dec_and_test(&server->active))
deactivate_super(sb); deactivate_super(sb);
} }
EXPORT_SYMBOL_GPL(nfs_sb_deactive);
/* /*
* Deliver file system statistics to userspace * Deliver file system statistics to userspace
...@@ -439,6 +441,7 @@ int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) ...@@ -439,6 +441,7 @@ int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
dprintk("%s: statfs error = %d\n", __func__, -error); dprintk("%s: statfs error = %d\n", __func__, -error);
return error; return error;
} }
EXPORT_SYMBOL_GPL(nfs_statfs);
/* /*
* Map the security flavour number to a name * Map the security flavour number to a name
...@@ -544,7 +547,7 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss, ...@@ -544,7 +547,7 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss,
nfs_show_mountd_netid(m, nfss, showdefaults); nfs_show_mountd_netid(m, nfss, showdefaults);
} }
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss, static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss,
int showdefaults) int showdefaults)
{ {
...@@ -675,8 +678,9 @@ int nfs_show_options(struct seq_file *m, struct dentry *root) ...@@ -675,8 +678,9 @@ int nfs_show_options(struct seq_file *m, struct dentry *root)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_show_options);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
#ifdef CONFIG_NFS_V4_1 #ifdef CONFIG_NFS_V4_1
static void show_sessions(struct seq_file *m, struct nfs_server *server) static void show_sessions(struct seq_file *m, struct nfs_server *server)
{ {
...@@ -709,7 +713,7 @@ static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss) ...@@ -709,7 +713,7 @@ static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
} }
} }
#else #else
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
static void show_pnfs(struct seq_file *m, struct nfs_server *server) static void show_pnfs(struct seq_file *m, struct nfs_server *server)
{ {
} }
...@@ -734,12 +738,14 @@ int nfs_show_devname(struct seq_file *m, struct dentry *root) ...@@ -734,12 +738,14 @@ int nfs_show_devname(struct seq_file *m, struct dentry *root)
free_page((unsigned long)page); free_page((unsigned long)page);
return err; return err;
} }
EXPORT_SYMBOL_GPL(nfs_show_devname);
int nfs_show_path(struct seq_file *m, struct dentry *dentry) int nfs_show_path(struct seq_file *m, struct dentry *dentry)
{ {
seq_puts(m, "/"); seq_puts(m, "/");
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_show_path);
/* /*
* Present statistical information for this VFS mountpoint * Present statistical information for this VFS mountpoint
...@@ -774,7 +780,7 @@ int nfs_show_stats(struct seq_file *m, struct dentry *root) ...@@ -774,7 +780,7 @@ int nfs_show_stats(struct seq_file *m, struct dentry *root)
seq_printf(m, ",bsize=%u", nfss->bsize); seq_printf(m, ",bsize=%u", nfss->bsize);
seq_printf(m, ",namlen=%u", nfss->namelen); seq_printf(m, ",namlen=%u", nfss->namelen);
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
if (nfss->nfs_client->rpc_ops->version == 4) { if (nfss->nfs_client->rpc_ops->version == 4) {
seq_printf(m, "\n\tnfsv4:\t"); seq_printf(m, "\n\tnfsv4:\t");
seq_printf(m, "bm0=0x%x", nfss->attr_bitmask[0]); seq_printf(m, "bm0=0x%x", nfss->attr_bitmask[0]);
...@@ -832,6 +838,7 @@ int nfs_show_stats(struct seq_file *m, struct dentry *root) ...@@ -832,6 +838,7 @@ int nfs_show_stats(struct seq_file *m, struct dentry *root)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_show_stats);
/* /*
* Begin unmount by attempting to remove all automounted mountpoints we added * Begin unmount by attempting to remove all automounted mountpoints we added
...@@ -851,6 +858,7 @@ void nfs_umount_begin(struct super_block *sb) ...@@ -851,6 +858,7 @@ void nfs_umount_begin(struct super_block *sb)
if (!IS_ERR(rpc)) if (!IS_ERR(rpc))
rpc_killall_tasks(rpc); rpc_killall_tasks(rpc);
} }
EXPORT_SYMBOL_GPL(nfs_umount_begin);
static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void) static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void)
{ {
...@@ -1915,7 +1923,7 @@ static int nfs23_validate_mount_data(void *options, ...@@ -1915,7 +1923,7 @@ static int nfs23_validate_mount_data(void *options,
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
static int nfs_validate_mount_data(struct file_system_type *fs_type, static int nfs_validate_mount_data(struct file_system_type *fs_type,
void *options, void *options,
struct nfs_parsed_mount_data *args, struct nfs_parsed_mount_data *args,
...@@ -1953,7 +1961,7 @@ static int nfs_validate_text_mount_data(void *options, ...@@ -1953,7 +1961,7 @@ static int nfs_validate_text_mount_data(void *options,
goto out_no_address; goto out_no_address;
if (args->version == 4) { if (args->version == 4) {
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
port = NFS_PORT; port = NFS_PORT;
max_namelen = NFS4_MAXNAMLEN; max_namelen = NFS4_MAXNAMLEN;
max_pathlen = NFS4_MAXPATHLEN; max_pathlen = NFS4_MAXPATHLEN;
...@@ -1976,7 +1984,7 @@ static int nfs_validate_text_mount_data(void *options, ...@@ -1976,7 +1984,7 @@ static int nfs_validate_text_mount_data(void *options,
&args->nfs_server.export_path, &args->nfs_server.export_path,
max_pathlen); max_pathlen);
#ifndef CONFIG_NFS_V4 #if !IS_ENABLED(CONFIG_NFS_V4)
out_v4_not_compiled: out_v4_not_compiled:
dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n"); dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n");
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
...@@ -2075,6 +2083,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data) ...@@ -2075,6 +2083,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
kfree(data); kfree(data);
return error; return error;
} }
EXPORT_SYMBOL_GPL(nfs_remount);
/* /*
* Initialise the common bits of the superblock * Initialise the common bits of the superblock
...@@ -2123,6 +2132,7 @@ void nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info) ...@@ -2123,6 +2132,7 @@ void nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info)
nfs_initialise_sb(sb); nfs_initialise_sb(sb);
} }
EXPORT_SYMBOL_GPL(nfs_fill_super);
/* /*
* Finish setting up a cloned NFS2/3/4 superblock * Finish setting up a cloned NFS2/3/4 superblock
...@@ -2292,6 +2302,7 @@ int nfs_set_sb_security(struct super_block *s, struct dentry *mntroot, ...@@ -2292,6 +2302,7 @@ int nfs_set_sb_security(struct super_block *s, struct dentry *mntroot,
{ {
return security_sb_set_mnt_opts(s, &mount_info->parsed->lsm_opts); return security_sb_set_mnt_opts(s, &mount_info->parsed->lsm_opts);
} }
EXPORT_SYMBOL_GPL(nfs_set_sb_security);
int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot, int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot,
struct nfs_mount_info *mount_info) struct nfs_mount_info *mount_info)
...@@ -2302,6 +2313,7 @@ int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot, ...@@ -2302,6 +2313,7 @@ int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot,
return -ESTALE; return -ESTALE;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs_clone_sb_security);
struct dentry *nfs_fs_mount_common(struct nfs_server *server, struct dentry *nfs_fs_mount_common(struct nfs_server *server,
int flags, const char *dev_name, int flags, const char *dev_name,
...@@ -2375,6 +2387,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server, ...@@ -2375,6 +2387,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server,
deactivate_locked_super(s); deactivate_locked_super(s);
goto out; goto out;
} }
EXPORT_SYMBOL_GPL(nfs_fs_mount_common);
struct dentry *nfs_fs_mount(struct file_system_type *fs_type, struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data) int flags, const char *dev_name, void *raw_data)
...@@ -2415,6 +2428,7 @@ struct dentry *nfs_fs_mount(struct file_system_type *fs_type, ...@@ -2415,6 +2428,7 @@ struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
nfs_free_fhandle(mount_info.mntfh); nfs_free_fhandle(mount_info.mntfh);
return mntroot; return mntroot;
} }
EXPORT_SYMBOL_GPL(nfs_fs_mount);
/* /*
* Ensure that we unregister the bdi before kill_anon_super * Ensure that we unregister the bdi before kill_anon_super
...@@ -2426,6 +2440,7 @@ void nfs_put_super(struct super_block *s) ...@@ -2426,6 +2440,7 @@ void nfs_put_super(struct super_block *s)
bdi_unregister(&server->backing_dev_info); bdi_unregister(&server->backing_dev_info);
} }
EXPORT_SYMBOL_GPL(nfs_put_super);
/* /*
* Destroy an NFS2/3 superblock * Destroy an NFS2/3 superblock
...@@ -2438,6 +2453,7 @@ void nfs_kill_super(struct super_block *s) ...@@ -2438,6 +2453,7 @@ void nfs_kill_super(struct super_block *s)
nfs_fscache_release_super_cookie(s); nfs_fscache_release_super_cookie(s);
nfs_free_server(server); nfs_free_server(server);
} }
EXPORT_SYMBOL_GPL(nfs_kill_super);
/* /*
* Clone an NFS2/3/4 server record on xdev traversal (FSID-change) * Clone an NFS2/3/4 server record on xdev traversal (FSID-change)
...@@ -2478,7 +2494,7 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags, ...@@ -2478,7 +2494,7 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags,
goto out; goto out;
} }
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args) static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
{ {
...@@ -2590,6 +2606,13 @@ bool nfs4_disable_idmapping = true; ...@@ -2590,6 +2606,13 @@ bool nfs4_disable_idmapping = true;
unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
unsigned short send_implementation_id = 1; unsigned short send_implementation_id = 1;
EXPORT_SYMBOL_GPL(nfs_callback_set_tcpport);
EXPORT_SYMBOL_GPL(nfs_callback_tcpport);
EXPORT_SYMBOL_GPL(nfs_idmap_cache_timeout);
EXPORT_SYMBOL_GPL(nfs4_disable_idmapping);
EXPORT_SYMBOL_GPL(max_session_slots);
EXPORT_SYMBOL_GPL(send_implementation_id);
#define NFS_CALLBACK_MAXPORTNR (65535U) #define NFS_CALLBACK_MAXPORTNR (65535U)
static int param_set_portnr(const char *val, const struct kernel_param *kp) static int param_set_portnr(const char *val, const struct kernel_param *kp)
......
...@@ -84,6 +84,7 @@ struct nfs_write_header *nfs_writehdr_alloc(void) ...@@ -84,6 +84,7 @@ struct nfs_write_header *nfs_writehdr_alloc(void)
} }
return p; return p;
} }
EXPORT_SYMBOL_GPL(nfs_writehdr_alloc);
static struct nfs_write_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr, static struct nfs_write_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr,
unsigned int pagecount) unsigned int pagecount)
...@@ -115,6 +116,7 @@ void nfs_writehdr_free(struct nfs_pgio_header *hdr) ...@@ -115,6 +116,7 @@ void nfs_writehdr_free(struct nfs_pgio_header *hdr)
struct nfs_write_header *whdr = container_of(hdr, struct nfs_write_header, header); struct nfs_write_header *whdr = container_of(hdr, struct nfs_write_header, header);
mempool_free(whdr, nfs_wdata_mempool); mempool_free(whdr, nfs_wdata_mempool);
} }
EXPORT_SYMBOL_GPL(nfs_writehdr_free);
void nfs_writedata_release(struct nfs_write_data *wdata) void nfs_writedata_release(struct nfs_write_data *wdata)
{ {
...@@ -131,6 +133,7 @@ void nfs_writedata_release(struct nfs_write_data *wdata) ...@@ -131,6 +133,7 @@ void nfs_writedata_release(struct nfs_write_data *wdata)
if (atomic_dec_and_test(&hdr->refcnt)) if (atomic_dec_and_test(&hdr->refcnt))
hdr->completion_ops->completion(hdr); hdr->completion_ops->completion(hdr);
} }
EXPORT_SYMBOL_GPL(nfs_writedata_release);
static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error) static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error)
{ {
...@@ -446,7 +449,7 @@ nfs_mark_request_dirty(struct nfs_page *req) ...@@ -446,7 +449,7 @@ nfs_mark_request_dirty(struct nfs_page *req)
__set_page_dirty_nobuffers(req->wb_page); __set_page_dirty_nobuffers(req->wb_page);
} }
#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
/** /**
* nfs_request_add_commit_list - add request to a commit list * nfs_request_add_commit_list - add request to a commit list
* @req: pointer to a struct nfs_page * @req: pointer to a struct nfs_page
...@@ -636,7 +639,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) ...@@ -636,7 +639,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
hdr->release(hdr); hdr->release(hdr);
} }
#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
static unsigned long static unsigned long
nfs_reqs_to_commit(struct nfs_commit_info *cinfo) nfs_reqs_to_commit(struct nfs_commit_info *cinfo)
{ {
...@@ -1173,6 +1176,7 @@ int nfs_generic_flush(struct nfs_pageio_descriptor *desc, ...@@ -1173,6 +1176,7 @@ int nfs_generic_flush(struct nfs_pageio_descriptor *desc,
return nfs_flush_multi(desc, hdr); return nfs_flush_multi(desc, hdr);
return nfs_flush_one(desc, hdr); return nfs_flush_one(desc, hdr);
} }
EXPORT_SYMBOL_GPL(nfs_generic_flush);
static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) static int nfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
{ {
...@@ -1298,7 +1302,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) ...@@ -1298,7 +1302,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
return; return;
nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count); nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count);
#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
if (resp->verf->committed < argp->stable && task->tk_status >= 0) { if (resp->verf->committed < argp->stable && task->tk_status >= 0) {
/* We tried a write call, but the server did not /* We tried a write call, but the server did not
* commit data to stable storage even though we * commit data to stable storage even though we
...@@ -1358,7 +1362,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) ...@@ -1358,7 +1362,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
} }
#if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait)
{ {
int ret; int ret;
...@@ -1674,6 +1678,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -1674,6 +1678,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
{ {
return nfs_commit_unstable_pages(inode, wbc); return nfs_commit_unstable_pages(inode, wbc);
} }
EXPORT_SYMBOL_GPL(nfs_write_inode);
/* /*
* flush the inode to disk. * flush the inode to disk.
......
...@@ -191,7 +191,7 @@ struct nfs_inode { ...@@ -191,7 +191,7 @@ struct nfs_inode {
struct hlist_head silly_list; struct hlist_head silly_list;
wait_queue_head_t waitqueue; wait_queue_head_t waitqueue;
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
struct nfs4_cached_acl *nfs4_acl; struct nfs4_cached_acl *nfs4_acl;
/* NFSv4 state */ /* NFSv4 state */
struct list_head open_states; struct list_head open_states;
...@@ -428,7 +428,7 @@ extern __be32 root_nfs_parse_addr(char *name); /*__init*/ ...@@ -428,7 +428,7 @@ extern __be32 root_nfs_parse_addr(char *name); /*__init*/
* linux/fs/nfs/file.c * linux/fs/nfs/file.c
*/ */
extern const struct file_operations nfs_file_operations; extern const struct file_operations nfs_file_operations;
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
extern const struct file_operations nfs4_file_operations; extern const struct file_operations nfs4_file_operations;
#endif /* CONFIG_NFS_V4 */ #endif /* CONFIG_NFS_V4 */
extern const struct address_space_operations nfs_file_aops; extern const struct address_space_operations nfs_file_aops;
...@@ -538,7 +538,7 @@ extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); ...@@ -538,7 +538,7 @@ extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
extern int nfs_wb_all(struct inode *inode); extern int nfs_wb_all(struct inode *inode);
extern int nfs_wb_page(struct inode *inode, struct page* page); extern int nfs_wb_page(struct inode *inode, struct page* page);
extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
extern int nfs_commit_inode(struct inode *, int); extern int nfs_commit_inode(struct inode *, int);
extern struct nfs_commit_data *nfs_commitdata_alloc(void); extern struct nfs_commit_data *nfs_commitdata_alloc(void);
extern void nfs_commit_free(struct nfs_commit_data *data); extern void nfs_commit_free(struct nfs_commit_data *data);
......
...@@ -53,7 +53,7 @@ struct nfs_client { ...@@ -53,7 +53,7 @@ struct nfs_client {
u32 cl_minorversion;/* NFSv4 minorversion */ u32 cl_minorversion;/* NFSv4 minorversion */
struct rpc_cred *cl_machine_cred; struct rpc_cred *cl_machine_cred;
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
u64 cl_clientid; /* constant */ u64 cl_clientid; /* constant */
nfs4_verifier cl_confirm; /* Clientid verifier */ nfs4_verifier cl_confirm; /* Clientid verifier */
unsigned long cl_state; unsigned long cl_state;
...@@ -138,7 +138,7 @@ struct nfs_server { ...@@ -138,7 +138,7 @@ struct nfs_server {
#endif #endif
u32 pnfs_blksize; /* layout_blksize attr */ u32 pnfs_blksize; /* layout_blksize attr */
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
u32 attr_bitmask[3];/* V4 bitmask representing the set u32 attr_bitmask[3];/* V4 bitmask representing the set
of attributes supported on this of attributes supported on this
filesystem */ filesystem */
...@@ -201,7 +201,7 @@ struct nfs_server { ...@@ -201,7 +201,7 @@ struct nfs_server {
#define NFS4_MAX_SLOT_TABLE (256U) #define NFS4_MAX_SLOT_TABLE (256U)
#define NFS4_NO_SLOT ((u32)-1) #define NFS4_NO_SLOT ((u32)-1)
#if defined(CONFIG_NFS_V4) #if IS_ENABLED(CONFIG_NFS_V4)
/* Sessions */ /* Sessions */
#define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long)) #define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long))
......
...@@ -69,7 +69,7 @@ struct nfs_server; ...@@ -69,7 +69,7 @@ struct nfs_server;
struct nfs_fattr; struct nfs_fattr;
struct nfs4_string; struct nfs4_string;
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
int nfs_idmap_init(void); int nfs_idmap_init(void);
void nfs_idmap_quit(void); void nfs_idmap_quit(void);
#else #else
......
...@@ -824,7 +824,7 @@ struct nfs3_getaclres { ...@@ -824,7 +824,7 @@ struct nfs3_getaclres {
struct posix_acl * acl_default; struct posix_acl * acl_default;
}; };
#ifdef CONFIG_NFS_V4 #if IS_ENABLED(CONFIG_NFS_V4)
typedef u64 clientid4; typedef u64 clientid4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment