diff options
author | Xiubo Li <xiubli@redhat.com> | 2020-11-20 03:02:42 +0100 |
---|---|---|
committer | Patrick Donnelly <pdonnell@redhat.com> | 2021-01-16 02:30:39 +0100 |
commit | bd0b90ffbfe528c0f85100837ca1e7ab56e10b82 (patch) | |
tree | 75143eb848bae68abf53d3a0e76f8012e023ce69 /src/mds/Migrator.cc | |
parent | mds: add "fscrypt" flag support for inode_t (diff) | |
download | ceph-bd0b90ffbfe528c0f85100837ca1e7ab56e10b82.tar.xz ceph-bd0b90ffbfe528c0f85100837ca1e7ab56e10b82.zip |
mds: add static encode/decode helpers for remote in CDentry
This will unify all the same work in different places.
Fixes: https://tracker.ceph.com/issues/47162
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Diffstat (limited to 'src/mds/Migrator.cc')
-rw-r--r-- | src/mds/Migrator.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index f2c2d33fecc..36a8dc0712f 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -1791,15 +1791,9 @@ void Migrator::encode_export_dir(bufferlist& exportbl, } if (dn->get_linkage()->is_remote()) { - // remote link - exportbl.append("l", 1); // remote link - inodeno_t ino = dn->get_linkage()->get_remote_ino(); unsigned char d_type = dn->get_linkage()->get_remote_d_type(); - ENCODE_START(1, 1, exportbl); - encode(ino, exportbl); - encode(d_type, exportbl); - ENCODE_FINISH(exportbl); + CDentry::encode_remote(ino, d_type, exportbl); // remote link continue; } @@ -3451,15 +3445,7 @@ void Migrator::decode_import_dir(bufferlist::const_iterator& blp, // remote link inodeno_t ino; unsigned char d_type; - if (icode == 'l') { - DECODE_START(1, blp); - decode(ino, blp); - decode(d_type, blp); - DECODE_FINISH(blp); - } else { - decode(ino, blp); - decode(d_type, blp); - } + CDentry::decode_remote(icode, ino, d_type, blp); if (dn->get_linkage()->is_remote()) { ceph_assert(dn->get_linkage()->get_remote_ino() == ino); } else { |