]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: small cleanup in fill_statx()
authorJeff Layton <jlayton@redhat.com>
Wed, 12 Oct 2016 11:04:41 +0000 (07:04 -0400)
committerJeff Layton <jlayton@redhat.com>
Wed, 12 Oct 2016 11:04:41 +0000 (07:04 -0400)
Make the setting of stx_ino more compact, and add comment explaining
why we set the type bits there.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc

index e11325356330f24c7805add92e085a260765b979..4b06c5407101399970d264b651c22c6749c4d89a 100644 (file)
@@ -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);