From 94e310e945ffeccc3beebcda2dbb119bc6ba5f74 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 12 Oct 2016 07:04:41 -0400 Subject: [PATCH] client: small cleanup in fill_statx() Make the setting of stx_ino more compact, and add comment explaining why we set the type bits there. Signed-off-by: Jeff Layton --- src/client/Client.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index e11325356330f..4b06c54071013 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6842,12 +6842,10 @@ void Client::fill_statx(Inode *in, unsigned int mask, struct ceph_statx *stx) /* These are always considered to be available */ stx->stx_dev = in->snapid; stx->stx_blksize = MAX(in->layout.stripe_unit, 4096); - stx->stx_mode = S_IFMT & in->mode; - if (use_faked_inos()) - stx->stx_ino = in->faked_ino; - else - stx->stx_ino = in->ino; + /* Type bits are always set, even when CEPH_STATX_MODE is not */ + stx->stx_mode = S_IFMT & in->mode; + stx->stx_ino = use_faked_inos() ? in->faked_ino : (ino_t)in->ino; stx->stx_rdev = in->rdev; stx->stx_mask |= (CEPH_STATX_INO|CEPH_STATX_RDEV); -- 2.39.5