ptrace: remove PT_DTRACE from avr32, mn10300, parisc, s390, sh, xtensa
[safe/jmp/linux-2.6] / fs / nfsd / export.c
index 3f6d51b..8b1f8ef 100644 (file)
@@ -871,23 +871,19 @@ static svc_export *exp_get_by_name(svc_client *clp, const struct path *path,
 /*
  * Find the export entry for a given dentry.
  */
-static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt,
-                                    struct dentry *dentry,
-                                    struct cache_req *reqp)
+static struct svc_export *exp_parent(svc_client *clp, struct path *path)
 {
-       struct path path = {.mnt = mnt, .dentry = dentry};
-       svc_export *exp;
-
-       dget(path.dentry);
-       exp = exp_get_by_name(clp, &path, reqp);
-
-       while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path.dentry)) {
-               struct dentry *parent = dget_parent(path.dentry);
-               dput(path.dentry);
-               path.dentry = parent;
-               exp = exp_get_by_name(clp, &path, reqp);
+       struct dentry *saved = dget(path->dentry);
+       svc_export *exp = exp_get_by_name(clp, path, NULL);
+
+       while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
+               struct dentry *parent = dget_parent(path->dentry);
+               dput(path->dentry);
+               path->dentry = parent;
+               exp = exp_get_by_name(clp, path, NULL);
        }
-       dput(path.dentry);
+       dput(path->dentry);
+       path->dentry = saved;
        return exp;
 }
 
@@ -1174,7 +1170,7 @@ exp_rootfh(svc_client *clp, char *name, struct knfsd_fh *f, int maxsize)
        dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n",
                 name, path.dentry, clp->name,
                 inode->i_sb->s_id, inode->i_ino);
-       exp = exp_parent(clp, path.mnt, path.dentry, NULL);
+       exp = exp_parent(clp, &path);
        if (IS_ERR(exp)) {
                err = PTR_ERR(exp);
                goto out;
@@ -1244,18 +1240,15 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
  * use exp_get_by_name() or exp_find().
  */
 struct svc_export *
-rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
-               struct dentry *dentry)
+rqst_exp_get_by_name(struct svc_rqst *rqstp, struct path *path)
 {
        struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
-       struct path path = {.mnt = mnt, .dentry = dentry};
 
        if (rqstp->rq_client == NULL)
                goto gss;
 
        /* First try the auth_unix client: */
-       exp = exp_get_by_name(rqstp->rq_client, &path,
-                                               &rqstp->rq_chandle);
+       exp = exp_get_by_name(rqstp->rq_client, path, &rqstp->rq_chandle);
        if (PTR_ERR(exp) == -ENOENT)
                goto gss;
        if (IS_ERR(exp))
@@ -1267,8 +1260,7 @@ gss:
        /* Otherwise, try falling back on gss client */
        if (rqstp->rq_gssclient == NULL)
                return exp;
-       gssexp = exp_get_by_name(rqstp->rq_gssclient, &path,
-                                               &rqstp->rq_chandle);
+       gssexp = exp_get_by_name(rqstp->rq_gssclient, path, &rqstp->rq_chandle);
        if (PTR_ERR(gssexp) == -ENOENT)
                return exp;
        if (!IS_ERR(exp))
@@ -1307,23 +1299,19 @@ gss:
 }
 
 struct svc_export *
-rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
-               struct dentry *dentry)
+rqst_exp_parent(struct svc_rqst *rqstp, struct path *path)
 {
-       struct svc_export *exp;
-
-       dget(dentry);
-       exp = rqst_exp_get_by_name(rqstp, mnt, dentry);
-
-       while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(dentry)) {
-               struct dentry *parent;
-
-               parent = dget_parent(dentry);
-               dput(dentry);
-               dentry = parent;
-               exp = rqst_exp_get_by_name(rqstp, mnt, dentry);
+       struct dentry *saved = dget(path->dentry);
+       struct svc_export *exp = rqst_exp_get_by_name(rqstp, path);
+
+       while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
+               struct dentry *parent = dget_parent(path->dentry);
+               dput(path->dentry);
+               path->dentry = parent;
+               exp = rqst_exp_get_by_name(rqstp, path);
        }
-       dput(dentry);
+       dput(path->dentry);
+       path->dentry = saved;
        return exp;
 }