From c31f1c232a6673c4e3fc3188e15ae0e708a54613 Mon Sep 17 00:00:00 2001 From: ShyamsundarR Date: Wed, 21 Nov 2018 09:43:23 -0500 Subject: gfapi: new api glfs_statx as linux's statx Change-Id: I44dd6ceef0954ae7fc13f920e84d81bbd3f6a774 Updates: #389 Signed-off-by: Kinglong Mee Signed-off-by: ShyamsundarR --- libglusterfs/src/glusterfs/iatt.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/glusterfs/iatt.h b/libglusterfs/src/glusterfs/iatt.h index 339c84ccc45..bee7a0afa77 100644 --- a/libglusterfs/src/glusterfs/iatt.h +++ b/libglusterfs/src/glusterfs/iatt.h @@ -264,12 +264,10 @@ st_mode_prot_from_ia(ia_prot_t prot) return prot_bit; } -static inline mode_t -st_mode_from_ia(ia_prot_t prot, ia_type_t type) +static inline uint32_t +st_mode_type_from_ia(ia_type_t type) { - mode_t st_mode = 0; uint32_t type_bit = 0; - uint32_t prot_bit = 0; switch (type) { case IA_IFREG: @@ -297,6 +295,17 @@ st_mode_from_ia(ia_prot_t prot, ia_type_t type) break; } + return type_bit; +} + +static inline mode_t +st_mode_from_ia(ia_prot_t prot, ia_type_t type) +{ + mode_t st_mode = 0; + uint32_t type_bit = 0; + uint32_t prot_bit = 0; + + type_bit = st_mode_type_from_ia(type); prot_bit = st_mode_prot_from_ia(prot); st_mode = (type_bit | prot_bit); -- cgit