r340: Fix printing of 64bit integers; patch by Brad Allen
authoryoe <yoe>
Tue, 12 Aug 2008 20:22:01 +0000 (20:22 +0000)
committeryoe <yoe>
Tue, 12 Aug 2008 20:22:01 +0000 (20:22 +0000)
nbd-server.c

index 5425eb5..614fda5 100644 (file)
@@ -892,7 +892,7 @@ ssize_t rawexpwrite(off_t a, char *buf, size_t len, CLIENT *client) {
        if(maxbytes && len > maxbytes)
                len = maxbytes;
 
-       DEBUG4("(WRITE to fd %d offset %Lu len %u), ", fhandle, foffset, len);
+       DEBUG4("(WRITE to fd %d offset %llu len %u), ", fhandle, foffset, len);
 
        myseek(fhandle, foffset);
        return write(fhandle, buf, len);
@@ -934,7 +934,7 @@ ssize_t rawexpread(off_t a, char *buf, size_t len, CLIENT *client) {
        if(maxbytes && len > maxbytes)
                len = maxbytes;
 
-       DEBUG4("(READ from fd %d offset %Lu len %u), ", fhandle, foffset, len);
+       DEBUG4("(READ from fd %d offset %llu len %u), ", fhandle, foffset, len);
 
        myseek(fhandle, foffset);
        return read(fhandle, buf, len);
@@ -971,7 +971,7 @@ int expread(off_t a, char *buf, size_t len, CLIENT *client) {
 
        if (!(client->server->flags & F_COPYONWRITE))
                return(rawexpread_fully(a, buf, len, client));
-       DEBUG3("Asked to read %d bytes at %Lu.\n", len, (unsigned long long)a);
+       DEBUG3("Asked to read %d bytes at %llu.\n", len, (unsigned long long)a);
 
        mapl=a/DIFFPAGESIZE; maph=(a+len-1)/DIFFPAGESIZE;
 
@@ -981,12 +981,12 @@ int expread(off_t a, char *buf, size_t len, CLIENT *client) {
                rdlen=(0<DIFFPAGESIZE-offset && len<(size_t)(DIFFPAGESIZE-offset)) ?
                        len : (size_t)DIFFPAGESIZE-offset;
                if (client->difmap[mapcnt]!=(u32)(-1)) { /* the block is already there */
-                       DEBUG3("Page %Lu is at %lu\n", (unsigned long long)mapcnt,
+                       DEBUG3("Page %llu is at %lu\n", (unsigned long long)mapcnt,
                               (unsigned long)(client->difmap[mapcnt]));
                        myseek(client->difffile, client->difmap[mapcnt]*DIFFPAGESIZE+offset);
                        if (read(client->difffile, buf, rdlen) != rdlen) return -1;
                } else { /* the block is not there */
-                       DEBUG2("Page %Lu is not here, we read the original one\n",
+                       DEBUG2("Page %llu is not here, we read the original one\n",
                               (unsigned long long)mapcnt);
                        if(rawexpread_fully(a, buf, rdlen, client)) return -1;
                }
@@ -1015,7 +1015,7 @@ int expwrite(off_t a, char *buf, size_t len, CLIENT *client) {
 
        if (!(client->server->flags & F_COPYONWRITE))
                return(rawexpwrite_fully(a, buf, len, client)); 
-       DEBUG3("Asked to write %d bytes at %Lu.\n", len, (unsigned long long)a);
+       DEBUG3("Asked to write %d bytes at %llu.\n", len, (unsigned long long)a);
 
        mapl=a/DIFFPAGESIZE ; maph=(a+len-1)/DIFFPAGESIZE ;
 
@@ -1026,7 +1026,7 @@ int expwrite(off_t a, char *buf, size_t len, CLIENT *client) {
                        len : (size_t)DIFFPAGESIZE-offset;
 
                if (client->difmap[mapcnt]!=(u32)(-1)) { /* the block is already there */
-                       DEBUG3("Page %Lu is at %lu\n", (unsigned long long)mapcnt,
+                       DEBUG3("Page %llu is at %lu\n", (unsigned long long)mapcnt,
                               (unsigned long)(client->difmap[mapcnt])) ;
                        myseek(client->difffile,
                                        client->difmap[mapcnt]*DIFFPAGESIZE+offset);
@@ -1034,7 +1034,7 @@ int expwrite(off_t a, char *buf, size_t len, CLIENT *client) {
                } else { /* the block is not there */
                        myseek(client->difffile,client->difffilelen*DIFFPAGESIZE) ;
                        client->difmap[mapcnt]=(client->server->flags&F_SPARSE)?mapcnt:client->difffilelen++;
-                       DEBUG3("Page %Lu is not here, we put it at %lu\n",
+                       DEBUG3("Page %llu is not here, we put it at %lu\n",
                               (unsigned long long)mapcnt,
                               (unsigned long)(client->difmap[mapcnt]));
                        rdlen=DIFFPAGESIZE ;
@@ -1134,7 +1134,7 @@ int mainloop(CLIENT *client) {
                if (len > BUFSIZE + sizeof(struct nbd_reply))
                        err("Request too big!");
 #ifdef DODBG
-               printf("%s from %Lu (%Lu) len %d, ", request.type ? "WRITE" :
+               printf("%s from %llu (%llu) len %d, ", request.type ? "WRITE" :
                                "READ", (unsigned long long)request.from,
                                (unsigned long long)request.from / 512, len);
 #endif
@@ -1257,7 +1257,7 @@ void setupexport(CLIENT* client) {
                client->exportsize = client->server->expected_size;
        }
 
-       msg3(LOG_INFO, "Size of exported file/device is %Lu", (unsigned long long)client->exportsize);
+       msg3(LOG_INFO, "Size of exported file/device is %llu", (unsigned long long)client->exportsize);
        if(multifile) {
                msg3(LOG_INFO, "Total number of files: %d", i);
        }