From: Jeff Layton Date: Wed, 12 Oct 2016 11:04:41 +0000 (-0400) Subject: client: small cleanup in fill_statx() X-Git-Tag: v11.1.0~625^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94e310e945ffeccc3beebcda2dbb119bc6ba5f74;p=ceph.git 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index e11325356330..4b06c5407101 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);