iWe dont really need the data sent back from the server in a read so make it
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 24 Aug 2008 21:56:33 +0000 (07:56 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 24 Aug 2008 21:56:33 +0000 (07:56 +1000)
conditional and skip the memcpy() if the buffer we want to read into is NULL

libnfs.c
nfsio.c

index ad84c5b6662c09c50946b53a6decbd9652660687..bbb1ce8b3a693307597b05cb3e9023380d72a6f5 100644 (file)
--- a/libnfs.c
+++ b/libnfs.c
@@ -800,9 +800,10 @@ nfsstat3 nfsio_read(struct nfsio *nfsio, const char *name, char *buf, uint32 off
        if (eof) {
                *eof = READ3res->READ3res_u.resok.eof;
        }
-       memcpy(buf, &READ3res->READ3res_u.resok.data.data_val,
-                               READ3res->READ3res_u.resok.count);
-
+       if (buf) {
+               memcpy(buf, &READ3res->READ3res_u.resok.data.data_val,
+                       READ3res->READ3res_u.resok.count);
+       }
 
 finished:
        return ret;
diff --git a/nfsio.c b/nfsio.c
index 42ef47a8f987cd1ccd24ac4e22e612315c85952f..cafee9eb51330c6592ba1ff18ca7867622e99790 100644 (file)
--- a/nfsio.c
+++ b/nfsio.c
@@ -259,7 +259,7 @@ static void nfs3_read(struct dbench_op *op)
                len = options.trunc_io;
        }
 
-       res = nfsio_read(op->child->private, op->fname, rw_buf, offset, len, NULL, NULL);
+       res = nfsio_read(op->child->private, op->fname, NULL, offset, len, NULL, NULL);
        if (!check_status(res, op->status)) {
                printf("[%d] READ \"%s\" failed (%x) - expected %s\n", 
                       op->child->line, op->fname,