]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: avoid trimming inodes on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Tue, 6 Sep 2022 14:53:14 +0000 (14:53 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 10 Nov 2022 07:38:13 +0000 (09:38 +0200)
On Windows, ino_t is defined as "unsigned short" (2B), which
isn't large enough to hold the Ceph inodes (uint64_t).

For this reason, we'll avoid using ino_t on Windows.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/client/Client.cc

index 6a29f534f2046490046442d63262e364ee451362..39e1f519c243d690d141c30c3439961765f35175 100644 (file)
@@ -8368,7 +8368,7 @@ void Client::fill_statx(Inode *in, unsigned int mask, struct ceph_statx *stx)
 
   /* 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_ino = use_faked_inos() ? in->faked_ino : (uint64_t)in->ino;
   stx->stx_rdev = in->rdev;
   stx->stx_mask |= (CEPH_STATX_INO|CEPH_STATX_RDEV);
 
@@ -14577,7 +14577,11 @@ out:
     ll_unclosed_fh_set.insert(*fhp);
   }
 
+  #ifdef _WIN32
+  uint64_t ino = 0;
+  #else
   ino_t ino = 0;
+  #endif
   if (r >= 0) {
     Inode *inode = in->get();
     if (use_faked_inos())