]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwfio: use xfer_buflen and xfer_buf, fix read offset
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 24 Nov 2020 13:24:53 +0000 (08:24 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 15 Dec 2020 15:50:57 +0000 (10:50 -0500)
For consistency, use xfer_buf and xfer_buflen members of the
fio io description, in preference to buflen and buf.

Also, allow fio to read at any offset, unless overriden (as this
might conflict with fio verify ops).

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/test/fio/fio_librgw.cc

index 6b923619e319c1f1140f8bf757d4fea903384408..14418f433c87fc1c862aad0c30773d108599ee43 100644 (file)
@@ -392,8 +392,10 @@ namespace {
        goto out;
       }
 
-      r = rgw_write(data->fs, object_fh, 0, io_u->buflen, &nbytes,
-                   (void*) io_u->buf, RGW_WRITE_FLAG_NONE);
+      /* librgw can write at any offset, but only sequentially
+       * starting at 0, in one open/write/close cycle */
+      r = rgw_write(data->fs, object_fh, 0, io_u->xfer_buflen, &nbytes,
+                   (void*) io_u->xfer_buf, RGW_WRITE_FLAG_NONE);
       if (!! r) {
        dprint(FD_IO, "rgw_write failed for %s\n",
               object);
@@ -421,8 +423,8 @@ namespace {
        goto out;
       }
 
-      r = rgw_read(data->fs, object_fh, 0, io_u->buflen, &nbytes, io_u->buf,
-                  RGW_READ_FLAG_NONE);
+      r = rgw_read(data->fs, object_fh, io_u->offset, io_u->xfer_buflen,
+                  &nbytes, io_u->xfer_buf, RGW_READ_FLAG_NONE);
       if (!! r) {
        dprint(FD_IO, "rgw_read failed for %s\n",
               object);