From f4f652d55d3c5c9b2407eca448cca583482f3555 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 22 Oct 2014 10:27:51 +0200 Subject: [PATCH] os/chain_xattr.cc: reduce scope of some variables Signed-off-by: Danny Al-Gaaf --- src/os/chain_xattr.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/os/chain_xattr.cc b/src/os/chain_xattr.cc index 5c80c573da7aa..c0e64ea32fc7b 100644 --- a/src/os/chain_xattr.cc +++ b/src/os/chain_xattr.cc @@ -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; -- 2.39.5