diff options
author | Roland McGrath <roland@gnu.org> | 2001-09-29 21:03:27 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-09-29 21:03:27 +0000 |
commit | 69d69842e93579610696a84e3052851da11161d8 (patch) | |
tree | 3485bb8860204ed26615adb28583cbd11a766ea8 | |
parent | 85a4f4fc773eb1f530b96fc7f6ffe28577e22078 (diff) |
2001-09-29 Roland McGrath <roland@frob.com>
* nbd.c (struct nbd_startup): Replace sizehi, sizelo with just size.
(nbdopen): Changed use.
-rw-r--r-- | libstore/nbd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libstore/nbd.c b/libstore/nbd.c index b8fe1590..fc815c70 100644 --- a/libstore/nbd.c +++ b/libstore/nbd.c @@ -40,14 +40,13 @@ #define NBD_INIT_MAGIC "NBDMAGIC\x00\x00\x42\x02\x81\x86\x12\x53" -#define NBD_REQUEST_MAGIC htonl(0x25609513) -#define NBD_REPLY_MAGIC htonl(0x67446698) +#define NBD_REQUEST_MAGIC (htonl (0x25609513)) +#define NBD_REPLY_MAGIC (htonl (0x67446698)) struct nbd_startup { char magic[16]; /* NBD_INIT_MAGIC */ - uint32_t sizehi; /* size in bytes, 64 bits in net order */ - uint32_t sizelo; + uint64_t size; /* size in bytes, 64 bits in net order */ char reserved[128]; /* zeros, we don't check it */ }; @@ -303,7 +302,7 @@ nbdopen (const char *name, int *mod_flags, return EGRATUITOUS; /* ? */ } - *size = ((uint64_t) ntohl (ns.sizehi) << 32) | ntohl (ns.sizelo); + *size = ntohll (ns.size); *sockport = getdport (sock); close (sock); |