diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2014-05-23 08:00:19 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-05-30 17:32:19 -0400 |
commit | 94eb36892d727145794b80dceffc435d1d68edbb (patch) | |
tree | 7df717686ed4888d645c62663c4ddc7e2fe21ff9 /fs/nfsd | |
parent | 0d63790c365852a6ce2913632b933633343ae479 (diff) |
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.c | 6 | ||||
-rw-r--r-- | fs/nfsd/export.h | 1 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 3 |
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) | |||
487 | 487 | ||
488 | /* expect a 16 byte uuid encoded as \xXXXX... */ | 488 | /* expect a 16 byte uuid encoded as \xXXXX... */ |
489 | len = qword_get(mesg, buf, PAGE_SIZE); | 489 | len = qword_get(mesg, buf, PAGE_SIZE); |
490 | if (len != 16) | 490 | if (len != EX_UUID_LEN) |
491 | return -EINVAL; | 491 | return -EINVAL; |
492 | 492 | ||
493 | *puuid = kmemdup(buf, 16, GFP_KERNEL); | 493 | *puuid = kmemdup(buf, EX_UUID_LEN, GFP_KERNEL); |
494 | if (*puuid == NULL) | 494 | if (*puuid == NULL) |
495 | return -ENOMEM; | 495 | return -ENOMEM; |
496 | 496 | ||
@@ -663,7 +663,7 @@ static int svc_export_show(struct seq_file *m, | |||
663 | if (exp->ex_uuid) { | 663 | if (exp->ex_uuid) { |
664 | int i; | 664 | int i; |
665 | seq_puts(m, ",uuid="); | 665 | seq_puts(m, ",uuid="); |
666 | for (i=0; i<16; i++) { | 666 | for (i = 0; i < EX_UUID_LEN; i++) { |
667 | if ((i&3) == 0 && i) | 667 | if ((i&3) == 0 && i) |
668 | seq_putc(m, ':'); | 668 | seq_putc(m, ':'); |
669 | seq_printf(m, "%02x", exp->ex_uuid[i]); | 669 | 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 { | |||
37 | * spkm3i, and spkm3p (and using all 8 at once should be rare). | 37 | * spkm3i, and spkm3p (and using all 8 at once should be rare). |
38 | */ | 38 | */ |
39 | #define MAX_SECINFO_LIST 8 | 39 | #define MAX_SECINFO_LIST 8 |
40 | #define EX_UUID_LEN 16 | ||
40 | 41 | ||
41 | struct exp_flavor_info { | 42 | struct exp_flavor_info { |
42 | u32 pseudoflavor; | 43 | 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, | |||
2223 | *p++ = cpu_to_be32(MINOR(stat.dev)); | 2223 | *p++ = cpu_to_be32(MINOR(stat.dev)); |
2224 | break; | 2224 | break; |
2225 | case FSIDSOURCE_UUID: | 2225 | case FSIDSOURCE_UUID: |
2226 | p = xdr_encode_opaque_fixed(p, exp->ex_uuid, 16); | 2226 | p = xdr_encode_opaque_fixed(p, exp->ex_uuid, |
2227 | EX_UUID_LEN); | ||
2227 | break; | 2228 | break; |
2228 | } | 2229 | } |
2229 | } | 2230 | } |