]> Pileus Git - ~andy/linux/blobdiff - fs/nfsd/nfs4xdr.c
[PATCH] knfsd: add some new fsid types
[~andy/linux] / fs / nfsd / nfs4xdr.c
index f3f239db04bb1b0d54f1a18ff78f4ffce3d18ee1..0efba557fb55b9b84ed801e6b57757b1883c075b 100644 (file)
@@ -1563,14 +1563,20 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
                if (exp->ex_fslocs.migrated) {
                        WRITE64(NFS4_REFERRAL_FSID_MAJOR);
                        WRITE64(NFS4_REFERRAL_FSID_MINOR);
-               } else if (is_fsid(fhp, rqstp->rq_reffh)) {
+               } else switch(fsid_source(fhp)) {
+               case FSIDSOURCE_FSID:
                        WRITE64((u64)exp->ex_fsid);
                        WRITE64((u64)0);
-               } else {
+                       break;
+               case FSIDSOURCE_DEV:
                        WRITE32(0);
                        WRITE32(MAJOR(stat.dev));
                        WRITE32(0);
                        WRITE32(MINOR(stat.dev));
+                       break;
+               case FSIDSOURCE_UUID:
+                       WRITEMEM(exp->ex_uuid, 16);
+                       break;
                }
        }
        if (bmval0 & FATTR4_WORD0_UNIQUE_HANDLES) {
@@ -1845,15 +1851,11 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
 
        exp_get(exp);
        if (d_mountpoint(dentry)) {
-               if (nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp)) {
-               /*
-                * -EAGAIN is the only error returned from
-                * nfsd_cross_mnt() and it indicates that an
-                * up-call has  been initiated to fill in the export
-                * options on exp.  When the answer comes back,
-                * this call will be retried.
-                */
-                       nfserr = nfserr_dropit;
+               int err;
+
+               err = nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp);
+               if (err) {
+                       nfserr = nfserrno(err);
                        goto out_put;
                }
 
@@ -1884,9 +1886,10 @@ nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr)
 }
 
 static int
-nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
-                   loff_t offset, ino_t ino, unsigned int d_type)
+nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
+                   loff_t offset, u64 ino, unsigned int d_type)
 {
+       struct readdir_cd *ccd = ccdv;
        struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common);
        int buflen;
        __be32 *p = cd->buffer;