rbd: get rid of some version parameters
authorAlex Elder <elder@inktank.com>
Tue, 30 Apr 2013 05:44:33 +0000 (00:44 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:20:14 +0000 (21:20 -0700)
Several functions in rbd have parameters meant to allow the version
of an object to be passed in or out.  The purpose of those was to
allow the version of a header object to be maintained, but we no
longer do that.  As a result, these parameters are never actually
needed or used, so get rid of them.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c

index 8875bebbacfca13e46536c31c8c961da74ec19c7..77265710dd1ae5e96bb48499d1419cabe1f2e6f8 100644 (file)
@@ -2838,8 +2838,7 @@ static void rbd_free_disk(struct rbd_device *rbd_dev)
 
 static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
                                const char *object_name,
-                               u64 offset, u64 length,
-                               void *buf, u64 *version)
+                               u64 offset, u64 length, void *buf)
 
 {
        struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
@@ -2890,10 +2889,8 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
        rbd_assert(obj_request->xferred <= (u64) SIZE_MAX);
        size = (size_t) obj_request->xferred;
        ceph_copy_from_page_vector(pages, buf, 0, size);
-       rbd_assert(size <= (size_t) INT_MAX);
-       ret = (int) size;
-       if (version)
-               *version = obj_request->version;
+       rbd_assert(size <= (size_t)INT_MAX);
+       ret = (int)size;
 out:
        if (obj_request)
                rbd_obj_request_put(obj_request);
@@ -2914,7 +2911,7 @@ out:
  * Returns a pointer-coded errno if a failure occurs.
  */
 static struct rbd_image_header_ondisk *
-rbd_dev_v1_header_read(struct rbd_device *rbd_dev, u64 *version)
+rbd_dev_v1_header_read(struct rbd_device *rbd_dev)
 {
        struct rbd_image_header_ondisk *ondisk = NULL;
        u32 snap_count = 0;
@@ -2942,7 +2939,7 @@ rbd_dev_v1_header_read(struct rbd_device *rbd_dev, u64 *version)
                        return ERR_PTR(-ENOMEM);
 
                ret = rbd_obj_read_sync(rbd_dev, rbd_dev->header_name,
-                                      0, size, ondisk, version);
+                                      0, size, ondisk);
                if (ret < 0)
                        goto out_err;
                if ((size_t)ret < size) {
@@ -2977,10 +2974,9 @@ static int rbd_read_header(struct rbd_device *rbd_dev,
                           struct rbd_image_header *header)
 {
        struct rbd_image_header_ondisk *ondisk;
-       u64 ver = 0;
        int ret;
 
-       ondisk = rbd_dev_v1_header_read(rbd_dev, &ver);
+       ondisk = rbd_dev_v1_header_read(rbd_dev);
        if (IS_ERR(ondisk))
                return PTR_ERR(ondisk);
        ret = rbd_header_from_disk(header, ondisk);