]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/chain_xattr.cc: reduce scope of some variables
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 22 Oct 2014 08:27:51 +0000 (10:27 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 26 Oct 2014 17:10:13 +0000 (18:10 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/os/chain_xattr.cc

index 5c80c573da7aa1aed9e6f81daf106580269928a9..c0e64ea32fc7be7855b1b5724776c69505bd7a81 100644 (file)
@@ -235,10 +235,9 @@ int chain_setxattr(const char *fn, const char *name, const void *val, size_t siz
   int i = 0, pos = 0;
   char raw_name[CHAIN_XATTR_MAX_NAME_LEN * 2 + 16];
   int ret = 0;
-  size_t chunk_size;
 
   do {
-    chunk_size = (size < CHAIN_XATTR_MAX_BLOCK_LEN ? size : CHAIN_XATTR_MAX_BLOCK_LEN);
+    size_t chunk_size = (size < CHAIN_XATTR_MAX_BLOCK_LEN ? size : CHAIN_XATTR_MAX_BLOCK_LEN);
     get_raw_xattr_name(name, i, raw_name, sizeof(raw_name));
     size -= chunk_size;
 
@@ -271,10 +270,9 @@ int chain_fsetxattr(int fd, const char *name, const void *val, size_t size)
   int i = 0, pos = 0;
   char raw_name[CHAIN_XATTR_MAX_NAME_LEN * 2 + 16];
   int ret = 0;
-  size_t chunk_size;
 
   do {
-    chunk_size = (size < CHAIN_XATTR_MAX_BLOCK_LEN ? size : CHAIN_XATTR_MAX_BLOCK_LEN);
+    size_t chunk_size = (size < CHAIN_XATTR_MAX_BLOCK_LEN ? size : CHAIN_XATTR_MAX_BLOCK_LEN);
     get_raw_xattr_name(name, i, raw_name, sizeof(raw_name));
     size -= chunk_size;