From f1f16a9ec30a05d04341437bc671ca3f120955c1 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 18 Mar 2025 09:07:45 +0000 Subject: [PATCH] Revert "mds: Store remote inode number in referent inode" This reverts commit 3c034df67942085854f0a5a7b123282c7d9b2e8a. Signed-off-by: Venky Shankar (cherry picked from commit 3a6a1caec2d10b1a9a9e264d0a2e56f47b3a0a83) --- src/include/cephfs/types.h | 13 ++----------- src/mds/CDentry.cc | 2 -- src/mds/CInode.h | 5 ----- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/include/cephfs/types.h b/src/include/cephfs/types.h index 43454f6dd4559..7aa3ff2d1cc29 100644 --- a/src/include/cephfs/types.h +++ b/src/include/cephfs/types.h @@ -945,8 +945,6 @@ struct inode_t { optmetadata_multiton optmetadata; - inodeno_t remote_ino = 0; // referent inode - remote inode link - private: bool older_is_consistent(const inode_t &other) const; }; @@ -955,7 +953,7 @@ private: template class Allocator> void inode_t::encode(ceph::buffer::list &bl, uint64_t features) const { - ENCODE_START(21, 6, bl); + ENCODE_START(20, 6, bl); encode(ino, bl); encode(rdev, bl); @@ -1017,7 +1015,6 @@ void inode_t::encode(ceph::buffer::list &bl, uint64_t features) const encode(optmetadata, bl, features); - encode(remote_ino, bl); ENCODE_FINISH(bl); } @@ -1140,9 +1137,6 @@ void inode_t::decode(ceph::buffer::list::const_iterator &p) decode(optmetadata, p); } - if (struct_v >= 21) { - decode(remote_ino, p); - } DECODE_FINISH(p); } @@ -1223,7 +1217,6 @@ void inode_t::dump(ceph::Formatter *f) const f->dump_stream("last_scrub_stamp") << last_scrub_stamp; f->dump_unsigned("last_scrub_version", last_scrub_version); - f->dump_unsigned("remote_ino", remote_ino); } template class Allocator> @@ -1283,7 +1276,6 @@ void inode_t::decode_json(JSONObj *obj) JSONDecoder::decode_json("quota", quota, obj, true); JSONDecoder::decode_json("last_scrub_stamp", last_scrub_stamp, obj, true); JSONDecoder::decode_json("last_scrub_version", last_scrub_version, obj, true); - JSONDecoder::decode_json("remote_ino", remote_ino.val, obj, true); } template class Allocator> @@ -1329,8 +1321,7 @@ int inode_t::compare(const inode_t &other, bool *divergent !(accounted_rstat == other.accounted_rstat) || file_data_version != other.file_data_version || xattr_version != other.xattr_version || - backtrace_version != other.backtrace_version || - remote_ino != other.remote_ino) { + backtrace_version != other.backtrace_version) { *divergent = true; } return 0; diff --git a/src/mds/CDentry.cc b/src/mds/CDentry.cc index 2165535a0a3c9..7fdb4d4a67dbf 100644 --- a/src/mds/CDentry.cc +++ b/src/mds/CDentry.cc @@ -310,7 +310,6 @@ void CDentry::link_remote(CDentry::linkage_t *dnl, CInode *remote_in, CInode *re dnl->inode = remote_in; if (referent_in) { - ceph_assert(referent_in->get_remote_ino() == dnl->get_remote_ino()); dnl->referent_inode = referent_in; dnl->referent_ino = referent_in->ino(); } @@ -353,7 +352,6 @@ void CDentry::push_projected_linkage(CInode *referent_inode, inodeno_t remote_in linkage_t *p = _project_linkage(); p->referent_inode = referent_inode; referent_inode->push_projected_parent(this); - referent_inode->set_remote_ino(remote_ino); p->referent_ino = referent_ino; p->remote_ino = remote_ino; diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 90c55883f6495..730d596bc2b48 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -649,10 +649,8 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counterino; } - inodeno_t get_remote_ino() const { return get_inode()->remote_ino; } vinodeno_t vino() const { return vinodeno_t(ino(), last); } int d_type() const { return IFTODT(get_inode()->mode); } - bool is_referent_remote() const { return get_remote_ino() != 0; } bool is_root() const { return ino() == CEPH_INO_ROOT; } bool is_stray() const { return MDS_INO_IS_STRAY(ino()); } mds_rank_t get_stray_owner() const { @@ -671,9 +669,6 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counterremote_ino = ino; } - // note: this overloads MDSCacheObject bool is_ambiguous_auth() const { return state_test(STATE_AMBIGUOUSAUTH) || -- 2.39.5