]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd_fuse/rbd-fuse.c: reduce scope of some variables in open_rbd_image()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 15 May 2013 12:15:23 +0000 (14:15 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 16 May 2013 12:20:09 +0000 (14:20 +0200)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rbd_fuse/rbd-fuse.c

index 2baa9dbf48a1a51e06b4144f06e923229685e294..5a4bfe2702ce78a2c94ee6a7a02c453f9752d978 100644 (file)
@@ -130,8 +130,7 @@ open_rbd_image(const char *image_name)
 {
        struct rbd_image *im;
        struct rbd_openimage *rbd;
-       int fd, i;
-       int ret;
+       int fd;
 
        if (image_name == (char *)NULL) 
                return -1;
@@ -149,6 +148,7 @@ open_rbd_image(const char *image_name)
        if ((fd = find_openrbd(image_name)) != -1) {
                rbd = &opentbl[fd];
        } else {
+               int i;
                // allocate an opentbl[] and open the image
                for (i = 0; i < MAX_RBD_IMAGES; i++) {
                        if (opentbl[i].image == NULL) {
@@ -160,7 +160,7 @@ open_rbd_image(const char *image_name)
                }
                if (i == MAX_RBD_IMAGES)
                        return -1;
-               ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
+               int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
                if (ret < 0) {
                        simple_err("open_rbd_image: can't open: ", ret);
                        return ret;