From: Danny Al-Gaaf Date: Wed, 15 May 2013 12:15:23 +0000 (+0200) Subject: rbd_fuse/rbd-fuse.c: reduce scope of some variables in open_rbd_image() X-Git-Tag: v0.64~119^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9fe22b33c0a677499c6a1fc40ac03df9e58dcb7;p=ceph.git rbd_fuse/rbd-fuse.c: reduce scope of some variables in open_rbd_image() Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rbd_fuse/rbd-fuse.c b/src/rbd_fuse/rbd-fuse.c index 2baa9dbf48a1..5a4bfe2702ce 100644 --- a/src/rbd_fuse/rbd-fuse.c +++ b/src/rbd_fuse/rbd-fuse.c @@ -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;