mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
mds: Add inline switch
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com> Signed-off-by: Li Wang <liwang@ubuntukylin.com>
This commit is contained in:
parent
81c4f54e0a
commit
e3c4c4cd65
@ -166,6 +166,7 @@ void MDSMap::print(ostream& out)
|
||||
<< "stopped\t" << stopped << "\n";
|
||||
out << "data_pools\t" << data_pools << "\n";
|
||||
out << "metadata_pool\t" << metadata_pool << "\n";
|
||||
out << "inline_data\t" << (inline_data_enabled ? "enabled" : "disabled") << "\n";
|
||||
|
||||
multimap< pair<unsigned,unsigned>, uint64_t > foo;
|
||||
for (map<uint64_t,mds_info_t>::iterator p = mds_info.begin();
|
||||
@ -472,7 +473,7 @@ void MDSMap::encode(bufferlist& bl, uint64_t features) const
|
||||
::encode(cas_pool, bl);
|
||||
|
||||
// kclient ignores everything from here
|
||||
__u16 ev = 6;
|
||||
__u16 ev = 7;
|
||||
::encode(ev, bl);
|
||||
::encode(compat, bl);
|
||||
::encode(metadata_pool, bl);
|
||||
@ -487,6 +488,7 @@ void MDSMap::encode(bufferlist& bl, uint64_t features) const
|
||||
::encode(last_failure_osd_epoch, bl);
|
||||
::encode(ever_allowed_snaps, bl);
|
||||
::encode(explicitly_allowed_snaps, bl);
|
||||
::encode(inline_data_enabled, bl);
|
||||
ENCODE_FINISH(bl);
|
||||
}
|
||||
}
|
||||
@ -551,5 +553,7 @@ void MDSMap::decode(bufferlist::iterator& p)
|
||||
ever_allowed_snaps = true;
|
||||
explicitly_allowed_snaps = false;
|
||||
}
|
||||
if (ev >= 7)
|
||||
::decode(inline_data_enabled, p);
|
||||
DECODE_FINISH(p);
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ extern CompatSet get_mdsmap_compat_set_base(); // pre v0.20
|
||||
#define MDS_FEATURE_INCOMPAT_DIRINODE CompatSet::Feature(4, "dir inode in separate object")
|
||||
#define MDS_FEATURE_INCOMPAT_ENCODING CompatSet::Feature(5, "mds uses versioned encoding")
|
||||
#define MDS_FEATURE_INCOMPAT_OMAPDIRFRAG CompatSet::Feature(6, "dirfrag is stored in omap")
|
||||
#define MDS_FEATURE_INCOMPAT_INLINE CompatSet::Feature(7, "mds uses inline data")
|
||||
|
||||
class MDSMap {
|
||||
public:
|
||||
@ -179,6 +180,8 @@ protected:
|
||||
bool ever_allowed_snaps; //< the cluster has ever allowed snap creation
|
||||
bool explicitly_allowed_snaps; //< the user has explicitly enabled snap creation
|
||||
|
||||
bool inline_data_enabled;
|
||||
|
||||
public:
|
||||
CompatSet compat;
|
||||
|
||||
@ -194,9 +197,13 @@ public:
|
||||
metadata_pool(0),
|
||||
max_mds(0),
|
||||
ever_allowed_snaps(false),
|
||||
explicitly_allowed_snaps(false)
|
||||
explicitly_allowed_snaps(false),
|
||||
inline_data_enabled(false)
|
||||
{ }
|
||||
|
||||
bool get_inline_data_enabled() { return inline_data_enabled; }
|
||||
void set_inline_data_enabled(bool enabled) { inline_data_enabled = enabled; }
|
||||
|
||||
utime_t get_session_timeout() {
|
||||
return utime_t(session_timeout,0);
|
||||
}
|
||||
|
@ -975,6 +975,13 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
|
||||
r = 0;
|
||||
}
|
||||
|
||||
} else if (prefix == "mds inline enable") {
|
||||
pending_mdsmap.set_inline_data_enabled(true);
|
||||
pending_mdsmap.compat.incompat.insert(MDS_FEATURE_INCOMPAT_INLINE);
|
||||
r = 0;
|
||||
} else if (prefix == "mds inline disable") {
|
||||
pending_mdsmap.set_inline_data_enabled(false);
|
||||
r = 0;
|
||||
} else if (prefix == "mds set") {
|
||||
string key;
|
||||
cmd_getval(g_ceph_context, cmdmap, "key", key);
|
||||
|
@ -278,6 +278,12 @@ COMMAND("mds compat rm_compat " \
|
||||
COMMAND("mds compat rm_incompat " \
|
||||
"name=feature,type=CephInt,range=0", \
|
||||
"remove incompatible feature", "mds", "rw", "cli,rest")
|
||||
COMMAND("mds inline enable", \
|
||||
"enable inline data feature", \
|
||||
"mds", "rw", "cli,rest")
|
||||
COMMAND("mds inline disable", \
|
||||
"disable inline data feature", \
|
||||
"mds", "rw", "cli,rest")
|
||||
COMMAND("mds set " \
|
||||
"name=key,type=CephChoices,strings=allow_new_snaps " \
|
||||
"name=sure,type=CephString,req=false", \
|
||||
|
Loading…
Reference in New Issue
Block a user