Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddda8e0a authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust
Browse files

NFS: Convert v2 into a module



The module (nfs2.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 v2.

Signed-off-by: default avatarBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent fac1e8e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ config NFS_FS
	  If unsure, say N.

config NFS_V2
	bool "NFS client support for NFS version 2"
	tristate "NFS client support for NFS version 2"
	depends on NFS_FS
	default y
	help
+3 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ nfs-y := client.o dir.o file.o getroot.o inode.o super.o \
			   write.o namespace.o mount_clnt.o \
			   dns_resolve.o cache_lib.o
nfs-$(CONFIG_ROOT_NFS)	+= nfsroot.o
nfs-$(CONFIG_NFS_V2)	+= nfs2super.o proc.o nfs2xdr.o
nfs-$(CONFIG_NFS_V3)	+= nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o
nfs-$(CONFIG_NFS_V3_ACL)	+= nfs3acl.o
nfs-$(CONFIG_NFS_V4)	+= nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \
@@ -25,6 +24,9 @@ endif

nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o

obj-$(CONFIG_NFS_V2) += nfs2.o
nfs2-y := nfs2super.o proc.o nfs2xdr.o

obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o
nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o

+6 −6
Original line number Diff line number Diff line
@@ -149,11 +149,7 @@ EXPORT_SYMBOL_GPL(unregister_nfs_version);
 */
int __init nfs_register_versions(void)
{
	int err = init_nfs_v2();
	if (err)
		return err;

	err = init_nfs_v3();
	int err = init_nfs_v3();
	if (err)
		return err;

@@ -165,7 +161,6 @@ int __init nfs_register_versions(void)
 */
void nfs_unregister_versions(void)
{
	exit_nfs_v2();
	exit_nfs_v3();
	exit_nfs_v4();
}
@@ -222,6 +217,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
error_0:
	return ERR_PTR(err);
}
EXPORT_SYMBOL_GPL(nfs_alloc_client);

#ifdef CONFIG_NFS_V4
/* idr_remove_all is not needed as all id's are removed by nfs_put_client */
@@ -284,6 +280,7 @@ void nfs_free_client(struct nfs_client *clp)

	dprintk("<-- nfs_free_client()\n");
}
EXPORT_SYMBOL_GPL(nfs_free_client);

/*
 * Release a reference to a shared client record
@@ -753,6 +750,7 @@ struct nfs_client *nfs_init_client(struct nfs_client *clp,
	dprintk("<-- nfs_init_client() = xerror %d\n", error);
	return ERR_PTR(error);
}
EXPORT_SYMBOL_GPL(nfs_init_client);

/*
 * Create a version 2 or 3 client
@@ -1122,6 +1120,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info,
	nfs_free_server(server);
	return ERR_PTR(error);
}
EXPORT_SYMBOL_GPL(nfs_create_server);

/*
 * Clone an NFS2, NFS3 or NFS4 server record
@@ -1191,6 +1190,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
	dprintk("<-- nfs_clone_server() = error %d\n", error);
	return ERR_PTR(error);
}
EXPORT_SYMBOL_GPL(nfs_clone_server);

void nfs_clients_init(struct net *net)
{
+13 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
 *  6 Jun 1999	Cache readdir lookups in the page cache. -DaveM
 */

#include <linux/module.h>
#include <linux/time.h>
#include <linux/errno.h>
#include <linux/stat.h>
@@ -1196,6 +1197,7 @@ const struct dentry_operations nfs_dentry_operations = {
	.d_automount	= nfs_d_automount,
	.d_release	= nfs_d_release,
};
EXPORT_SYMBOL_GPL(nfs_dentry_operations);

struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags)
{
@@ -1263,6 +1265,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
	nfs_free_fhandle(fhandle);
	return res;
}
EXPORT_SYMBOL_GPL(nfs_lookup);

#ifdef CONFIG_NFS_V4
static int nfs4_lookup_revalidate(struct dentry *, unsigned int);
@@ -1508,6 +1511,7 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
	dput(parent);
	return error;
}
EXPORT_SYMBOL_GPL(nfs_instantiate);

/*
 * Following a failed create operation, we drop the dentry rather
@@ -1536,6 +1540,7 @@ int nfs_create(struct inode *dir, struct dentry *dentry,
	d_drop(dentry);
	return error;
}
EXPORT_SYMBOL_GPL(nfs_create);

/*
 * See comments for nfs_proc_create regarding failed operations.
@@ -1563,6 +1568,7 @@ nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev)
	d_drop(dentry);
	return status;
}
EXPORT_SYMBOL_GPL(nfs_mknod);

/*
 * See comments for nfs_proc_create regarding failed operations.
@@ -1586,6 +1592,7 @@ int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
	d_drop(dentry);
	return error;
}
EXPORT_SYMBOL_GPL(nfs_mkdir);

static void nfs_dentry_handle_enoent(struct dentry *dentry)
{
@@ -1609,6 +1616,7 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry)

	return error;
}
EXPORT_SYMBOL_GPL(nfs_rmdir);

/*
 * Remove a file after making sure there are no pending writes,
@@ -1680,6 +1688,7 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry)
		d_rehash(dentry);
	return error;
}
EXPORT_SYMBOL_GPL(nfs_unlink);

/*
 * To create a symbolic link, most file systems instantiate a new inode,
@@ -1750,6 +1759,7 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)

	return 0;
}
EXPORT_SYMBOL_GPL(nfs_symlink);

int
nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
@@ -1771,6 +1781,7 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
	}
	return error;
}
EXPORT_SYMBOL_GPL(nfs_link);

/*
 * RENAME
@@ -1869,6 +1880,7 @@ int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
		dput(dentry);
	return error;
}
EXPORT_SYMBOL_GPL(nfs_rename);

static DEFINE_SPINLOCK(nfs_access_lru_lock);
static LIST_HEAD(nfs_access_lru_list);
@@ -2188,6 +2200,7 @@ int nfs_permission(struct inode *inode, int mask)
		res = generic_permission(inode, mask);
	goto out;
}
EXPORT_SYMBOL_GPL(nfs_permission);

/*
 * Local variables:
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
 *  nfs regular file handling functions
 */

#include <linux/module.h>
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -865,3 +866,4 @@ const struct file_operations nfs_file_operations = {
	.check_flags	= nfs_check_flags,
	.setlease	= nfs_setlease,
};
EXPORT_SYMBOL_GPL(nfs_file_operations);
Loading