summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-05-23 16:00:19 +0400
committerJ. Bruce Fields <bfields@redhat.com>2014-05-31 01:32:19 +0400
commit94eb36892d727145794b80dceffc435d1d68edbb (patch)
tree7df717686ed4888d645c62663c4ddc7e2fe21ff9 /fs/nfsd
parent0d63790c365852a6ce2913632b933633343ae479 (diff)
downloadlinux-94eb36892d727145794b80dceffc435d1d68edbb.tar.xz
NFSD: Adds macro EX_UUID_LEN for exports uuid's length
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/export.c6
-rw-r--r--fs/nfsd/export.h1
-rw-r--r--fs/nfsd/nfs4xdr.c3
3 files changed, 6 insertions, 4 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 8771f417efa6..90d37b6ef163 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -487,10 +487,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
/* expect a 16 byte uuid encoded as \xXXXX... */
len = qword_get(mesg, buf, PAGE_SIZE);
- if (len != 16)
+ if (len != EX_UUID_LEN)
return -EINVAL;
- *puuid = kmemdup(buf, 16, GFP_KERNEL);
+ *puuid = kmemdup(buf, EX_UUID_LEN, GFP_KERNEL);
if (*puuid == NULL)
return -ENOMEM;
@@ -663,7 +663,7 @@ static int svc_export_show(struct seq_file *m,
if (exp->ex_uuid) {
int i;
seq_puts(m, ",uuid=");
- for (i=0; i<16; i++) {
+ for (i = 0; i < EX_UUID_LEN; i++) {
if ((i&3) == 0 && i)
seq_putc(m, ':');
seq_printf(m, "%02x", exp->ex_uuid[i]);
diff --git a/fs/nfsd/export.h b/fs/nfsd/export.h
index d7939a62a0ae..c7d4ed05e470 100644
--- a/fs/nfsd/export.h
+++ b/fs/nfsd/export.h
@@ -37,6 +37,7 @@ struct nfsd4_fs_locations {
* spkm3i, and spkm3p (and using all 8 at once should be rare).
*/
#define MAX_SECINFO_LIST 8
+#define EX_UUID_LEN 16
struct exp_flavor_info {
u32 pseudoflavor;
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 470fe8998c9b..70d147244891 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2223,7 +2223,8 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
*p++ = cpu_to_be32(MINOR(stat.dev));
break;
case FSIDSOURCE_UUID:
- p = xdr_encode_opaque_fixed(p, exp->ex_uuid, 16);
+ p = xdr_encode_opaque_fixed(p, exp->ex_uuid,
+ EX_UUID_LEN);
break;
}
}