diff options
Diffstat (limited to 'fs/nfsd/nfsxdr.c')
-rw-r--r-- | fs/nfsd/nfsxdr.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 6555c50d9006..0c24b9e24fe8 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c | |||
@@ -153,6 +153,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
153 | struct dentry *dentry = fhp->fh_dentry; | 153 | struct dentry *dentry = fhp->fh_dentry; |
154 | int type; | 154 | int type; |
155 | struct timespec time; | 155 | struct timespec time; |
156 | u32 f; | ||
156 | 157 | ||
157 | type = (stat->mode & S_IFMT); | 158 | type = (stat->mode & S_IFMT); |
158 | 159 | ||
@@ -173,10 +174,22 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
173 | else | 174 | else |
174 | *p++ = htonl(0xffffffff); | 175 | *p++ = htonl(0xffffffff); |
175 | *p++ = htonl((u32) stat->blocks); | 176 | *p++ = htonl((u32) stat->blocks); |
176 | if (is_fsid(fhp, rqstp->rq_reffh)) | 177 | switch (fsid_source(fhp)) { |
177 | *p++ = htonl((u32) fhp->fh_export->ex_fsid); | 178 | default: |
178 | else | 179 | case FSIDSOURCE_DEV: |
179 | *p++ = htonl(new_encode_dev(stat->dev)); | 180 | *p++ = htonl(new_encode_dev(stat->dev)); |
181 | break; | ||
182 | case FSIDSOURCE_FSID: | ||
183 | *p++ = htonl((u32) fhp->fh_export->ex_fsid); | ||
184 | break; | ||
185 | case FSIDSOURCE_UUID: | ||
186 | f = ((u32*)fhp->fh_export->ex_uuid)[0]; | ||
187 | f ^= ((u32*)fhp->fh_export->ex_uuid)[1]; | ||
188 | f ^= ((u32*)fhp->fh_export->ex_uuid)[2]; | ||
189 | f ^= ((u32*)fhp->fh_export->ex_uuid)[3]; | ||
190 | *p++ = htonl(f); | ||
191 | break; | ||
192 | } | ||
180 | *p++ = htonl((u32) stat->ino); | 193 | *p++ = htonl((u32) stat->ino); |
181 | *p++ = htonl((u32) stat->atime.tv_sec); | 194 | *p++ = htonl((u32) stat->atime.tv_sec); |
182 | *p++ = htonl(stat->atime.tv_nsec ? stat->atime.tv_nsec / 1000 : 0); | 195 | *p++ = htonl(stat->atime.tv_nsec ? stat->atime.tv_nsec / 1000 : 0); |