Commit bbe0c3d9 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[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.
parent 38782482
...@@ -550,6 +550,23 @@ exp_rootfh(struct svc_client *clp, char *path, struct knfsd_fh *f, int maxsize) ...@@ -550,6 +550,23 @@ exp_rootfh(struct svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
return err; 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 * Find a valid client given an inet address. We always move the most
......
...@@ -100,6 +100,7 @@ struct svc_export * exp_parent(struct svc_client *clp, struct vfsmount *mnt, ...@@ -100,6 +100,7 @@ struct svc_export * exp_parent(struct svc_client *clp, struct vfsmount *mnt,
struct dentry *dentry); struct dentry *dentry);
int exp_rootfh(struct svc_client *, int exp_rootfh(struct svc_client *,
char *path, struct knfsd_fh *, int maxsize); char *path, struct knfsd_fh *, int maxsize);
int exp_pseudoroot(struct svc_client *, struct svc_fh *fhp);
int nfserrno(int errno); int nfserrno(int errno);
static inline struct svc_export * static inline struct svc_export *
......
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