From 56777b0863bcecf97fc30946dc5c2daf2c9f7dad Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Thu, 28 Feb 2013 16:12:20 +0100 Subject: [PATCH] cls_rbd.cc: remove another unused variable Remove 'new_snaps' since it only used for a sizeof() call, get the size directly from the data type of new_snaps instead. Signed-off-by: Danny Al-Gaaf --- src/cls/rbd/cls_rbd.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index 982c8a66798..0ac889f6795 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -1903,7 +1903,6 @@ int old_snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *o struct rbd_obj_header_ondisk *header; bufferlist newbl; bufferptr header_bp(sizeof(*header)); - struct rbd_obj_snap_ondisk *new_snaps; int rc = snap_read_header(hctx, bl); if (rc < 0) @@ -1912,7 +1911,7 @@ int old_snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *o header = (struct rbd_obj_header_ondisk *)bl.c_str(); int snaps_id_ofs = sizeof(*header); - int names_ofs = snaps_id_ofs + sizeof(*new_snaps) * header->snap_count; + int names_ofs = snaps_id_ofs + sizeof(struct rbd_obj_snap_ondisk) * header->snap_count; const char *snap_name; const char *snap_names = ((char *)header) + names_ofs; const char *orig_names = snap_names; @@ -1979,7 +1978,6 @@ int old_snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *o return rc; return 0; - } -- 2.47.3