Skip to content

Commit 94eb368

Browse files
kinglongmeeJ. Bruce Fields
authored andcommitted
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>
1 parent 0d63790 commit 94eb368

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎fs/nfsd/export.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
487487

488488
/* expect a 16 byte uuid encoded as \xXXXX... */
489489
len = qword_get(mesg, buf, PAGE_SIZE);
490-
if (len != 16)
490+
if (len != EX_UUID_LEN)
491491
return -EINVAL;
492492

493-
*puuid = kmemdup(buf, 16, GFP_KERNEL);
493+
*puuid = kmemdup(buf, EX_UUID_LEN, GFP_KERNEL);
494494
if (*puuid == NULL)
495495
return -ENOMEM;
496496

@@ -663,7 +663,7 @@ static int svc_export_show(struct seq_file *m,
663663
if (exp->ex_uuid) {
664664
int i;
665665
seq_puts(m, ",uuid=");
666-
for (i=0; i<16; i++) {
666+
for (i = 0; i < EX_UUID_LEN; i++) {
667667
if ((i&3) == 0 && i)
668668
seq_putc(m, ':');
669669
seq_printf(m, "%02x", exp->ex_uuid[i]);

‎fs/nfsd/export.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct nfsd4_fs_locations {
3737
* spkm3i, and spkm3p (and using all 8 at once should be rare).
3838
*/
3939
#define MAX_SECINFO_LIST 8
40+
#define EX_UUID_LEN 16
4041

4142
struct exp_flavor_info {
4243
u32 pseudoflavor;

‎fs/nfsd/nfs4xdr.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,8 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
22232223
*p++ = cpu_to_be32(MINOR(stat.dev));
22242224
break;
22252225
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);
22272228
break;
22282229
}
22292230
}

0 commit comments

Comments
 (0)