* New bluestore_rocksdb_options_annex config parameter. Complements
bluestore_rocksdb_options and allows setting rocksdb options without repeating
the existing defaults.
+* The cephfs addes two new CDentry tags, 'I' --> 'i' and 'L' --> 'l', and
+ on-RADOS metadata is no longer backwards compatible after upgraded to Pacific
+ or a later release.
+
* $pid expansion in config paths like `admin_socket` will now properly expand
to the daemon pid for commands like `ceph-mds` or `ceph-osd`. Previously only
`ceph-fuse`/`rbd-nbd` expanded `$pid` with the actual daemon pid.
else
dn = lookup(dname, last);
- if (type == 'L') {
+ if (type == 'L' || type == 'l') {
// hard link
inodeno_t ino;
unsigned char d_type;
- decode(ino, q);
- decode(d_type, q);
+
+ if (type == 'l') {
+ DECODE_START(1, q);
+ decode(ino, q);
+ decode(d_type, q);
+ DECODE_FINISH(q);
+ } else {
+ decode(ino, q);
+ decode(d_type, q);
+ }
if (stale) {
if (!dn) {
}
}
}
- else if (type == 'I') {
+ else if (type == 'I' || type == 'i') {
+ InodeStore inode_data;
// inode
-
// Load inode data before looking up or constructing CInode
- InodeStore inode_data;
- inode_data.decode_bare(q);
+ if (type == 'i') {
+ DECODE_START(1, q);
+ inode_data.decode(q);
+ DECODE_FINISH(q);
+ } else {
+ inode_data.decode_bare(q);
+ }
if (stale) {
if (!dn) {
mempool::mds_co::compact_set<mempool::mds_co::string> stale_items;
};
+// This is doing the same thing with the InodeStoreBase::encode()
+void CDir::_encode_primary_inode_base(dentry_commit_item &item, bufferlist &dfts,
+ bufferlist &bl)
+{
+ ENCODE_START(6, 4, bl);
+ encode(*item.inode, bl, item.features);
+
+ if (!item.symlink.empty())
+ encode(item.symlink, bl);
+
+ // dirfragtree
+ dfts.splice(0, item.dft_len, &bl);
+
+ if (item.xattrs)
+ encode(*item.xattrs, bl);
+ else
+ encode((__u32)0, bl);
+
+ if (item.snaprealm) {
+ bufferlist snapr_bl;
+ encode(item.srnode, snapr_bl);
+ encode(snapr_bl, bl);
+ } else {
+ encode(bufferlist(), bl);
+ }
+
+ if (item.old_inodes)
+ encode(*item.old_inodes, bl, item.features);
+ else
+ encode((__u32)0, bl);
+
+ encode(item.oldest_snap, bl);
+ encode(item.damage_flags, bl);
+ ENCODE_FINISH(bl);
+}
+
// This is not locked by mds_lock
void CDir::_omap_commit_ops(int r, int op_prio, int64_t metapool, version_t version, bool _new,
vector<dentry_commit_item> &to_set, bufferlist &dfts,
for (auto &item : to_set) {
encode(item.first, bl);
if (item.is_remote) {
- bl.append('L'); // remote link
+ // marker, name, ino
+ bl.append('l'); // remote link
+ ENCODE_START(1, 1, bl);
encode(item.ino, bl);
encode(item.d_type, bl);
+ ENCODE_FINISH(bl);
} else {
- bl.append('I'); // inode
-
- encode(*item.inode, bl, item.features);
-
- if (!item.symlink.empty())
- encode(item.symlink, bl);
-
- // dirfragtree
- dfts.splice(0, item.dft_len, &bl);
-
- if (item.xattrs)
- encode(*item.xattrs, bl);
- else
- encode((__u32)0, bl);
-
- if (item.snaprealm) {
- bufferlist snapr_bl;
- encode(item.srnode, snapr_bl);
- encode(snapr_bl, bl);
- } else {
- encode(bufferlist(), bl);
- }
-
- if (item.old_inodes)
- encode(*item.old_inodes, bl, item.features);
- else
- encode((__u32)0, bl);
+ // marker, name, inode, [symlink string]
+ bl.append('i'); // inode
- encode(item.oldest_snap, bl);
- encode(item.damage_flags, bl);
+ ENCODE_START(1, 1, bl);
+ _encode_primary_inode_base(item, dfts, bl);
+ ENCODE_FINISH(bl);
}
off += item.dft_len;
ceph_assert(in);
dout(14) << " dn '" << dn->get_name() << "' inode " << *in << dendl;
- // marker, name, inode, [symlink string]
if (in->is_multiversion()) {
if (!in->snaprealm) {
vector<dentry_commit_item> &to_set, bufferlist &dfts,
vector<string> &to_remove,
mempool::mds_co::compact_set<mempool::mds_co::string> &_stale);
+ void _encode_primary_inode_base(dentry_commit_item &item, bufferlist &dfts,
+ bufferlist &bl);
void _omap_commit(int op_prio);
void _parse_dentry(CDentry *dn, dentry_commit_item &item,
const set<snapid_t> *snaps, bufferlist &bl);
if (dn->get_linkage()->is_remote()) {
// remote link
- exportbl.append("L", 1); // 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);
continue;
}
// primary link
// -- inode
- exportbl.append("I", 1); // inode dentry
-
+ exportbl.append("i", 1); // inode dentry
+
+ ENCODE_START(1, 1, exportbl);
encode_export_inode(in, exportbl, exported_client_map, exported_client_metadata_map); // encode, and (update state for) export
+ ENCODE_FINISH(exportbl);
// directory?
auto&& dfs = in->get_dirfrags();
// fall thru
}
- else if (icode == 'L') {
+ else if (icode == 'L' || icode == 'l') {
// remote link
inodeno_t ino;
unsigned char d_type;
- decode(ino, blp);
- decode(d_type, blp);
+ 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);
+ }
if (dn->get_linkage()->is_remote()) {
ceph_assert(dn->get_linkage()->get_remote_ino() == ino);
} else {
dir->link_remote_inode(dn, ino, d_type);
}
}
- else if (icode == 'I') {
+ else if (icode == 'I' || icode == 'i') {
// inode
ceph_assert(le);
- decode_import_inode(dn, blp, oldauth, ls,
- peer_exports, updated_scatterlocks);
+ if (icode == 'i') {
+ DECODE_START(1, blp);
+ decode_import_inode(dn, blp, oldauth, ls,
+ peer_exports, updated_scatterlocks);
+ DECODE_FINISH(blp);
+ } else {
+ decode_import_inode(dn, blp, oldauth, ls,
+ peer_exports, updated_scatterlocks);
+ }
}
// add dentry to journal entry
}
char dentry_type;
decode(dentry_type, q);
- if (dentry_type == 'I') {
+ if (dentry_type == 'I' || dentry_type == 'i') {
InodeStore inode;
- inode.decode_bare(q);
+ if (dentry_type == 'i') {
+ DECODE_START(1, q);
+ inode.decode(q);
+ DECODE_FINISH(q);
+ } else {
+ inode.decode_bare(q);
+ }
+
inodeno_t ino = inode.inode->ino;
if (step == SCAN_INOS) {
if (dnfirst == CEPH_NOSNAP)
injected_inos[ino] = link_info_t(dir_ino, frag_id, dname, inode.inode);
}
- } else if (dentry_type == 'L') {
+ } else if (dentry_type == 'L' || dentry_type == 'l') {
inodeno_t ino;
unsigned char d_type;
- decode(ino, q);
- decode(d_type, q);
+ if (dentry_type == 'l') {
+ DECODE_START(1, q);
+ decode(ino, q);
+ decode(d_type, q);
+ DECODE_FINISH(q);
+ } else {
+ decode(ino, q);
+ decode(d_type, q);
+ }
if (step == SCAN_INOS) {
remote_links[ino]++;
decode(first, q);
char dentry_type;
decode(dentry_type, q);
- if (dentry_type == 'I') {
- inode->decode_bare(q);
+ if (dentry_type == 'I' || dentry_type == 'i') {
+ if (dentry_type == 'i') {
+ DECODE_START(1, q);
+ inode->decode(q);
+ DECODE_FINISH(q);
+ } else {
+ inode->decode_bare(q);
+ }
} else {
dout(20) << "dentry type '" << dentry_type << "': cannot"
"read an inode out of that" << dendl;
char dentry_type;
decode(dentry_type, q);
- if (dentry_type == 'L') {
+ if (dentry_type == 'L' || dentry_type == 'l') {
// leave write_dentry false, we have no version to
// compare with in a hardlink, so it's not safe to
// squash over it with what's in this fullbit
<< "' with lump fnode version " << lump.fnode->version
<< "vs existing fnode version " << old_fnode_version << dendl;
write_dentry = old_fnode_version < lump.fnode->version;
- } else if (dentry_type == 'I') {
+ } else if (dentry_type == 'I' || dentry_type == 'i') {
// Read out inode version to compare with backing store
InodeStore inode;
- inode.decode_bare(q);
+ if (dentry_type == 'i') {
+ DECODE_START(1, q);
+ inode.decode(q);
+ DECODE_FINISH(q);
+ } else {
+ inode.decode_bare(q);
+ }
dout(4) << "decoded embedded inode version "
<< inode.inode->version << " vs fullbit version "
<< fb.inode->version << dendl;
char dentry_type;
decode(dentry_type, q);
- if (dentry_type == 'L') {
+ if (dentry_type == 'L' || dentry_type == 'l') {
dout(10) << "Existing hardlink inode in slot to be (maybe) written "
<< "by a remote inode from the journal dn '" << rb.dn.c_str()
<< "' with lump fnode version " << lump.fnode->version
<< "vs existing fnode version " << old_fnode_version << dendl;
write_dentry = old_fnode_version < lump.fnode->version;
- } else if (dentry_type == 'I') {
+ } else if (dentry_type == 'I' || dentry_type == 'i') {
dout(10) << "Existing full inode in slot to be (maybe) written "
<< "by a remote inode from the journal dn '" << rb.dn.c_str()
<< "' with lump fnode version " << lump.fnode->version
decode(dentry_type, q);
bool remove_dentry = false;
- if (dentry_type == 'L') {
+ if (dentry_type == 'L' || dentry_type == 'l') {
dout(10) << "Existing hardlink inode in slot to be (maybe) removed "
<< "by null journal dn '" << nb.dn.c_str()
<< "' with lump fnode version " << lump.fnode->version
<< "vs existing fnode version " << old_fnode_version << dendl;
remove_dentry = old_fnode_version < lump.fnode->version;
- } else if (dentry_type == 'I') {
+ } else if (dentry_type == 'I' || dentry_type == 'i') {
dout(10) << "Existing full inode in slot to be (maybe) removed "
<< "by null journal dn '" << nb.dn.c_str()
<< "' with lump fnode version " << lump.fnode->version
// dn = lookup_exact_snap(dname, last);
//else
// dn = lookup(dname, last);
- if (type == 'L') {
+ if (type == 'L' || type == 'l') {
// hard link
inodeno_t ino;
unsigned char d_type;
- ::decode(ino, q);
- ::decode(d_type, q);
+ if (type == 'l') {
+ DECODE_START(1, q);
+ ::decode(ino, q);
+ ::decode(d_type, q);
+ DECODE_FINISH(q);
+ } else {
+ ::decode(ino, q);
+ ::decode(d_type, q);
+ }
+
if (sp_ino > 0) {
if (sp_ino == ino) {
std::cout << "find hard link : " << ino << "," << d_type << std::endl;
}
std::cout << "hard link : " << ino << "," << d_type << std::endl;
- } else if (type == 'I') {
+ } else if (type == 'I' || type == 'i') {
// inode
// load inode data before lookuping up or constructing CInode
InodeStore& inode_data = *(new InodeStore);
- inode_data.decode_bare(q);
+ if (type == 'i') {
+ DECODE_START(1, q);
+ inode_data.decode(q);
+ DECODE_FINISH(q);
+ } else {
+ inode_data.decode_bare(q);
+ }
std::stringstream ds;
std::string format = "json";