summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-10-11 05:34:28 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-10-11 05:34:28 -0700
commitbbe0c3d99f33fa97db37a1c4e393c79965666752 (patch)
treecd2bbbfb0dcb297e25d030e02ba8970de652e213
parent38782482243a134ab8c87e384a8238aafe12903d (diff)
[PATCH] kNFSd: New routine exp_pseudoroot() to find 'root' filehandle for nfsv4
NFSv4 has a concept of a 'root' filehandle (from which all other can be found via LOOKUP, so no need for mountd). This patch defines exp_pseudoroot(), which is used to set the filehandle for the root of the pseudofs. The root is defined to be the export point with fsid == 0.
-rw-r--r--fs/nfsd/export.c17
-rw-r--r--include/linux/nfsd/export.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 8b451ba42aa6..9474463e981b 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -550,6 +550,23 @@ out:
return err;
}
+/*
+ * Called when we need the filehandle for the root of the pseudofs,
+ * for a given NFSv4 client. The root is defined to be the
+ * export point with fsid==0
+ */
+int
+exp_pseudoroot(struct svc_client *clp, struct svc_fh *fhp)
+{
+ struct svc_export *exp;
+
+ exp = exp_get_fsid(clp, 0);
+ if (!exp)
+ return nfserr_perm;
+
+ dget(exp->ex_dentry);
+ return fh_compose(fhp, exp, exp->ex_dentry, NULL);
+}
/*
* Find a valid client given an inet address. We always move the most
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 8c79deb497ee..9c50603cd671 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -100,6 +100,7 @@ struct svc_export * exp_parent(struct svc_client *clp, struct vfsmount *mnt,
struct dentry *dentry);
int exp_rootfh(struct svc_client *,
char *path, struct knfsd_fh *, int maxsize);
+int exp_pseudoroot(struct svc_client *, struct svc_fh *fhp);
int nfserrno(int errno);
static inline struct svc_export *