]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfsd/nfsxdr.c
Pull bugzilla-7887 into release branch
[linux-2.6-omap-h63xx.git] / fs / nfsd / nfsxdr.c
index 56ebb1443e0eb7bf067a773690dee36a1d60f2ee..0c24b9e24fe866683a357f1a9e8b08bcb2fbe30c 100644 (file)
 
 #define NFSDDBG_FACILITY               NFSDDBG_XDR
 
-
-#ifdef NFSD_OPTIMIZE_SPACE
-# define inline
-#endif
-
 /*
  * Mapping of S_IF* types to NFS file types
  */
@@ -55,7 +50,7 @@ __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp)
        return decode_fh(p, fhp);
 }
 
-static inline __be32 *
+static __be32 *
 encode_fh(__be32 *p, struct svc_fh *fhp)
 {
        memcpy(p, &fhp->fh_handle.fh_base, NFS_FHSIZE);
@@ -66,7 +61,7 @@ encode_fh(__be32 *p, struct svc_fh *fhp)
  * Decode a file name and make sure that the path contains
  * no slashes or null bytes.
  */
-static inline __be32 *
+static __be32 *
 decode_filename(__be32 *p, char **namp, int *lenp)
 {
        char            *name;
@@ -82,7 +77,7 @@ decode_filename(__be32 *p, char **namp, int *lenp)
        return p;
 }
 
-static inline __be32 *
+static __be32 *
 decode_pathname(__be32 *p, char **namp, int *lenp)
 {
        char            *name;
@@ -98,7 +93,7 @@ decode_pathname(__be32 *p, char **namp, int *lenp)
        return p;
 }
 
-static inline __be32 *
+static __be32 *
 decode_sattr(__be32 *p, struct iattr *iap)
 {
        u32     tmp, tmp1;
@@ -158,6 +153,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
        struct dentry   *dentry = fhp->fh_dentry;
        int type;
        struct timespec time;
+       u32 f;
 
        type = (stat->mode & S_IFMT);
 
@@ -178,10 +174,22 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
        else
                *p++ = htonl(0xffffffff);
        *p++ = htonl((u32) stat->blocks);
-       if (is_fsid(fhp, rqstp->rq_reffh))
-               *p++ = htonl((u32) fhp->fh_export->ex_fsid);
-       else
+       switch (fsid_source(fhp)) {
+       default:
+       case FSIDSOURCE_DEV:
                *p++ = htonl(new_encode_dev(stat->dev));
+               break;
+       case FSIDSOURCE_FSID:
+               *p++ = htonl((u32) fhp->fh_export->ex_fsid);
+               break;
+       case FSIDSOURCE_UUID:
+               f = ((u32*)fhp->fh_export->ex_uuid)[0];
+               f ^= ((u32*)fhp->fh_export->ex_uuid)[1];
+               f ^= ((u32*)fhp->fh_export->ex_uuid)[2];
+               f ^= ((u32*)fhp->fh_export->ex_uuid)[3];
+               *p++ = htonl(f);
+               break;
+       }
        *p++ = htonl((u32) stat->ino);
        *p++ = htonl((u32) stat->atime.tv_sec);
        *p++ = htonl(stat->atime.tv_nsec ? stat->atime.tv_nsec / 1000 : 0);
@@ -467,9 +475,10 @@ nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p,
 }
 
 int
-nfssvc_encode_entry(struct readdir_cd *ccd, const char *name,
-                   int namlen, loff_t offset, ino_t ino, unsigned int d_type)
+nfssvc_encode_entry(void *ccdv, const char *name,
+                   int namlen, loff_t offset, u64 ino, unsigned int d_type)
 {
+       struct readdir_cd *ccd = ccdv;
        struct nfsd_readdirres *cd = container_of(ccd, struct nfsd_readdirres, common);
        __be32  *p = cd->buffer;
        int     buflen, slen;