]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfsd/nfsfh.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / fs / nfsd / nfsfh.c
index ecc439d2565fda18ecbeb460ec18eb5cb3115742..727ab3bd450d54bffee6183ddf8fea3e1d3bdb75 100644 (file)
@@ -76,7 +76,7 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry)
  * comment in the NFSv3 spec says this is incorrect (implementation notes for
  * the write call).
  */
-static inline int
+static inline __be32
 nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
 {
        /* Type can be negative when creating hardlinks - not to a dir */
@@ -110,13 +110,13 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
  * This is only called at the start of an nfsproc call, so fhp points to
  * a svc_fh which is all 0 except for the over-the-wire file handle.
  */
-u32
+__be32
 fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
 {
        struct knfsd_fh *fh = &fhp->fh_handle;
        struct svc_export *exp = NULL;
        struct dentry   *dentry;
-       u32             error = 0;
+       __be32          error = 0;
 
        dprintk("nfsd: fh_verify(%s)\n", SVCFH_fmt(fhp));
 
@@ -187,6 +187,11 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                        goto out;
                }
 
+               /* Set user creds for this exportpoint */
+               error = nfserrno(nfsd_setuser(rqstp, exp));
+               if (error)
+                       goto out;
+
                /*
                 * Look up the dentry using the NFS file handle.
                 */
@@ -241,16 +246,17 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                dprintk("nfsd: fh_verify - just checking\n");
                dentry = fhp->fh_dentry;
                exp = fhp->fh_export;
+               /* Set user creds for this exportpoint; necessary even
+                * in the "just checking" case because this may be a
+                * filehandle that was created by fh_compose, and that
+                * is about to be used in another nfsv4 compound
+                * operation */
+               error = nfserrno(nfsd_setuser(rqstp, exp));
+               if (error)
+                       goto out;
        }
        cache_get(&exp->h);
 
-       /* Set user creds for this exportpoint; necessary even in the "just
-        * checking" case because this may be a filehandle that was created by
-        * fh_compose, and that is about to be used in another nfsv4 compound
-        * operation */
-       error = nfserrno(nfsd_setuser(rqstp, exp));
-       if (error)
-               goto out;
 
        error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
        if (error)
@@ -309,7 +315,7 @@ static inline void _fh_update_old(struct dentry *dentry,
                fh->ofh_dirino = 0;
 }
 
-int
+__be32
 fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, struct svc_fh *ref_fh)
 {
        /* ref_fh is a reference file handle.
@@ -445,7 +451,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st
  * Update file handle information after changing a dentry.
  * This is only called by nfsd_create, nfsd_create_v3 and nfsd_proc_create
  */
-int
+__be32
 fh_update(struct svc_fh *fhp)
 {
        struct dentry *dentry;