Skip to content

Commit

Permalink
NFSD: Adds macro EX_UUID_LEN for exports uuid's length
Browse files Browse the repository at this point in the history
Signed-off-by: Kinglong Mee <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
kinglongmee authored and J. Bruce Fields committed May 30, 2014
1 parent 0d63790 commit 94eb368
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
Expand Down
1 change: 1 addition & 0 deletions fs/nfsd/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 94eb368

Please sign in to comment.