]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: disable inode emulation on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 22 Feb 2021 11:24:56 +0000 (11:24 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 12 Mar 2021 14:39:48 +0000 (14:39 +0000)
cephfs will use fake inodes when sizeof(ino_t) < 8. On Windows,
ino_t is defined as unsigned short (2B), which isn't enough.

On the other hand, most "native" Windows structures, including the
Dokan ones, are using 64b identifiers.

That being considered, we'll disable inode emulation on Windows.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 618a3401682c6e0c4e78821b90226cde9020e769)

src/client/Client.cc

index 0695ea2400fffd2cee84aab84584056ef7ff3dc3..8a6aab1c7d778e6adc0d9d04b54a18f5907dae55 100644 (file)
@@ -209,7 +209,13 @@ void Client::_reset_faked_inos()
   free_faked_inos.insert(start, (uint32_t)-1 - start + 1);
   last_used_faked_ino = 0;
   last_used_faked_root = 0;
+  #ifdef _WIN32
+  // On Windows, sizeof(ino_t) is just 2. Despite that, most "native"
+  // Windows structures, including Dokan ones, are using 64B identifiers.
+  _use_faked_inos = false;
+  #else
   _use_faked_inos = sizeof(ino_t) < 8 || cct->_conf->client_use_faked_inos;
+  #endif
 }
 
 void Client::_assign_faked_ino(Inode *in)