summaryrefslogtreecommitdiffstats
path: root/fs/afs/cmservice.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-02-10 11:34:07 -0500
committerDavid Howells <dhowells@redhat.com>2017-02-10 11:34:17 -0500
commitff548773106ec7f8031bc6172e0234bd2a02c19c (patch)
tree1bae4bf8247b6e556f03d4a13274666eb1ea620b /fs/afs/cmservice.c
parenta507c346b7fdc97296fa74626df49fdb7296a04e (diff)
afs: Move UUID struct to linux/uuid.h
Move the afs_uuid struct to linux/uuid.h, rename it to uuid_v1 and change the u16/u32 fields to __be16/__be32 instead so that the structure can be cast to a 16-octet network-order buffer. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de
Diffstat (limited to 'fs/afs/cmservice.c')
-rw-r--r--fs/afs/cmservice.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index e349a3316303..2edbdcbf6432 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -351,7 +351,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
351{ 351{
352 struct sockaddr_rxrpc srx; 352 struct sockaddr_rxrpc srx;
353 struct afs_server *server; 353 struct afs_server *server;
354 struct afs_uuid *r; 354 struct uuid_v1 *r;
355 unsigned loop; 355 unsigned loop;
356 __be32 *b; 356 __be32 *b;
357 int ret; 357 int ret;
@@ -381,15 +381,15 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
381 } 381 }
382 382
383 _debug("unmarshall UUID"); 383 _debug("unmarshall UUID");
384 call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); 384 call->request = kmalloc(sizeof(struct uuid_v1), GFP_KERNEL);
385 if (!call->request) 385 if (!call->request)
386 return -ENOMEM; 386 return -ENOMEM;
387 387
388 b = call->buffer; 388 b = call->buffer;
389 r = call->request; 389 r = call->request;
390 r->time_low = ntohl(b[0]); 390 r->time_low = b[0];
391 r->time_mid = ntohl(b[1]); 391 r->time_mid = htons(ntohl(b[1]));
392 r->time_hi_and_version = ntohl(b[2]); 392 r->time_hi_and_version = htons(ntohl(b[2]));
393 r->clock_seq_hi_and_reserved = ntohl(b[3]); 393 r->clock_seq_hi_and_reserved = ntohl(b[3]);
394 r->clock_seq_low = ntohl(b[4]); 394 r->clock_seq_low = ntohl(b[4]);
395 395
@@ -454,7 +454,7 @@ static int afs_deliver_cb_probe(struct afs_call *call)
454static void SRXAFSCB_ProbeUuid(struct work_struct *work) 454static void SRXAFSCB_ProbeUuid(struct work_struct *work)
455{ 455{
456 struct afs_call *call = container_of(work, struct afs_call, work); 456 struct afs_call *call = container_of(work, struct afs_call, work);
457 struct afs_uuid *r = call->request; 457 struct uuid_v1 *r = call->request;
458 458
459 struct { 459 struct {
460 __be32 match; 460 __be32 match;
@@ -477,7 +477,7 @@ static void SRXAFSCB_ProbeUuid(struct work_struct *work)
477 */ 477 */
478static int afs_deliver_cb_probe_uuid(struct afs_call *call) 478static int afs_deliver_cb_probe_uuid(struct afs_call *call)
479{ 479{
480 struct afs_uuid *r; 480 struct uuid_v1 *r;
481 unsigned loop; 481 unsigned loop;
482 __be32 *b; 482 __be32 *b;
483 int ret; 483 int ret;
@@ -503,15 +503,15 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
503 } 503 }
504 504
505 _debug("unmarshall UUID"); 505 _debug("unmarshall UUID");
506 call->request = kmalloc(sizeof(struct afs_uuid), GFP_KERNEL); 506 call->request = kmalloc(sizeof(struct uuid_v1), GFP_KERNEL);
507 if (!call->request) 507 if (!call->request)
508 return -ENOMEM; 508 return -ENOMEM;
509 509
510 b = call->buffer; 510 b = call->buffer;
511 r = call->request; 511 r = call->request;
512 r->time_low = ntohl(b[0]); 512 r->time_low = b[0];
513 r->time_mid = ntohl(b[1]); 513 r->time_mid = htons(ntohl(b[1]));
514 r->time_hi_and_version = ntohl(b[2]); 514 r->time_hi_and_version = htons(ntohl(b[2]));
515 r->clock_seq_hi_and_reserved = ntohl(b[3]); 515 r->clock_seq_hi_and_reserved = ntohl(b[3]);
516 r->clock_seq_low = ntohl(b[4]); 516 r->clock_seq_low = ntohl(b[4]);
517 517
@@ -569,9 +569,9 @@ static void SRXAFSCB_TellMeAboutYourself(struct work_struct *work)
569 memset(&reply, 0, sizeof(reply)); 569 memset(&reply, 0, sizeof(reply));
570 reply.ia.nifs = htonl(nifs); 570 reply.ia.nifs = htonl(nifs);
571 571
572 reply.ia.uuid[0] = htonl(afs_uuid.time_low); 572 reply.ia.uuid[0] = afs_uuid.time_low;
573 reply.ia.uuid[1] = htonl(afs_uuid.time_mid); 573 reply.ia.uuid[1] = htonl(ntohs(afs_uuid.time_mid));
574 reply.ia.uuid[2] = htonl(afs_uuid.time_hi_and_version); 574 reply.ia.uuid[2] = htonl(ntohs(afs_uuid.time_hi_and_version));
575 reply.ia.uuid[3] = htonl((s8) afs_uuid.clock_seq_hi_and_reserved); 575 reply.ia.uuid[3] = htonl((s8) afs_uuid.clock_seq_hi_and_reserved);
576 reply.ia.uuid[4] = htonl((s8) afs_uuid.clock_seq_low); 576 reply.ia.uuid[4] = htonl((s8) afs_uuid.clock_seq_low);
577 for (loop = 0; loop < 6; loop++) 577 for (loop = 0; loop < 6; loop++)