From 73b9ede7e115fab245b0f59d18e4d6cc4d297cec Mon Sep 17 00:00:00 2001 From: Zhou Zhengping Date: Sat, 16 Jul 2016 21:43:58 -0400 Subject: core: add a basis function to reduce verbose code Change-Id: Icebe1b865edb317685e93f3ef11d98fd9b2c2e9a BUG: 1357226 Signed-off-by: Zhou Zhengping Reviewed-on: http://review.gluster.org/14936 Reviewed-by: Niels de Vos Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/storage/posix/src/posix-helpers.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index d6209521206..8ad674e063f 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -527,20 +527,12 @@ posix_fill_gfid_fd (xlator_t *this, int fd, struct iatt *iatt) void posix_fill_ino_from_gfid (xlator_t *this, struct iatt *buf) { - uint64_t temp_ino = 0; - int j = 0; - int i = 0; - /* consider least significant 8 bytes of value out of gfid */ if (gf_uuid_is_null (buf->ia_gfid)) { buf->ia_ino = -1; goto out; } - for (i = 15; i > (15 - 8); i--) { - temp_ino += (uint64_t)(buf->ia_gfid[i]) << j; - j += 8; - } - buf->ia_ino = temp_ino; + buf->ia_ino = gfid_to_ino (buf->ia_gfid); out: return; } -- cgit