From 3eea06ce7e4fde49a8024e30de6672b5c83a5f4b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 12 Sep 2002 01:40:30 -0700 Subject: [PATCH] kNFSd 5: Get rid of ex_parent from svc_export I was never entirely sure what it was for, but it is not used now, only set, so it can go. --- fs/nfsd/export.c | 27 +++------------------------ include/linux/nfsd/export.h | 1 - 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 4f8a9da439a1..cca200e84fcb 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -169,19 +169,6 @@ exp_child(svc_client *clp, struct super_block *sb, struct dentry *dentry) return NULL; } -/* Update parent pointers of all exports */ -static void exp_change_parents(svc_client *clp, svc_export *old, svc_export *new) -{ - struct list_head *head = &clp->cl_list; - struct list_head *p; - - list_for_each(p, head) { - svc_export *exp = list_entry(p, svc_export, ex_list); - if (exp->ex_parent == old) - exp->ex_parent = new; - } -} - /* * Hashtable locking. Write locks are placed only by user processes * wanting to modify export information. @@ -245,7 +232,7 @@ int exp_export(struct nfsctl_export *nxp) { svc_client *clp; - svc_export *exp = NULL, *parent; + svc_export *exp = NULL; svc_export *fsid_exp; struct nameidata nd; struct inode *inode = NULL; @@ -332,12 +319,12 @@ exp_export(struct nfsctl_export *nxp) inode->i_sb->s_export_op->find_exported_dentry = find_exported_dentry; - if ((parent = exp_child(clp, inode->i_sb, nd.dentry)) != NULL) { + if (exp_child(clp, inode->i_sb, nd.dentry) != NULL) { dprintk("exp_export: export not valid (Rule 3).\n"); goto finish; } /* Is this is a sub-export, must be a proper subset of FS */ - if ((parent = exp_parent(clp, inode->i_sb, nd.dentry)) != NULL) { + if (exp_parent(clp, inode->i_sb, nd.dentry) != NULL) { dprintk("exp_export: sub-export not valid (Rule 2).\n"); goto finish; } @@ -349,7 +336,6 @@ exp_export(struct nfsctl_export *nxp) strcpy(exp->ex_path, nxp->ex_path); exp->ex_client = clp; - exp->ex_parent = parent; exp->ex_mnt = mntget(nd.mnt); exp->ex_dentry = dget(nd.dentry); exp->ex_flags = nxp->ex_flags; @@ -359,11 +345,6 @@ exp_export(struct nfsctl_export *nxp) exp->ex_anon_gid = nxp->ex_anon_gid; exp->ex_fsid = nxp->ex_dev; - - /* Update parent pointers of all exports */ - if (parent) - exp_change_parents(clp, parent, exp); - list_add(&exp->ex_hash, clp->cl_export + EXPORT_HASH(dev)); list_add_tail(&exp->ex_list, &clp->cl_list); @@ -393,8 +374,6 @@ exp_do_unexport(svc_export *unexp) list_del(&unexp->ex_list); list_del(&unexp->ex_hash); exp_fsid_unhash(unexp); - /* Update parent pointers. */ - exp_change_parents(unexp->ex_client, unexp, unexp->ex_parent); dentry = unexp->ex_dentry; mnt = unexp->ex_mnt; inode = dentry->d_inode; diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index a8968f9a106f..df5990ab1778 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -64,7 +64,6 @@ struct svc_export { struct list_head ex_fsid_hash; struct list_head ex_list; char ex_path[NFS_MAXPATHLEN+1]; - struct svc_export * ex_parent; struct svc_client * ex_client; int ex_flags; struct vfsmount * ex_mnt; -- cgit v1.2.3