From: Lucian Petrut Date: Mon, 22 Feb 2021 11:24:56 +0000 (+0000) Subject: cephfs: disable inode emulation on Windows X-Git-Tag: v17.1.0~2718^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=618a3401682c6e0c4e78821b90226cde9020e769;p=ceph.git cephfs: disable inode emulation on Windows 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index d614a53a2612..4b5aec4b3efb 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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)