]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
XfsFileStoreBackend: nuke redundant goto in set_extsize()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 5 Jun 2014 06:08:41 +0000 (10:08 +0400)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Fri, 6 Jun 2014 11:32:03 +0000 (15:32 +0400)
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
src/os/XfsFileStoreBackend.cc

index 7b632d8a622e13b8f3e1bd44a9de1042b7c0ea45..cfda1acfab8cdb3c9ec9e54b1de5c8708a7aa38f 100644 (file)
@@ -47,18 +47,17 @@ int XfsFileStoreBackend::set_extsize(int fd, unsigned int val)
   if (fstat(fd, &sb) < 0) {
     ret = -errno;
     dout(0) << "set_extsize: fstat: " << cpp_strerror(ret) << dendl;
-    goto out;
+    return ret;
   }
   if (!S_ISREG(sb.st_mode)) {
-    ret = -EINVAL;
     dout(0) << "set_extsize: invalid target file type" << dendl;
-    goto out;
+    return -EINVAL;
   }
 
   if (ioctl(fd, XFS_IOC_FSGETXATTR, &fsx) < 0) {
     ret = -errno;
     dout(0) << "set_extsize: FSGETXATTR: " << cpp_strerror(ret) << dendl;
-    goto out;
+    return ret;
   }
 
   fsx.fsx_xflags |= XFS_XFLAG_EXTSIZE;
@@ -67,12 +66,10 @@ int XfsFileStoreBackend::set_extsize(int fd, unsigned int val)
   if (ioctl(fd, XFS_IOC_FSSETXATTR, &fsx) < 0) {
     ret = -errno;
     dout(0) << "set_extsize: FSSETXATTR: " << cpp_strerror(ret) << dendl;
-    goto out;
+    return ret;
   }
-  ret = 0;
 
-out:
-  return ret;
+  return 0;
 }
 
 int XfsFileStoreBackend::detect_features()