void CDentry::decode_replica(bufferlist::iterator& p, bool is_new)
{
__u32 nonce;
- ::decode(nonce, p);
+ decode(nonce, p);
replica_nonce = nonce;
- ::decode(first, p);
+ decode(first, p);
inodeno_t rino;
unsigned char rdtype;
- ::decode(rino, p);
- ::decode(rdtype, p);
+ decode(rino, p);
+ decode(rdtype, p);
lock.decode_state(p, is_new);
bool need_recover;
- ::decode(need_recover, p);
+ decode(need_recover, p);
if (is_new) {
if (rino)
void CDentry::encode_lock_state(int type, bufferlist& bl)
{
- ::encode(first, bl);
+ encode(first, bl);
// null, ino, or remote_ino?
char c;
if (linkage.is_primary()) {
c = 1;
- ::encode(c, bl);
- ::encode(linkage.get_inode()->inode.ino, bl);
+ encode(c, bl);
+ encode(linkage.get_inode()->inode.ino, bl);
}
else if (linkage.is_remote()) {
c = 2;
- ::encode(c, bl);
- ::encode(linkage.get_remote_ino(), bl);
+ encode(c, bl);
+ encode(linkage.get_remote_ino(), bl);
}
else if (linkage.is_null()) {
// encode nothing.
bufferlist::iterator p = bl.begin();
snapid_t newfirst;
- ::decode(newfirst, p);
+ decode(newfirst, p);
if (!is_auth() && newfirst != first) {
dout(10) << __func__ << " first " << first << " -> " << newfirst << dendl;
char c;
inodeno_t ino;
- ::decode(c, p);
+ decode(c, p);
switch (c) {
case 1:
case 2:
- ::decode(ino, p);
+ decode(ino, p);
// newly linked?
if (linkage.is_null() && !is_auth()) {
// force trim from cache!
lock.replicate_relax();
__u32 nonce = add_replica(mds);
- ::encode(nonce, bl);
- ::encode(first, bl);
- ::encode(linkage.remote_ino, bl);
- ::encode(linkage.remote_d_type, bl);
+ encode(nonce, bl);
+ encode(first, bl);
+ encode(linkage.remote_ino, bl);
+ encode(linkage.remote_d_type, bl);
lock.encode_state_for_replica(bl);
- ::encode(need_recover, bl);
+ encode(need_recover, bl);
}
void decode_replica(bufferlist::iterator& p, bool is_new);
// note: this assumes the dentry already exists.
// i.e., the name is already extracted... so we just need the other state.
void encode_export(bufferlist& bl) {
- ::encode(first, bl);
- ::encode(state, bl);
- ::encode(version, bl);
- ::encode(projected_version, bl);
- ::encode(lock, bl);
- ::encode(get_replicas(), bl);
+ encode(first, bl);
+ encode(state, bl);
+ encode(version, bl);
+ encode(projected_version, bl);
+ encode(lock, bl);
+ encode(get_replicas(), bl);
get(PIN_TEMPEXPORTING);
}
void finish_export() {
put(PIN_TEMPEXPORTING);
}
void decode_import(bufferlist::iterator& blp, LogSegment *ls) {
- ::decode(first, blp);
+ decode(first, blp);
__u32 nstate;
- ::decode(nstate, blp);
- ::decode(version, blp);
- ::decode(projected_version, blp);
- ::decode(lock, blp);
- ::decode(get_replicas(), blp);
+ decode(nstate, blp);
+ decode(version, blp);
+ decode(projected_version, blp);
+ decode(lock, blp);
+ decode(get_replicas(), blp);
// twiddle
state &= MASK_STATE_IMPORT_KEPT;
bufferlist::iterator q = bl.begin();
snapid_t first;
- ::decode(first, q);
+ decode(first, q);
// marker
char type;
- ::decode(type, q);
+ decode(type, q);
dout(20) << "_fetched pos " << pos << " marker '" << type << "' dname '" << dname
<< " [" << first << "," << last << "]"
// hard link
inodeno_t ino;
unsigned char d_type;
- ::decode(ino, q);
- ::decode(d_type, q);
+ decode(ino, q);
+ decode(d_type, q);
if (stale) {
if (!dn) {
{
bufferlist::iterator p = hdrbl.begin();
try {
- ::decode(got_fnode, p);
+ decode(got_fnode, p);
} catch (const buffer::error &err) {
derr << "Corrupt fnode in dirfrag " << dirfrag()
<< ": " << err << dendl;
* off last, we cannot get our header into an incorrect state.
*/
bufferlist header;
- ::encode(fnode, header);
+ encode(fnode, header);
op.omap_set_header(header);
if (!to_set.empty())
// clear dentry NEW flag, if any. we can no longer silently drop it.
dn->clear_new();
- ::encode(dn->first, bl);
+ encode(dn->first, bl);
// primary or remote?
if (dn->linkage.is_remote()) {
// marker, name, ino
bl.append('L'); // remote link
- ::encode(ino, bl);
- ::encode(d_type, bl);
+ encode(ino, bl);
+ encode(d_type, bl);
} else if (dn->linkage.is_primary()) {
// primary link
CInode *in = dn->linkage.get_inode();
void CDir::encode_export(bufferlist& bl)
{
assert(!is_projected());
- ::encode(first, bl);
- ::encode(fnode, bl);
- ::encode(dirty_old_rstat, bl);
- ::encode(committed_version, bl);
+ encode(first, bl);
+ encode(fnode, bl);
+ encode(dirty_old_rstat, bl);
+ encode(committed_version, bl);
- ::encode(state, bl);
- ::encode(dir_rep, bl);
+ encode(state, bl);
+ encode(dir_rep, bl);
- ::encode(pop_me, bl);
- ::encode(pop_auth_subtree, bl);
+ encode(pop_me, bl);
+ encode(pop_auth_subtree, bl);
- ::encode(dir_rep_by, bl);
- ::encode(get_replicas(), bl);
+ encode(dir_rep_by, bl);
+ encode(get_replicas(), bl);
get(PIN_TEMPEXPORTING);
}
void CDir::decode_import(bufferlist::iterator& blp, utime_t now, LogSegment *ls)
{
- ::decode(first, blp);
- ::decode(fnode, blp);
- ::decode(dirty_old_rstat, blp);
+ decode(first, blp);
+ decode(fnode, blp);
+ decode(dirty_old_rstat, blp);
projected_version = fnode.version;
- ::decode(committed_version, blp);
+ decode(committed_version, blp);
committing_version = committed_version;
unsigned s;
- ::decode(s, blp);
+ decode(s, blp);
state &= MASK_STATE_IMPORT_KEPT;
state_set(STATE_AUTH | (s & MASK_STATE_EXPORTED));
_mark_dirty(ls);
}
- ::decode(dir_rep, blp);
+ decode(dir_rep, blp);
- ::decode(pop_me, now, blp);
- ::decode(pop_auth_subtree, now, blp);
+ decode(pop_me, now, blp);
+ decode(pop_auth_subtree, now, blp);
pop_auth_subtree_nested.add(now, cache->decayrate, pop_auth_subtree);
- ::decode(dir_rep_by, blp);
- ::decode(get_replicas(), blp);
+ decode(dir_rep_by, blp);
+ decode(get_replicas(), blp);
if (is_replicated()) get(PIN_REPLICATED);
replica_nonce = 0; // no longer defined
if (is_auth())
get_dist_spec(dist, whoami);
- ::encode(frag, bl);
- ::encode(auth, bl);
- ::encode(dist, bl);
+ encode(frag, bl);
+ encode(auth, bl);
+ encode(dist, bl);
}
void _encode_base(bufferlist& bl) {
- ::encode(first, bl);
- ::encode(fnode, bl);
- ::encode(dir_rep, bl);
- ::encode(dir_rep_by, bl);
+ encode(first, bl);
+ encode(fnode, bl);
+ encode(dir_rep, bl);
+ encode(dir_rep_by, bl);
}
void _decode_base(bufferlist::iterator& p) {
- ::decode(first, p);
- ::decode(fnode, p);
- ::decode(dir_rep, p);
- ::decode(dir_rep_by, p);
+ decode(first, p);
+ decode(fnode, p);
+ decode(dir_rep, p);
+ decode(dir_rep_by, p);
}
void encode_replica(mds_rank_t who, bufferlist& bl) {
__u32 nonce = add_replica(who);
- ::encode(nonce, bl);
+ encode(nonce, bl);
_encode_base(bl);
}
void decode_replica(bufferlist::iterator& p) {
__u32 nonce;
- ::decode(nonce, p);
+ decode(nonce, p);
replica_nonce = nonce;
_decode_base(p);
}
// encode
bufferlist bl;
string magic = CEPH_FS_ONDISK_MAGIC;
- ::encode(magic, bl);
+ using ceph::encode;
+ encode(magic, bl);
encode_store(bl, mdcache->mds->mdsmap->get_up_features());
// write it.
return;
}
+ using ceph::decode;
// Attempt decode
try {
string magic;
- ::decode(magic, p);
+ decode(magic, p);
dout(10) << " magic is '" << magic << "' (expecting '"
<< CEPH_FS_ONDISK_MAGIC << "')" << dendl;
if (magic != CEPH_FS_ONDISK_MAGIC) {
inode_backtrace_t bt;
build_backtrace(pool, bt);
bufferlist parent_bl;
- ::encode(bt, parent_bl);
+ using ceph::encode;
+ encode(bt, parent_bl);
ObjectOperation op;
op.priority = op_prio;
op.setxattr("parent", parent_bl);
bufferlist layout_bl;
- ::encode(inode.layout, layout_bl, mdcache->mds->mdsmap->get_up_features());
+ encode(inode.layout, layout_bl, mdcache->mds->mdsmap->get_up_features());
op.setxattr("layout", layout_bl);
SnapContext snapc;
if (err == 0) {
inode_backtrace_t backtrace;
- ::decode(backtrace, bl);
+ using ceph::decode;
+ decode(backtrace, bl);
CDentry *pdn = get_parent_dn();
if (backtrace.ancestors.empty() ||
backtrace.ancestors[0].dname != pdn->name ||
void InodeStoreBase::encode_bare(bufferlist &bl, uint64_t features,
const bufferlist *snap_blob) const
{
- ::encode(inode, bl, features);
+ using ceph::encode;
+ encode(inode, bl, features);
if (is_symlink())
- ::encode(symlink, bl);
- ::encode(dirfragtree, bl);
- ::encode(xattrs, bl);
+ encode(symlink, bl);
+ encode(dirfragtree, bl);
+ encode(xattrs, bl);
if (snap_blob)
- ::encode(*snap_blob, bl);
+ encode(*snap_blob, bl);
else
- ::encode(bufferlist(), bl);
- ::encode(old_inodes, bl, features);
- ::encode(oldest_snap, bl);
- ::encode(damage_flags, bl);
+ encode(bufferlist(), bl);
+ encode(old_inodes, bl, features);
+ encode(oldest_snap, bl);
+ encode(damage_flags, bl);
}
void InodeStoreBase::encode(bufferlist &bl, uint64_t features,
void InodeStoreBase::decode_bare(bufferlist::iterator &bl,
bufferlist& snap_blob, __u8 struct_v)
{
- ::decode(inode, bl);
+ using ceph::decode;
+ decode(inode, bl);
if (is_symlink())
- ::decode(symlink, bl);
- ::decode(dirfragtree, bl);
- ::decode(xattrs, bl);
- ::decode(snap_blob, bl);
+ decode(symlink, bl);
+ decode(dirfragtree, bl);
+ decode(xattrs, bl);
+ decode(snap_blob, bl);
- ::decode(old_inodes, bl);
+ decode(old_inodes, bl);
if (struct_v == 2 && inode.is_dir()) {
bool default_layout_exists;
- ::decode(default_layout_exists, bl);
+ decode(default_layout_exists, bl);
if (default_layout_exists) {
- ::decode(struct_v, bl); // this was a default_file_layout
- ::decode(inode.layout, bl); // but we only care about the layout portion
+ decode(struct_v, bl); // this was a default_file_layout
+ decode(inode.layout, bl); // but we only care about the layout portion
}
}
// InodeStore is embedded in dentries without proper versioning, so
// we consume up to the end of the buffer
if (!bl.end()) {
- ::decode(oldest_snap, bl);
+ decode(oldest_snap, bl);
}
if (!bl.end()) {
- ::decode(damage_flags, bl);
+ decode(damage_flags, bl);
}
}
}
void CInode::encode_lock_state(int type, bufferlist& bl)
{
- ::encode(first, bl);
+ using ceph::encode;
+ encode(first, bl);
if (!is_base())
- ::encode(parent->first, bl);
+ encode(parent->first, bl);
switch (type) {
case CEPH_LOCK_IAUTH:
- ::encode(inode.version, bl);
- ::encode(inode.ctime, bl);
- ::encode(inode.mode, bl);
- ::encode(inode.uid, bl);
- ::encode(inode.gid, bl);
+ encode(inode.version, bl);
+ encode(inode.ctime, bl);
+ encode(inode.mode, bl);
+ encode(inode.uid, bl);
+ encode(inode.gid, bl);
break;
case CEPH_LOCK_ILINK:
- ::encode(inode.version, bl);
- ::encode(inode.ctime, bl);
- ::encode(inode.nlink, bl);
+ encode(inode.version, bl);
+ encode(inode.ctime, bl);
+ encode(inode.nlink, bl);
break;
case CEPH_LOCK_IDFT:
if (is_auth()) {
- ::encode(inode.version, bl);
+ encode(inode.version, bl);
} else {
// treat flushing as dirty when rejoining cache
bool dirty = dirfragtreelock.is_dirty_or_flushing();
- ::encode(dirty, bl);
+ encode(dirty, bl);
}
{
// encode the raw tree
- ::encode(dirfragtree, bl);
+ encode(dirfragtree, bl);
// also specify which frags are mine
set<frag_t> myfrags;
frag_t fg = (*p)->get_frag();
myfrags.insert(fg);
}
- ::encode(myfrags, bl);
+ encode(myfrags, bl);
}
break;
case CEPH_LOCK_IFILE:
if (is_auth()) {
- ::encode(inode.version, bl);
- ::encode(inode.ctime, bl);
- ::encode(inode.mtime, bl);
- ::encode(inode.atime, bl);
- ::encode(inode.time_warp_seq, bl);
+ encode(inode.version, bl);
+ encode(inode.ctime, bl);
+ encode(inode.mtime, bl);
+ encode(inode.atime, bl);
+ encode(inode.time_warp_seq, bl);
if (!is_dir()) {
- ::encode(inode.layout, bl, mdcache->mds->mdsmap->get_up_features());
- ::encode(inode.size, bl);
- ::encode(inode.truncate_seq, bl);
- ::encode(inode.truncate_size, bl);
- ::encode(inode.client_ranges, bl);
- ::encode(inode.inline_data, bl);
+ encode(inode.layout, bl, mdcache->mds->mdsmap->get_up_features());
+ encode(inode.size, bl);
+ encode(inode.truncate_seq, bl);
+ encode(inode.truncate_size, bl);
+ encode(inode.client_ranges, bl);
+ encode(inode.inline_data, bl);
}
} else {
// treat flushing as dirty when rejoining cache
bool dirty = filelock.is_dirty_or_flushing();
- ::encode(dirty, bl);
+ encode(dirty, bl);
}
{
dout(15) << __func__ << " inode.dirstat is " << inode.dirstat << dendl;
- ::encode(inode.dirstat, bl); // only meaningful if i am auth.
+ encode(inode.dirstat, bl); // only meaningful if i am auth.
bufferlist tmp;
__u32 n = 0;
for (compact_map<frag_t,CDir*>::iterator p = dirfrags.begin();
dout(15) << fg << " " << *dir << dendl;
dout(20) << fg << " fragstat " << pf->fragstat << dendl;
dout(20) << fg << " accounted_fragstat " << pf->accounted_fragstat << dendl;
- ::encode(fg, tmp);
- ::encode(dir->first, tmp);
- ::encode(pf->fragstat, tmp);
- ::encode(pf->accounted_fragstat, tmp);
+ encode(fg, tmp);
+ encode(dir->first, tmp);
+ encode(pf->fragstat, tmp);
+ encode(pf->accounted_fragstat, tmp);
n++;
}
}
- ::encode(n, bl);
+ encode(n, bl);
bl.claim_append(tmp);
}
break;
case CEPH_LOCK_INEST:
if (is_auth()) {
- ::encode(inode.version, bl);
+ encode(inode.version, bl);
} else {
// treat flushing as dirty when rejoining cache
bool dirty = nestlock.is_dirty_or_flushing();
- ::encode(dirty, bl);
+ encode(dirty, bl);
}
{
dout(15) << __func__ << " inode.rstat is " << inode.rstat << dendl;
- ::encode(inode.rstat, bl); // only meaningful if i am auth.
+ encode(inode.rstat, bl); // only meaningful if i am auth.
bufferlist tmp;
__u32 n = 0;
for (compact_map<frag_t,CDir*>::iterator p = dirfrags.begin();
dout(10) << fg << " " << pf->rstat << dendl;
dout(10) << fg << " " << pf->rstat << dendl;
dout(10) << fg << " " << dir->dirty_old_rstat << dendl;
- ::encode(fg, tmp);
- ::encode(dir->first, tmp);
- ::encode(pf->rstat, tmp);
- ::encode(pf->accounted_rstat, tmp);
- ::encode(dir->dirty_old_rstat, tmp);
+ encode(fg, tmp);
+ encode(dir->first, tmp);
+ encode(pf->rstat, tmp);
+ encode(pf->accounted_rstat, tmp);
+ encode(dir->dirty_old_rstat, tmp);
n++;
}
}
- ::encode(n, bl);
+ encode(n, bl);
bl.claim_append(tmp);
}
break;
case CEPH_LOCK_IXATTR:
- ::encode(inode.version, bl);
- ::encode(inode.ctime, bl);
- ::encode(xattrs, bl);
+ encode(inode.version, bl);
+ encode(inode.ctime, bl);
+ encode(xattrs, bl);
break;
case CEPH_LOCK_ISNAP:
- ::encode(inode.version, bl);
- ::encode(inode.ctime, bl);
+ encode(inode.version, bl);
+ encode(inode.ctime, bl);
encode_snap(bl);
break;
case CEPH_LOCK_IFLOCK:
- ::encode(inode.version, bl);
+ encode(inode.version, bl);
_encode_file_locks(bl);
break;
case CEPH_LOCK_IPOLICY:
if (inode.is_dir()) {
- ::encode(inode.version, bl);
- ::encode(inode.ctime, bl);
- ::encode(inode.layout, bl, mdcache->mds->mdsmap->get_up_features());
- ::encode(inode.quota, bl);
- ::encode(inode.export_pin, bl);
+ encode(inode.version, bl);
+ encode(inode.ctime, bl);
+ encode(inode.layout, bl, mdcache->mds->mdsmap->get_up_features());
+ encode(inode.quota, bl);
+ encode(inode.export_pin, bl);
}
break;
utime_t tm;
snapid_t newfirst;
- ::decode(newfirst, p);
+ using ceph::decode;
+ decode(newfirst, p);
if (!is_auth() && newfirst != first) {
dout(10) << __func__ << " first " << first << " -> " << newfirst << dendl;
first = newfirst;
}
if (!is_base()) {
- ::decode(newfirst, p);
+ decode(newfirst, p);
if (!parent->is_auth() && newfirst != parent->first) {
dout(10) << __func__ << " parent first " << first << " -> " << newfirst << dendl;
parent->first = newfirst;
switch (type) {
case CEPH_LOCK_IAUTH:
- ::decode(inode.version, p);
- ::decode(tm, p);
+ decode(inode.version, p);
+ decode(tm, p);
if (inode.ctime < tm) inode.ctime = tm;
- ::decode(inode.mode, p);
- ::decode(inode.uid, p);
- ::decode(inode.gid, p);
+ decode(inode.mode, p);
+ decode(inode.uid, p);
+ decode(inode.gid, p);
break;
case CEPH_LOCK_ILINK:
- ::decode(inode.version, p);
- ::decode(tm, p);
+ decode(inode.version, p);
+ decode(tm, p);
if (inode.ctime < tm) inode.ctime = tm;
- ::decode(inode.nlink, p);
+ decode(inode.nlink, p);
break;
case CEPH_LOCK_IDFT:
if (is_auth()) {
bool replica_dirty;
- ::decode(replica_dirty, p);
+ decode(replica_dirty, p);
if (replica_dirty) {
dout(10) << __func__ << " setting dftlock dirty flag" << dendl;
dirfragtreelock.mark_dirty(); // ok bc we're auth and caller will handle
}
} else {
- ::decode(inode.version, p);
+ decode(inode.version, p);
}
{
fragtree_t temp;
- ::decode(temp, p);
+ decode(temp, p);
set<frag_t> authfrags;
- ::decode(authfrags, p);
+ decode(authfrags, p);
if (is_auth()) {
// auth. believe replica's auth frags only.
for (set<frag_t>::iterator p = authfrags.begin(); p != authfrags.end(); ++p)
case CEPH_LOCK_IFILE:
if (!is_auth()) {
- ::decode(inode.version, p);
- ::decode(tm, p);
+ decode(inode.version, p);
+ decode(tm, p);
if (inode.ctime < tm) inode.ctime = tm;
- ::decode(inode.mtime, p);
- ::decode(inode.atime, p);
- ::decode(inode.time_warp_seq, p);
+ decode(inode.mtime, p);
+ decode(inode.atime, p);
+ decode(inode.time_warp_seq, p);
if (!is_dir()) {
- ::decode(inode.layout, p);
- ::decode(inode.size, p);
- ::decode(inode.truncate_seq, p);
- ::decode(inode.truncate_size, p);
- ::decode(inode.client_ranges, p);
- ::decode(inode.inline_data, p);
+ decode(inode.layout, p);
+ decode(inode.size, p);
+ decode(inode.truncate_seq, p);
+ decode(inode.truncate_size, p);
+ decode(inode.client_ranges, p);
+ decode(inode.inline_data, p);
}
} else {
bool replica_dirty;
- ::decode(replica_dirty, p);
+ decode(replica_dirty, p);
if (replica_dirty) {
dout(10) << __func__ << " setting filelock dirty flag" << dendl;
filelock.mark_dirty(); // ok bc we're auth and caller will handle
}
{
frag_info_t dirstat;
- ::decode(dirstat, p);
+ decode(dirstat, p);
if (!is_auth()) {
dout(10) << " taking inode dirstat " << dirstat << " for " << *this << dendl;
inode.dirstat = dirstat; // take inode summation if replica
}
__u32 n;
- ::decode(n, p);
+ decode(n, p);
dout(10) << " ...got " << n << " fragstats on " << *this << dendl;
while (n--) {
frag_t fg;
snapid_t fgfirst;
frag_info_t fragstat;
frag_info_t accounted_fragstat;
- ::decode(fg, p);
- ::decode(fgfirst, p);
- ::decode(fragstat, p);
- ::decode(accounted_fragstat, p);
+ decode(fg, p);
+ decode(fgfirst, p);
+ decode(fragstat, p);
+ decode(accounted_fragstat, p);
dout(10) << fg << " [" << fgfirst << ",head] " << dendl;
dout(10) << fg << " fragstat " << fragstat << dendl;
dout(20) << fg << " accounted_fragstat " << accounted_fragstat << dendl;
case CEPH_LOCK_INEST:
if (is_auth()) {
bool replica_dirty;
- ::decode(replica_dirty, p);
+ decode(replica_dirty, p);
if (replica_dirty) {
dout(10) << __func__ << " setting nestlock dirty flag" << dendl;
nestlock.mark_dirty(); // ok bc we're auth and caller will handle
}
} else {
- ::decode(inode.version, p);
+ decode(inode.version, p);
}
{
nest_info_t rstat;
- ::decode(rstat, p);
+ decode(rstat, p);
if (!is_auth()) {
dout(10) << " taking inode rstat " << rstat << " for " << *this << dendl;
inode.rstat = rstat; // take inode summation if replica
}
__u32 n;
- ::decode(n, p);
+ decode(n, p);
while (n--) {
frag_t fg;
snapid_t fgfirst;
nest_info_t rstat;
nest_info_t accounted_rstat;
compact_map<snapid_t,old_rstat_t> dirty_old_rstat;
- ::decode(fg, p);
- ::decode(fgfirst, p);
- ::decode(rstat, p);
- ::decode(accounted_rstat, p);
- ::decode(dirty_old_rstat, p);
+ decode(fg, p);
+ decode(fgfirst, p);
+ decode(rstat, p);
+ decode(accounted_rstat, p);
+ decode(dirty_old_rstat, p);
dout(10) << fg << " [" << fgfirst << ",head]" << dendl;
dout(10) << fg << " rstat " << rstat << dendl;
dout(10) << fg << " accounted_rstat " << accounted_rstat << dendl;
break;
case CEPH_LOCK_IXATTR:
- ::decode(inode.version, p);
- ::decode(tm, p);
+ decode(inode.version, p);
+ decode(tm, p);
if (inode.ctime < tm) inode.ctime = tm;
- ::decode(xattrs, p);
+ decode(xattrs, p);
break;
case CEPH_LOCK_ISNAP:
{
- ::decode(inode.version, p);
- ::decode(tm, p);
+ decode(inode.version, p);
+ decode(tm, p);
if (inode.ctime < tm) inode.ctime = tm;
snapid_t seq = 0;
if (snaprealm)
break;
case CEPH_LOCK_IFLOCK:
- ::decode(inode.version, p);
+ decode(inode.version, p);
_decode_file_locks(p);
break;
case CEPH_LOCK_IPOLICY:
if (inode.is_dir()) {
- ::decode(inode.version, p);
- ::decode(tm, p);
+ decode(inode.version, p);
+ decode(tm, p);
if (inode.ctime < tm) inode.ctime = tm;
- ::decode(inode.layout, p);
- ::decode(inode.quota, p);
+ decode(inode.layout, p);
+ decode(inode.quota, p);
mds_rank_t old_pin = inode.export_pin;
- ::decode(inode.export_pin, p);
+ decode(inode.export_pin, p);
maybe_export_pin(old_pin != inode.export_pin);
}
break;
void CInode::encode_snap_blob(bufferlist &snapbl)
{
if (snaprealm) {
- ::encode(snaprealm->srnode, snapbl);
+ using ceph::encode;
+ encode(snaprealm->srnode, snapbl);
dout(20) << __func__ << " " << *snaprealm << dendl;
}
}
void CInode::decode_snap_blob(bufferlist& snapbl)
{
+ using ceph::decode;
if (snapbl.length()) {
open_snaprealm();
bufferlist::iterator p = snapbl.begin();
- ::decode(snaprealm->srnode, p);
+ decode(snaprealm->srnode, p);
if (is_base()) {
bool ok = snaprealm->_open_parents(NULL);
assert(ok);
void CInode::encode_snap(bufferlist& bl)
{
+ using ceph::encode;
bufferlist snapbl;
encode_snap_blob(snapbl);
- ::encode(snapbl, bl);
- ::encode(oldest_snap, bl);
-}
+ encode(snapbl, bl);
+ encode(oldest_snap, bl);
+}
void CInode::decode_snap(bufferlist::iterator& p)
{
+ using ceph::decode;
bufferlist snapbl;
- ::decode(snapbl, p);
- ::decode(oldest_snap, p);
+ decode(snapbl, p);
+ decode(oldest_snap, p);
decode_snap_blob(snapbl);
}
// xattr
inode_t *xattr_i = pxattr ? pi:oi;
+ using ceph::encode;
// xattr
bufferlist xbl;
version_t xattr_version;
(getattr_caps & CEPH_CAP_XATTR_SHARED)) { // client requests xattrs
if (!pxattrs)
pxattrs = pxattr ? get_projected_xattrs() : &xattrs;
- ::encode(*pxattrs, xbl);
+ encode(*pxattrs, xbl);
xattr_version = xattr_i->xattr_version;
} else {
xattr_version = 0;
/*
* note: encoding matches MClientReply::InodeStat
*/
- ::encode(oi->ino, bl);
- ::encode(snapid, bl);
- ::encode(oi->rdev, bl);
- ::encode(version, bl);
+ encode(oi->ino, bl);
+ encode(snapid, bl);
+ encode(oi->rdev, bl);
+ encode(version, bl);
- ::encode(xattr_version, bl);
+ encode(xattr_version, bl);
- ::encode(ecap, bl);
+ encode(ecap, bl);
{
ceph_file_layout legacy_layout;
layout.to_legacy(&legacy_layout);
- ::encode(legacy_layout, bl);
- }
- ::encode(any_i->ctime, bl);
- ::encode(file_i->mtime, bl);
- ::encode(file_i->atime, bl);
- ::encode(file_i->time_warp_seq, bl);
- ::encode(file_i->size, bl);
- ::encode(max_size, bl);
- ::encode(file_i->truncate_size, bl);
- ::encode(file_i->truncate_seq, bl);
-
- ::encode(auth_i->mode, bl);
- ::encode((uint32_t)auth_i->uid, bl);
- ::encode((uint32_t)auth_i->gid, bl);
-
- ::encode(link_i->nlink, bl);
-
- ::encode(file_i->dirstat.nfiles, bl);
- ::encode(file_i->dirstat.nsubdirs, bl);
- ::encode(file_i->rstat.rbytes, bl);
- ::encode(file_i->rstat.rfiles, bl);
- ::encode(file_i->rstat.rsubdirs, bl);
- ::encode(file_i->rstat.rctime, bl);
+ encode(legacy_layout, bl);
+ }
+ encode(any_i->ctime, bl);
+ encode(file_i->mtime, bl);
+ encode(file_i->atime, bl);
+ encode(file_i->time_warp_seq, bl);
+ encode(file_i->size, bl);
+ encode(max_size, bl);
+ encode(file_i->truncate_size, bl);
+ encode(file_i->truncate_seq, bl);
+
+ encode(auth_i->mode, bl);
+ encode((uint32_t)auth_i->uid, bl);
+ encode((uint32_t)auth_i->gid, bl);
+
+ encode(link_i->nlink, bl);
+
+ encode(file_i->dirstat.nfiles, bl);
+ encode(file_i->dirstat.nsubdirs, bl);
+ encode(file_i->rstat.rbytes, bl);
+ encode(file_i->rstat.rfiles, bl);
+ encode(file_i->rstat.rsubdirs, bl);
+ encode(file_i->rstat.rctime, bl);
dirfragtree.encode(bl);
- ::encode(symlink, bl);
+ encode(symlink, bl);
if (session->connection->has_feature(CEPH_FEATURE_DIRLAYOUTHASH)) {
- ::encode(file_i->dir_layout, bl);
+ encode(file_i->dir_layout, bl);
}
- ::encode(xbl, bl);
+ encode(xbl, bl);
if (session->connection->has_feature(CEPH_FEATURE_MDS_INLINE_DATA)) {
- ::encode(inline_version, bl);
- ::encode(inline_data, bl);
+ encode(inline_version, bl);
+ encode(inline_data, bl);
}
if (session->connection->has_feature(CEPH_FEATURE_MDS_QUOTA)) {
inode_t *policy_i = ppolicy ? pi : oi;
- ::encode(policy_i->quota, bl);
+ encode(policy_i->quota, bl);
}
if (session->connection->has_feature(CEPH_FEATURE_FS_FILE_LAYOUT_V2)) {
- ::encode(layout.pool_ns, bl);
+ encode(layout.pool_ns, bl);
}
if (session->connection->has_feature(CEPH_FEATURE_FS_BTIME)) {
- ::encode(any_i->btime, bl);
- ::encode(any_i->change_attr, bl);
+ encode(any_i->btime, bl);
+ encode(any_i->change_attr, bl);
}
return valid;
i = plink ? pi:oi;
m->head.nlink = i->nlink;
+ using ceph::encode;
i = pxattr ? pi:oi;
map<string,bufferptr> *ix = pxattr ? get_projected_xattrs() : &xattrs;
if ((cap->pending() & CEPH_CAP_XATTR_SHARED) &&
i->xattr_version > cap->client_xattr_version) {
dout(10) << " including xattrs v " << i->xattr_version << dendl;
- ::encode(*ix, m->xattrbl);
+ encode(*ix, m->xattrbl);
m->head.xattr_version = i->xattr_version;
cap->client_xattr_version = i->xattr_version;
}
void CInode::_encode_base(bufferlist& bl, uint64_t features)
{
- ::encode(first, bl);
- ::encode(inode, bl, features);
- ::encode(symlink, bl);
- ::encode(dirfragtree, bl);
- ::encode(xattrs, bl);
- ::encode(old_inodes, bl, features);
- ::encode(damage_flags, bl);
+ using ceph::encode;
+ encode(first, bl);
+ encode(inode, bl, features);
+ encode(symlink, bl);
+ encode(dirfragtree, bl);
+ encode(xattrs, bl);
+ encode(old_inodes, bl, features);
+ encode(damage_flags, bl);
encode_snap(bl);
}
void CInode::_decode_base(bufferlist::iterator& p)
{
- ::decode(first, p);
- ::decode(inode, p);
- ::decode(symlink, p);
- ::decode(dirfragtree, p);
- ::decode(xattrs, p);
- ::decode(old_inodes, p);
- ::decode(damage_flags, p);
+ using ceph::decode;
+ decode(first, p);
+ decode(inode, p);
+ decode(symlink, p);
+ decode(dirfragtree, p);
+ decode(xattrs, p);
+ decode(old_inodes, p);
+ decode(damage_flags, p);
decode_snap(p);
}
void CInode::_encode_locks_full(bufferlist& bl)
{
- ::encode(authlock, bl);
- ::encode(linklock, bl);
- ::encode(dirfragtreelock, bl);
- ::encode(filelock, bl);
- ::encode(xattrlock, bl);
- ::encode(snaplock, bl);
- ::encode(nestlock, bl);
- ::encode(flocklock, bl);
- ::encode(policylock, bl);
+ using ceph::encode;
+ encode(authlock, bl);
+ encode(linklock, bl);
+ encode(dirfragtreelock, bl);
+ encode(filelock, bl);
+ encode(xattrlock, bl);
+ encode(snaplock, bl);
+ encode(nestlock, bl);
+ encode(flocklock, bl);
+ encode(policylock, bl);
- ::encode(loner_cap, bl);
+ encode(loner_cap, bl);
}
void CInode::_decode_locks_full(bufferlist::iterator& p)
{
- ::decode(authlock, p);
- ::decode(linklock, p);
- ::decode(dirfragtreelock, p);
- ::decode(filelock, p);
- ::decode(xattrlock, p);
- ::decode(snaplock, p);
- ::decode(nestlock, p);
- ::decode(flocklock, p);
- ::decode(policylock, p);
-
- ::decode(loner_cap, p);
+ using ceph::decode;
+ decode(authlock, p);
+ decode(linklock, p);
+ decode(dirfragtreelock, p);
+ decode(filelock, p);
+ decode(xattrlock, p);
+ decode(snaplock, p);
+ decode(nestlock, p);
+ decode(flocklock, p);
+ decode(policylock, p);
+
+ decode(loner_cap, p);
set_loner_cap(loner_cap);
want_loner_cap = loner_cap; // for now, we'll eval() shortly.
}
snaplock.encode_state_for_replica(bl);
flocklock.encode_state_for_replica(bl);
policylock.encode_state_for_replica(bl);
- ::encode(need_recover, bl);
+ using ceph::encode;
+ encode(need_recover, bl);
}
void CInode::_encode_locks_state_for_rejoin(bufferlist& bl, int rep)
flocklock.decode_state(p, is_new);
policylock.decode_state(p, is_new);
+ using ceph::decode;
bool need_recover;
- ::decode(need_recover, p);
+ decode(need_recover, p);
if (need_recover && is_new) {
// Auth mds replicated this inode while it's recovering. Auth mds may take xlock on the lock
// and change the object when replaying unsafe requests.
ENCODE_START(5, 4, bl);
_encode_base(bl, mdcache->mds->mdsmap->get_up_features());
- ::encode(state, bl);
+ encode(state, bl);
- ::encode(pop, bl);
+ encode(pop, bl);
- ::encode(get_replicas(), bl);
+ encode(get_replicas(), bl);
// include scatterlock info for any bounding CDirs
bufferlist bounding;
++p) {
CDir *dir = p->second;
if (dir->state_test(CDir::STATE_EXPORTBOUND)) {
- ::encode(p->first, bounding);
- ::encode(dir->fnode.fragstat, bounding);
- ::encode(dir->fnode.accounted_fragstat, bounding);
- ::encode(dir->fnode.rstat, bounding);
- ::encode(dir->fnode.accounted_rstat, bounding);
+ encode(p->first, bounding);
+ encode(dir->fnode.fragstat, bounding);
+ encode(dir->fnode.accounted_fragstat, bounding);
+ encode(dir->fnode.rstat, bounding);
+ encode(dir->fnode.accounted_rstat, bounding);
dout(10) << " encoded fragstat/rstat info for " << *dir << dendl;
}
}
- ::encode(bounding, bl);
+ encode(bounding, bl);
_encode_locks_full(bl);
_decode_base(p);
unsigned s;
- ::decode(s, p);
+ decode(s, p);
state_set(STATE_AUTH | (s & MASK_STATE_EXPORTED));
if (is_dirty()) {
_mark_dirty_parent(ls);
}
- ::decode(pop, ceph_clock_now(), p);
+ decode(pop, ceph_clock_now(), p);
- ::decode(get_replicas(), p);
+ decode(get_replicas(), p);
if (is_replicated())
get(PIN_REPLICATED);
replica_nonce = 0;
// decode fragstat info on bounding cdirs
bufferlist bounding;
- ::decode(bounding, p);
+ decode(bounding, p);
bufferlist::iterator q = bounding.begin();
while (!q.end()) {
frag_t fg;
- ::decode(fg, q);
+ decode(fg, q);
CDir *dir = get_dirfrag(fg);
assert(dir); // we should have all bounds open
filelock.get_state() == LOCK_MIX) {
dout(10) << " skipped fragstat info for " << *dir << dendl;
frag_info_t f;
- ::decode(f, q);
- ::decode(f, q);
+ decode(f, q);
+ decode(f, q);
} else {
- ::decode(dir->fnode.fragstat, q);
- ::decode(dir->fnode.accounted_fragstat, q);
+ decode(dir->fnode.fragstat, q);
+ decode(dir->fnode.accounted_fragstat, q);
dout(10) << " took fragstat info for " << *dir << dendl;
}
if (dir->is_auth() ||
nestlock.get_state() == LOCK_MIX) {
dout(10) << " skipped rstat info for " << *dir << dendl;
nest_info_t n;
- ::decode(n, q);
- ::decode(n, q);
+ decode(n, q);
+ decode(n, q);
} else {
- ::decode(dir->fnode.rstat, q);
- ::decode(dir->fnode.accounted_rstat, q);
+ decode(dir->fnode.rstat, q);
+ decode(dir->fnode.accounted_rstat, q);
dout(10) << " took rstat info for " << *dir << dendl;
}
}
fetch.getxattr("parent", bt, bt_r);
in->mdcache->mds->objecter->read(oid, object_locator_t(pool), fetch, CEPH_NOSNAP,
NULL, 0, fin);
+ using ceph::encode;
if (!tag.empty()) {
ObjectOperation scrub_tag;
bufferlist tag_bl;
- ::encode(tag, tag_bl);
+ encode(tag, tag_bl);
scrub_tag.setxattr("scrub_tag", tag_bl);
SnapContext snapc;
in->mdcache->mds->objecter->mutate(oid, object_locator_t(pool), scrub_tag, snapc,
// extract the backtrace, and compare it to a newly-constructed one
try {
bufferlist::iterator p = bl.begin();
- ::decode(results->backtrace.ondisk_value, p);
+ using ceph::decode;
+ decode(results->backtrace.ondisk_value, p);
dout(10) << "decoded " << bl.length() << " bytes of backtrace successfully" << dendl;
} catch (buffer::error&) {
if (results->backtrace.ondisk_read_retval == 0 && rval != 0) {
clear_flock_lock_state();
}
void _encode_file_locks(bufferlist& bl) const {
+ using ceph::encode;
bool has_fcntl_locks = fcntl_locks && !fcntl_locks->empty();
- ::encode(has_fcntl_locks, bl);
+ encode(has_fcntl_locks, bl);
if (has_fcntl_locks)
- ::encode(*fcntl_locks, bl);
+ encode(*fcntl_locks, bl);
bool has_flock_locks = flock_locks && !flock_locks->empty();
- ::encode(has_flock_locks, bl);
+ encode(has_flock_locks, bl);
if (has_flock_locks)
- ::encode(*flock_locks, bl);
+ encode(*flock_locks, bl);
}
void _decode_file_locks(bufferlist::iterator& p) {
+ using ceph::decode;
bool has_fcntl_locks;
- ::decode(has_fcntl_locks, p);
+ decode(has_fcntl_locks, p);
if (has_fcntl_locks)
- ::decode(*get_fcntl_lock_state(), p);
+ decode(*get_fcntl_lock_state(), p);
else
clear_fcntl_lock_state();
bool has_flock_locks;
- ::decode(has_flock_locks, p);
+ decode(has_flock_locks, p);
if (has_flock_locks)
- ::decode(*get_flock_lock_state(), p);
+ decode(*get_flock_lock_state(), p);
else
clear_flock_lock_state();
}
replicate_relax_locks();
__u32 nonce = add_replica(rep);
- ::encode(nonce, bl);
+ using ceph::encode;
+ encode(nonce, bl);
_encode_base(bl, features);
_encode_locks_state_for_replica(bl, need_recover);
}
void decode_replica(bufferlist::iterator& p, bool is_new) {
+ using ceph::decode;
__u32 nonce;
- ::decode(nonce, p);
+ decode(nonce, p);
replica_nonce = nonce;
_decode_base(p);
void Capability::Export::encode(bufferlist &bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(cap_id, bl);
- ::encode(wanted, bl);
- ::encode(issued, bl);
- ::encode(pending, bl);
- ::encode(client_follows, bl);
- ::encode(seq, bl);
- ::encode(mseq, bl);
- ::encode(last_issue_stamp, bl);
+ encode(cap_id, bl);
+ encode(wanted, bl);
+ encode(issued, bl);
+ encode(pending, bl);
+ encode(client_follows, bl);
+ encode(seq, bl);
+ encode(mseq, bl);
+ encode(last_issue_stamp, bl);
ENCODE_FINISH(bl);
}
void Capability::Export::decode(bufferlist::iterator &p)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, p);
- ::decode(cap_id, p);
- ::decode(wanted, p);
- ::decode(issued, p);
- ::decode(pending, p);
- ::decode(client_follows, p);
- ::decode(seq, p);
- ::decode(mseq, p);
- ::decode(last_issue_stamp, p);
+ decode(cap_id, p);
+ decode(wanted, p);
+ decode(issued, p);
+ decode(pending, p);
+ decode(client_follows, p);
+ decode(seq, p);
+ decode(mseq, p);
+ decode(last_issue_stamp, p);
DECODE_FINISH(p);
}
void Capability::Import::encode(bufferlist &bl) const
{
ENCODE_START(1, 1, bl);
- ::encode(cap_id, bl);
- ::encode(issue_seq, bl);
- ::encode(mseq, bl);
+ encode(cap_id, bl);
+ encode(issue_seq, bl);
+ encode(mseq, bl);
ENCODE_FINISH(bl);
}
void Capability::Import::decode(bufferlist::iterator &bl)
{
DECODE_START(1, bl);
- ::decode(cap_id, bl);
- ::decode(issue_seq, bl);
- ::decode(mseq, bl);
+ decode(cap_id, bl);
+ decode(issue_seq, bl);
+ decode(mseq, bl);
DECODE_FINISH(bl);
}
void Capability::revoke_info::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl)
- ::encode(before, bl);
- ::encode(seq, bl);
- ::encode(last_issue, bl);
+ encode(before, bl);
+ encode(seq, bl);
+ encode(last_issue, bl);
ENCODE_FINISH(bl);
}
void Capability::revoke_info::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(before, bl);
- ::decode(seq, bl);
- ::decode(last_issue, bl);
+ decode(before, bl);
+ decode(seq, bl);
+ decode(last_issue, bl);
DECODE_FINISH(bl);
}
void Capability::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl)
- ::encode(last_sent, bl);
- ::encode(last_issue_stamp, bl);
+ encode(last_sent, bl);
+ encode(last_issue_stamp, bl);
- ::encode(_wanted, bl);
- ::encode(_pending, bl);
- ::encode(_revokes, bl);
+ encode(_wanted, bl);
+ encode(_pending, bl);
+ encode(_revokes, bl);
ENCODE_FINISH(bl);
}
void Capability::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl)
- ::decode(last_sent, bl);
- ::decode(last_issue_stamp, bl);
+ decode(last_sent, bl);
+ decode(last_issue_stamp, bl);
- ::decode(_wanted, bl);
- ::decode(_pending, bl);
- ::decode(_revokes, bl);
+ decode(_wanted, bl);
+ decode(_pending, bl);
+ decode(_revokes, bl);
DECODE_FINISH(bl);
_calc_issued();
{
if (features & CEPH_FEATURE_SERVER_JEWEL) {
ENCODE_START(7, 6, bl);
- ::encode(epoch, bl);
- ::encode(next_filesystem_id, bl);
- ::encode(legacy_client_fscid, bl);
- ::encode(compat, bl);
- ::encode(enable_multiple, bl);
+ encode(epoch, bl);
+ encode(next_filesystem_id, bl);
+ encode(legacy_client_fscid, bl);
+ encode(compat, bl);
+ encode(enable_multiple, bl);
std::vector<Filesystem> fs_list;
for (auto i : filesystems) {
fs_list.push_back(*(i.second));
}
- ::encode(fs_list, bl, features);
- ::encode(mds_roles, bl);
- ::encode(standby_daemons, bl, features);
- ::encode(standby_epochs, bl);
- ::encode(ever_enabled_multiple, bl);
+ encode(fs_list, bl, features);
+ encode(mds_roles, bl);
+ encode(standby_daemons, bl, features);
+ encode(standby_epochs, bl);
+ encode(ever_enabled_multiple, bl);
ENCODE_FINISH(bl);
} else {
if (filesystems.empty()) {
MDSMap legacy_mds_map;
// Decoding an MDSMap (upgrade)
- ::decode(epoch, p);
- ::decode(legacy_mds_map.flags, p);
- ::decode(legacy_mds_map.last_failure, p);
- ::decode(legacy_mds_map.root, p);
- ::decode(legacy_mds_map.session_timeout, p);
- ::decode(legacy_mds_map.session_autoclose, p);
- ::decode(legacy_mds_map.max_file_size, p);
- ::decode(legacy_mds_map.max_mds, p);
- ::decode(legacy_mds_map.mds_info, p);
+ decode(epoch, p);
+ decode(legacy_mds_map.flags, p);
+ decode(legacy_mds_map.last_failure, p);
+ decode(legacy_mds_map.root, p);
+ decode(legacy_mds_map.session_timeout, p);
+ decode(legacy_mds_map.session_autoclose, p);
+ decode(legacy_mds_map.max_file_size, p);
+ decode(legacy_mds_map.max_mds, p);
+ decode(legacy_mds_map.mds_info, p);
if (struct_v < 3) {
__u32 n;
- ::decode(n, p);
+ decode(n, p);
while (n--) {
__u32 m;
- ::decode(m, p);
+ decode(m, p);
legacy_mds_map.data_pools.push_back(m);
}
__s32 s;
- ::decode(s, p);
+ decode(s, p);
legacy_mds_map.cas_pool = s;
} else {
- ::decode(legacy_mds_map.data_pools, p);
- ::decode(legacy_mds_map.cas_pool, p);
+ decode(legacy_mds_map.data_pools, p);
+ decode(legacy_mds_map.cas_pool, p);
}
// kclient ignores everything from here
__u16 ev = 1;
if (struct_v >= 2)
- ::decode(ev, p);
+ decode(ev, p);
if (ev >= 3)
- ::decode(legacy_mds_map.compat, p);
+ decode(legacy_mds_map.compat, p);
else
legacy_mds_map.compat = get_mdsmap_compat_set_base();
if (ev < 5) {
__u32 n;
- ::decode(n, p);
+ decode(n, p);
legacy_mds_map.metadata_pool = n;
} else {
- ::decode(legacy_mds_map.metadata_pool, p);
+ decode(legacy_mds_map.metadata_pool, p);
}
- ::decode(legacy_mds_map.created, p);
- ::decode(legacy_mds_map.modified, p);
- ::decode(legacy_mds_map.tableserver, p);
- ::decode(legacy_mds_map.in, p);
+ decode(legacy_mds_map.created, p);
+ decode(legacy_mds_map.modified, p);
+ decode(legacy_mds_map.tableserver, p);
+ decode(legacy_mds_map.in, p);
std::map<mds_rank_t,int32_t> inc; // Legacy field, parse and drop
- ::decode(inc, p);
- ::decode(legacy_mds_map.up, p);
- ::decode(legacy_mds_map.failed, p);
- ::decode(legacy_mds_map.stopped, p);
+ decode(inc, p);
+ decode(legacy_mds_map.up, p);
+ decode(legacy_mds_map.failed, p);
+ decode(legacy_mds_map.stopped, p);
if (ev >= 4)
- ::decode(legacy_mds_map.last_failure_osd_epoch, p);
+ decode(legacy_mds_map.last_failure_osd_epoch, p);
if (ev >= 6) {
if (ev < 10) {
// previously this was a bool about snaps, not a flag map
bool flag;
- ::decode(flag, p);
+ decode(flag, p);
legacy_mds_map.ever_allowed_features = flag ?
CEPH_MDSMAP_ALLOW_SNAPS : 0;
- ::decode(flag, p);
+ decode(flag, p);
legacy_mds_map.explicitly_allowed_features = flag ?
CEPH_MDSMAP_ALLOW_SNAPS : 0;
if (legacy_mds_map.max_mds > 1) {
legacy_mds_map.set_multimds_allowed();
}
} else {
- ::decode(legacy_mds_map.ever_allowed_features, p);
- ::decode(legacy_mds_map.explicitly_allowed_features, p);
+ decode(legacy_mds_map.ever_allowed_features, p);
+ decode(legacy_mds_map.explicitly_allowed_features, p);
}
} else {
legacy_mds_map.ever_allowed_features = CEPH_MDSMAP_ALLOW_CLASSICS;
}
}
if (ev >= 7)
- ::decode(legacy_mds_map.inline_data_enabled, p);
+ decode(legacy_mds_map.inline_data_enabled, p);
if (ev >= 8) {
assert(struct_v >= 5);
- ::decode(legacy_mds_map.enabled, p);
- ::decode(legacy_mds_map.fs_name, p);
+ decode(legacy_mds_map.enabled, p);
+ decode(legacy_mds_map.fs_name, p);
} else {
legacy_mds_map.fs_name = "default";
if (epoch > 1) {
}
if (ev >= 9) {
- ::decode(legacy_mds_map.damaged, p);
+ decode(legacy_mds_map.damaged, p);
}
// We're upgrading, populate filesystems from the legacy fields
legacy_client_fscid = FS_CLUSTER_ID_NONE;
}
} else {
- ::decode(epoch, p);
- ::decode(next_filesystem_id, p);
- ::decode(legacy_client_fscid, p);
- ::decode(compat, p);
- ::decode(enable_multiple, p);
+ decode(epoch, p);
+ decode(next_filesystem_id, p);
+ decode(legacy_client_fscid, p);
+ decode(compat, p);
+ decode(enable_multiple, p);
std::vector<Filesystem> fs_list;
- ::decode(fs_list, p);
+ decode(fs_list, p);
filesystems.clear();
for (std::vector<Filesystem>::const_iterator fs = fs_list.begin(); fs != fs_list.end(); ++fs) {
filesystems[fs->fscid] = std::make_shared<Filesystem>(*fs);
}
- ::decode(mds_roles, p);
- ::decode(standby_daemons, p);
- ::decode(standby_epochs, p);
+ decode(mds_roles, p);
+ decode(standby_daemons, p);
+ decode(standby_epochs, p);
if (struct_v >= 7) {
- ::decode(ever_enabled_multiple, p);
+ decode(ever_enabled_multiple, p);
}
}
void Filesystem::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(1, 1, bl);
- ::encode(fscid, bl);
+ encode(fscid, bl);
bufferlist mdsmap_bl;
mds_map.encode(mdsmap_bl, features);
- ::encode(mdsmap_bl, bl);
+ encode(mdsmap_bl, bl);
ENCODE_FINISH(bl);
}
void Filesystem::decode(bufferlist::iterator& p)
{
DECODE_START(1, p);
- ::decode(fscid, p);
+ decode(fscid, p);
bufferlist mdsmap_bl;
- ::decode(mdsmap_bl, p);
+ decode(mdsmap_bl, p);
bufferlist::iterator mdsmap_bl_iter = mdsmap_bl.begin();
mds_map.decode(mdsmap_bl_iter);
DECODE_FINISH(p);
void FSMapUser::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(1, 1, bl);
- ::encode(epoch, bl);
- ::encode(legacy_client_fscid, bl);
+ encode(epoch, bl);
+ encode(legacy_client_fscid, bl);
std::vector<fs_info_t> fs_list;
for (auto p = filesystems.begin(); p != filesystems.end(); ++p)
fs_list.push_back(p->second);
- ::encode(fs_list, bl, features);
+ encode(fs_list, bl, features);
ENCODE_FINISH(bl);
}
void FSMapUser::decode(bufferlist::iterator& p)
{
DECODE_START(1, p);
- ::decode(epoch, p);
- ::decode(legacy_client_fscid, p);
+ decode(epoch, p);
+ decode(legacy_client_fscid, p);
std::vector<fs_info_t> fs_list;
- ::decode(fs_list, p);
+ decode(fs_list, p);
filesystems.clear();
for (auto p = fs_list.begin(); p != fs_list.end(); ++p)
filesystems[p->cid] = *p;
void FSMapUser::fs_info_t::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(1, 1, bl);
- ::encode(cid, bl);
- ::encode(name, bl);
+ encode(cid, bl);
+ encode(name, bl);
ENCODE_FINISH(bl);
}
void FSMapUser::fs_info_t::decode(bufferlist::iterator& p)
{
DECODE_START(1, p);
- ::decode(cid, p);
- ::decode(name, p);
+ decode(cid, p);
+ decode(name, p);
DECODE_FINISH(p);
}
void reset_state() override;
void encode_state(bufferlist& bl) const override {
ENCODE_START(2, 2, bl);
- ::encode(free, bl);
+ encode(free, bl);
ENCODE_FINISH(bl);
}
void decode_state(bufferlist::iterator& bl) override {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(free, bl);
+ decode(free, bl);
projected_free = free;
DECODE_FINISH(bl);
}
void encode(bufferlist &bl) const {
ENCODE_START(1, 1, bl);
- ::encode(front, bl);
- ::encode(back, bl);
+ encode(front, bl);
+ encode(back, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
DECODE_START(1, bl);
- ::decode(front, bl);
- ::decode(back, bl);
+ decode(front, bl);
+ decode(back, bl);
DECODE_FINISH(bl);
}
<< " len " << m->xattrbl.length() << dendl;
pi->xattr_version = m->head.xattr_version;
bufferlist::iterator p = m->xattrbl.begin();
- ::decode(*px, p);
+ decode(*px, p);
}
if (pi->client_ranges.count(client)) {
if (m->flockbl.length()) {
int32_t num_locks;
bufferlist::iterator bli = m->flockbl.begin();
- ::decode(num_locks, bli);
+ decode(num_locks, bli);
for ( int i=0; i < num_locks; ++i) {
ceph_filelock decoded_lock;
- ::decode(decoded_lock, bli);
+ decode(decoded_lock, bli);
in->get_fcntl_lock_state()->held_locks.
insert(pair<uint64_t, ceph_filelock>(decoded_lock.start, decoded_lock));
++in->get_fcntl_lock_state()->client_held_lock_counts[(client_t)(decoded_lock.client)];
}
- ::decode(num_locks, bli);
+ decode(num_locks, bli);
for ( int i=0; i < num_locks; ++i) {
ceph_filelock decoded_lock;
- ::decode(decoded_lock, bli);
+ decode(decoded_lock, bli);
in->get_flock_lock_state()->held_locks.
insert(pair<uint64_t, ceph_filelock>(decoded_lock.start, decoded_lock));
++in->get_flock_lock_state()->client_held_lock_counts[(client_t)(decoded_lock.client)];
dout(7) << " xattrs v" << pi->xattr_version << " -> " << m->head.xattr_version << dendl;
pi->xattr_version = m->head.xattr_version;
bufferlist::iterator p = m->xattrbl.begin();
- ::decode(*px, p);
+ decode(*px, p);
wrlock_force(&in->xattrlock, mut);
}
e.mask = 1 | CEPH_LOCK_DN; // old and new bit values
e.seq = ++l->seq;
e.duration_ms = (int)(1000 * mdcache->client_lease_durations[pool]);
- ::encode(e, bl);
+ encode(e, bl);
dout(20) << "issue_client_lease seq " << e.seq << " dur " << e.duration_ms << "ms "
<< " on " << *dn << dendl;
} else {
e.mask = 0;
e.seq = 0;
e.duration_ms = 0;
- ::encode(e, bl);
+ encode(e, bl);
dout(20) << "issue_client_lease no/null lease on " << *dn << dendl;
}
}
bufferlist::iterator p = bl.begin();
EventType type;
LogEvent *event = NULL;
- ::decode(type, p);
+ using ceph::decode;
+ decode(type, p);
if (EVENT_NEW_ENCODING == type) {
try {
DECODE_START(1, p);
- ::decode(type, p);
+ decode(type, p);
event = decode_event(bl, p, type);
DECODE_FINISH(p);
}
virtual void dump(Formatter *f) const = 0;
void encode_with_header(bufferlist& bl, uint64_t features) {
- ::encode(EVENT_NEW_ENCODING, bl);
+ using ceph::encode;
+ encode(EVENT_NEW_ENCODING, bl);
ENCODE_START(1, 1, bl)
- ::encode(_type, bl);
+ encode(_type, bl);
this->encode(bl, features);
ENCODE_FINISH(bl);
}
map<client_t, Capability::Export> cap_map;
in->export_client_caps(cap_map);
bufferlist bl;
- ::encode(in->ino(), bl);
- ::encode(cap_map, bl);
+ encode(in->ino(), bl);
+ encode(cap_map, bl);
resolves[master]->add_slave_request(p->first, bl);
} else {
resolves[master]->add_slave_request(p->first, mdr->committing);
inodeno_t ino;
map<client_t,Capability::Export> cap_exports;
bufferlist::iterator q = p->second.inode_caps.begin();
- ::decode(ino, q);
- ::decode(cap_exports, q);
+ decode(ino, q);
+ decode(cap_exports, q);
assert(get_inode(ino));
rejoin_slave_exports[ino].second.swap(cap_exports);
// send information of imported caps back to slave
- ::encode(rejoin_imported_caps[from][ino], ack->commit[p->first]);
+ encode(rejoin_imported_caps[from][ino], ack->commit[p->first]);
}
} else {
// ABORT
mds->locker->eval(in, CEPH_CAP_LOCKS, true);
}
- ::encode(imported_caps, ack->imported_caps);
+ encode(imported_caps, ack->imported_caps);
} else {
assert(mds->is_rejoin());
inodeno_t ino;
snapid_t last;
bufferlist basebl;
- ::decode(ino, p);
- ::decode(last, p);
- ::decode(basebl, p);
+ decode(ino, p);
+ decode(last, p);
+ decode(basebl, p);
CInode *in = get_inode(ino, last);
assert(in);
bufferlist::iterator q = basebl.begin();
snapid_t last;
__u32 nonce;
bufferlist lockbl;
- ::decode(ino, p);
- ::decode(last, p);
- ::decode(nonce, p);
- ::decode(lockbl, p);
+ decode(ino, p);
+ decode(last, p);
+ decode(nonce, p);
+ decode(lockbl, p);
CInode *in = get_inode(ino, last);
assert(in);
map<inodeno_t,map<client_t,Capability::Import> > peer_imported;
bufferlist::iterator bp = ack->imported_caps.begin();
- ::decode(peer_imported, bp);
+ decode(peer_imported, bp);
for (map<inodeno_t,map<client_t,Capability::Import> >::iterator p = peer_imported.begin();
p != peer_imported.end();
// send acks
for (auto p = acks.begin(); p != acks.end(); ++p) {
- ::encode(rejoin_imported_caps[p->first], p->second->imported_caps);
+ encode(rejoin_imported_caps[p->first], p->second->imported_caps);
mds->send_message_mds(p->second, p->first);
}
inode_backtrace_t backtrace;
if (err == 0) {
try {
- ::decode(backtrace, bl);
+ decode(backtrace, bl);
} catch (const buffer::error &decode_exc) {
derr << "corrupt backtrace on ino x0" << std::hex << ino
<< std::dec << ": " << decode_exc << dendl;
bufferlist::iterator p = mdr->more()->snapidbl.begin();
snapid_t seq;
- ::decode(seq, p);
+ decode(seq, p);
sr_t *newsnap = in->project_snaprealm(seq);
newsnap->seq = seq;
// create
bufferlist::iterator p = mdr->more()->snapidbl.begin();
snapid_t seq;
- ::decode(seq, p);
+ decode(seq, p);
in->open_snaprealm();
in->snaprealm->srnode.seq = seq;
void MDCache::replicate_dir(CDir *dir, mds_rank_t to, bufferlist& bl)
{
dirfrag_t df = dir->dirfrag();
- ::encode(df, bl);
+ encode(df, bl);
dir->encode_replica(to, bl);
}
void MDCache::replicate_dentry(CDentry *dn, mds_rank_t to, bufferlist& bl)
{
- ::encode(dn->name, bl);
- ::encode(dn->last, bl);
+ encode(dn->name, bl);
+ encode(dn->last, bl);
dn->encode_replica(to, bl, mds->get_state() < MDSMap::STATE_ACTIVE);
}
void MDCache::replicate_inode(CInode *in, mds_rank_t to, bufferlist& bl,
uint64_t features)
{
- ::encode(in->inode.ino, bl); // bleh, minor assymetry here
- ::encode(in->last, bl);
+ encode(in->inode.ino, bl); // bleh, minor assymetry here
+ encode(in->last, bl);
in->encode_replica(to, bl, features, mds->get_state() < MDSMap::STATE_ACTIVE);
}
list<MDSInternalContextBase*>& finished)
{
dirfrag_t df;
- ::decode(df, p);
+ decode(df, p);
assert(diri->ino() == df.ino);
{
string name;
snapid_t last;
- ::decode(name, p);
- ::decode(last, p);
+ decode(name, p);
+ decode(last, p);
CDentry *dn = dir->lookup(name, last);
{
inodeno_t ino;
snapid_t last;
- ::decode(ino, p);
- ::decode(last, p);
+ decode(ino, p);
+ decode(last, p);
CInode *in = get_inode(ino, last);
if (!in) {
in = new CInode(this, false, 1, last);
inodeno_t ino = dnl->get_remote_ino();
__u8 d_type = dnl->get_remote_d_type();
dout(10) << " remote " << ino << " " << d_type << dendl;
- ::encode(ino, m->bl);
- ::encode(d_type, m->bl);
+ encode(ino, m->bl);
+ encode(d_type, m->bl);
} else
ceph_abort(); // aie, bad caller!
mds->send_message_mds(m, p.first);
// remote link, easy enough.
inodeno_t ino;
__u8 d_type;
- ::decode(ino, p);
- ::decode(d_type, p);
+ decode(ino, p);
+ decode(d_type, p);
dir->link_remote_inode(dn, ino, d_type);
}
} else {
resultfrags.push_back(dir);
dirfrag_rollback rollback;
- ::decode(rollback, bp);
+ decode(rollback, bp);
dir->set_version(rollback.fnode.version);
dir->fnode = rollback.fnode;
bufferlist::iterator p = caps_info.caps.begin();
string auth_cap_str;
try {
- ::decode(auth_cap_str, p);
+ decode(auth_cap_str, p);
dout(10) << __func__ << ": parsing auth_cap_str='" << auth_cap_str << "'" << dendl;
std::ostringstream errstr;
void MDSMap::mds_info_t::encode_versioned(bufferlist& bl, uint64_t features) const
{
ENCODE_START(7, 4, bl);
- ::encode(global_id, bl);
- ::encode(name, bl);
- ::encode(rank, bl);
- ::encode(inc, bl);
- ::encode((int32_t)state, bl);
- ::encode(state_seq, bl);
- ::encode(addr, bl, features);
- ::encode(laggy_since, bl);
- ::encode(standby_for_rank, bl);
- ::encode(standby_for_name, bl);
- ::encode(export_targets, bl);
- ::encode(mds_features, bl);
- ::encode(standby_for_fscid, bl);
- ::encode(standby_replay, bl);
+ encode(global_id, bl);
+ encode(name, bl);
+ encode(rank, bl);
+ encode(inc, bl);
+ encode((int32_t)state, bl);
+ encode(state_seq, bl);
+ encode(addr, bl, features);
+ encode(laggy_since, bl);
+ encode(standby_for_rank, bl);
+ encode(standby_for_name, bl);
+ encode(export_targets, bl);
+ encode(mds_features, bl);
+ encode(standby_for_fscid, bl);
+ encode(standby_replay, bl);
ENCODE_FINISH(bl);
}
void MDSMap::mds_info_t::encode_unversioned(bufferlist& bl) const
{
__u8 struct_v = 3;
- ::encode(struct_v, bl);
- ::encode(global_id, bl);
- ::encode(name, bl);
- ::encode(rank, bl);
- ::encode(inc, bl);
- ::encode((int32_t)state, bl);
- ::encode(state_seq, bl);
- ::encode(addr, bl, 0);
- ::encode(laggy_since, bl);
- ::encode(standby_for_rank, bl);
- ::encode(standby_for_name, bl);
- ::encode(export_targets, bl);
+ using ceph::encode;
+ encode(struct_v, bl);
+ encode(global_id, bl);
+ encode(name, bl);
+ encode(rank, bl);
+ encode(inc, bl);
+ encode((int32_t)state, bl);
+ encode(state_seq, bl);
+ encode(addr, bl, 0);
+ encode(laggy_since, bl);
+ encode(standby_for_rank, bl);
+ encode(standby_for_name, bl);
+ encode(export_targets, bl);
}
void MDSMap::mds_info_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(7, 4, 4, bl);
- ::decode(global_id, bl);
- ::decode(name, bl);
- ::decode(rank, bl);
- ::decode(inc, bl);
- ::decode((int32_t&)(state), bl);
- ::decode(state_seq, bl);
- ::decode(addr, bl);
- ::decode(laggy_since, bl);
- ::decode(standby_for_rank, bl);
- ::decode(standby_for_name, bl);
+ decode(global_id, bl);
+ decode(name, bl);
+ decode(rank, bl);
+ decode(inc, bl);
+ decode((int32_t&)(state), bl);
+ decode(state_seq, bl);
+ decode(addr, bl);
+ decode(laggy_since, bl);
+ decode(standby_for_rank, bl);
+ decode(standby_for_name, bl);
if (struct_v >= 2)
- ::decode(export_targets, bl);
+ decode(export_targets, bl);
if (struct_v >= 5)
- ::decode(mds_features, bl);
+ decode(mds_features, bl);
if (struct_v >= 6) {
- ::decode(standby_for_fscid, bl);
+ decode(standby_for_fscid, bl);
}
if (struct_v >= 7) {
- ::decode(standby_replay, bl);
+ decode(standby_replay, bl);
}
DECODE_FINISH(bl);
}
inc.insert(std::make_pair(rank, epoch));
}
+ using ceph::encode;
if ((features & CEPH_FEATURE_PGID64) == 0) {
__u16 v = 2;
- ::encode(v, bl);
- ::encode(epoch, bl);
- ::encode(flags, bl);
- ::encode(last_failure, bl);
- ::encode(root, bl);
- ::encode(session_timeout, bl);
- ::encode(session_autoclose, bl);
- ::encode(max_file_size, bl);
- ::encode(max_mds, bl);
+ encode(v, bl);
+ encode(epoch, bl);
+ encode(flags, bl);
+ encode(last_failure, bl);
+ encode(root, bl);
+ encode(session_timeout, bl);
+ encode(session_autoclose, bl);
+ encode(max_file_size, bl);
+ encode(max_mds, bl);
__u32 n = mds_info.size();
- ::encode(n, bl);
+ encode(n, bl);
for (map<mds_gid_t, mds_info_t>::const_iterator i = mds_info.begin();
i != mds_info.end(); ++i) {
- ::encode(i->first, bl);
- ::encode(i->second, bl, features);
+ encode(i->first, bl);
+ encode(i->second, bl, features);
}
n = data_pools.size();
- ::encode(n, bl);
+ encode(n, bl);
for (const auto p: data_pools) {
n = p;
- ::encode(n, bl);
+ encode(n, bl);
}
int32_t m = cas_pool;
- ::encode(m, bl);
+ encode(m, bl);
return;
} else if ((features & CEPH_FEATURE_MDSENC) == 0) {
__u16 v = 3;
- ::encode(v, bl);
- ::encode(epoch, bl);
- ::encode(flags, bl);
- ::encode(last_failure, bl);
- ::encode(root, bl);
- ::encode(session_timeout, bl);
- ::encode(session_autoclose, bl);
- ::encode(max_file_size, bl);
- ::encode(max_mds, bl);
+ encode(v, bl);
+ encode(epoch, bl);
+ encode(flags, bl);
+ encode(last_failure, bl);
+ encode(root, bl);
+ encode(session_timeout, bl);
+ encode(session_autoclose, bl);
+ encode(max_file_size, bl);
+ encode(max_mds, bl);
__u32 n = mds_info.size();
- ::encode(n, bl);
+ encode(n, bl);
for (map<mds_gid_t, mds_info_t>::const_iterator i = mds_info.begin();
i != mds_info.end(); ++i) {
- ::encode(i->first, bl);
- ::encode(i->second, bl, features);
+ encode(i->first, bl);
+ encode(i->second, bl, features);
}
- ::encode(data_pools, bl);
- ::encode(cas_pool, bl);
+ encode(data_pools, bl);
+ encode(cas_pool, bl);
// kclient ignores everything from here
__u16 ev = 5;
- ::encode(ev, bl);
- ::encode(compat, bl);
- ::encode(metadata_pool, bl);
- ::encode(created, bl);
- ::encode(modified, bl);
- ::encode(tableserver, bl);
- ::encode(in, bl);
- ::encode(inc, bl);
- ::encode(up, bl);
- ::encode(failed, bl);
- ::encode(stopped, bl);
- ::encode(last_failure_osd_epoch, bl);
+ encode(ev, bl);
+ encode(compat, bl);
+ encode(metadata_pool, bl);
+ encode(created, bl);
+ encode(modified, bl);
+ encode(tableserver, bl);
+ encode(in, bl);
+ encode(inc, bl);
+ encode(up, bl);
+ encode(failed, bl);
+ encode(stopped, bl);
+ encode(last_failure_osd_epoch, bl);
return;
}
ENCODE_START(5, 4, bl);
- ::encode(epoch, bl);
- ::encode(flags, bl);
- ::encode(last_failure, bl);
- ::encode(root, bl);
- ::encode(session_timeout, bl);
- ::encode(session_autoclose, bl);
- ::encode(max_file_size, bl);
- ::encode(max_mds, bl);
- ::encode(mds_info, bl, features);
- ::encode(data_pools, bl);
- ::encode(cas_pool, bl);
+ encode(epoch, bl);
+ encode(flags, bl);
+ encode(last_failure, bl);
+ encode(root, bl);
+ encode(session_timeout, bl);
+ encode(session_autoclose, bl);
+ encode(max_file_size, bl);
+ encode(max_mds, bl);
+ encode(mds_info, bl, features);
+ encode(data_pools, bl);
+ encode(cas_pool, bl);
// kclient ignores everything from here
__u16 ev = 12;
- ::encode(ev, bl);
- ::encode(compat, bl);
- ::encode(metadata_pool, bl);
- ::encode(created, bl);
- ::encode(modified, bl);
- ::encode(tableserver, bl);
- ::encode(in, bl);
- ::encode(inc, bl);
- ::encode(up, bl);
- ::encode(failed, bl);
- ::encode(stopped, bl);
- ::encode(last_failure_osd_epoch, bl);
- ::encode(ever_allowed_features, bl);
- ::encode(explicitly_allowed_features, bl);
- ::encode(inline_data_enabled, bl);
- ::encode(enabled, bl);
- ::encode(fs_name, bl);
- ::encode(damaged, bl);
- ::encode(balancer, bl);
- ::encode(standby_count_wanted, bl);
+ encode(ev, bl);
+ encode(compat, bl);
+ encode(metadata_pool, bl);
+ encode(created, bl);
+ encode(modified, bl);
+ encode(tableserver, bl);
+ encode(in, bl);
+ encode(inc, bl);
+ encode(up, bl);
+ encode(failed, bl);
+ encode(stopped, bl);
+ encode(last_failure_osd_epoch, bl);
+ encode(ever_allowed_features, bl);
+ encode(explicitly_allowed_features, bl);
+ encode(inline_data_enabled, bl);
+ encode(enabled, bl);
+ encode(fs_name, bl);
+ encode(damaged, bl);
+ encode(balancer, bl);
+ encode(standby_count_wanted, bl);
ENCODE_FINISH(bl);
}
cached_up_features = 0;
DECODE_START_LEGACY_COMPAT_LEN_16(5, 4, 4, p);
- ::decode(epoch, p);
- ::decode(flags, p);
- ::decode(last_failure, p);
- ::decode(root, p);
- ::decode(session_timeout, p);
- ::decode(session_autoclose, p);
- ::decode(max_file_size, p);
- ::decode(max_mds, p);
- ::decode(mds_info, p);
+ decode(epoch, p);
+ decode(flags, p);
+ decode(last_failure, p);
+ decode(root, p);
+ decode(session_timeout, p);
+ decode(session_autoclose, p);
+ decode(max_file_size, p);
+ decode(max_mds, p);
+ decode(mds_info, p);
if (struct_v < 3) {
__u32 n;
- ::decode(n, p);
+ decode(n, p);
while (n--) {
__u32 m;
- ::decode(m, p);
+ decode(m, p);
data_pools.push_back(m);
}
__s32 s;
- ::decode(s, p);
+ decode(s, p);
cas_pool = s;
} else {
- ::decode(data_pools, p);
- ::decode(cas_pool, p);
+ decode(data_pools, p);
+ decode(cas_pool, p);
}
// kclient ignores everything from here
__u16 ev = 1;
if (struct_v >= 2)
- ::decode(ev, p);
+ decode(ev, p);
if (ev >= 3)
- ::decode(compat, p);
+ decode(compat, p);
else
compat = get_mdsmap_compat_set_base();
if (ev < 5) {
__u32 n;
- ::decode(n, p);
+ decode(n, p);
metadata_pool = n;
} else {
- ::decode(metadata_pool, p);
- }
- ::decode(created, p);
- ::decode(modified, p);
- ::decode(tableserver, p);
- ::decode(in, p);
- ::decode(inc, p);
- ::decode(up, p);
- ::decode(failed, p);
- ::decode(stopped, p);
+ decode(metadata_pool, p);
+ }
+ decode(created, p);
+ decode(modified, p);
+ decode(tableserver, p);
+ decode(in, p);
+ decode(inc, p);
+ decode(up, p);
+ decode(failed, p);
+ decode(stopped, p);
if (ev >= 4)
- ::decode(last_failure_osd_epoch, p);
+ decode(last_failure_osd_epoch, p);
if (ev >= 6) {
if (ev < 10) {
// previously this was a bool about snaps, not a flag map
bool flag;
- ::decode(flag, p);
+ decode(flag, p);
ever_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
ever_allowed_features |= CEPH_MDSMAP_ALLOW_MULTIMDS|CEPH_MDSMAP_ALLOW_DIRFRAGS;
- ::decode(flag, p);
+ decode(flag, p);
explicitly_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
if (max_mds > 1) {
set_multimds_allowed();
}
} else {
- ::decode(ever_allowed_features, p);
- ::decode(explicitly_allowed_features, p);
+ decode(ever_allowed_features, p);
+ decode(explicitly_allowed_features, p);
}
} else {
ever_allowed_features = CEPH_MDSMAP_ALLOW_CLASSICS;
}
}
if (ev >= 7)
- ::decode(inline_data_enabled, p);
+ decode(inline_data_enabled, p);
if (ev >= 8) {
assert(struct_v >= 5);
- ::decode(enabled, p);
- ::decode(fs_name, p);
+ decode(enabled, p);
+ decode(fs_name, p);
} else {
if (epoch > 1) {
// If an MDS has ever been started, epoch will be greater than 1,
}
if (ev >= 9) {
- ::decode(damaged, p);
+ decode(damaged, p);
}
if (ev >= 11) {
- ::decode(balancer, p);
+ decode(balancer, p);
}
if (ev >= 12) {
- ::decode(standby_count_wanted, p);
+ decode(standby_count_wanted, p);
}
DECODE_FINISH(p);
assert(is_active());
bufferlist bl;
- ::encode(version, bl);
+ encode(version, bl);
encode_state(bl);
committing_version = version;
bufferlist::iterator p = bl.begin();
try {
- ::decode(version, p);
+ decode(version, p);
projected_version = committed_version = version;
dout(10) << "load_2 loaded v" << version << dendl;
decode_state(p);
void encode_state(bufferlist& bl) const override {
encode_server_state(bl);
- ::encode(pending_for_mds, bl);
+ encode(pending_for_mds, bl);
}
void decode_state(bufferlist::iterator& bl) override {
decode_server_state(bl);
- ::decode(pending_for_mds, bl);
+ decode(pending_for_mds, bl);
}
// recovery
}
bufferlist final_bl;
dirfrag_t df = cur->dirfrag();
- ::encode(df, final_bl);
- ::encode(start, final_bl);
+ encode(df, final_bl);
+ encode(start, final_bl);
final_bl.claim_append(tracebl);
prep->add_trace(final_bl);
}
dir, // recur start point
exported_client_map,
now);
- ::encode(exported_client_map, req->client_map,
+ encode(exported_client_map, req->client_map,
mds->mdsmap->get_up_features());
// add bounds to message
dout(20) << " did replicate_relax_locks, now " << *in << dendl;
}
- ::encode(in->inode.ino, enc_state);
- ::encode(in->last, enc_state);
+ encode(in->inode.ino, enc_state);
+ encode(in->last, enc_state);
in->encode_export(enc_state);
// caps
// encode caps
map<client_t,Capability::Export> cap_map;
in->export_client_caps(cap_map);
- ::encode(cap_map, bl);
+ encode(cap_map, bl);
if (auth_cap) {
- ::encode(in->get_mds_caps_wanted(), bl);
+ encode(in->get_mds_caps_wanted(), bl);
in->state_set(CInode::STATE_EXPORTINGCAPS);
in->get(CInode::PIN_EXPORTINGCAPS);
// dir
dirfrag_t df = dir->dirfrag();
- ::encode(df, exportbl);
+ encode(df, exportbl);
dir->encode_export(exportbl);
__u32 nden = dir->items.size();
- ::encode(nden, exportbl);
+ encode(nden, exportbl);
// dentries
list<CDir*> subdirs;
dout(7) << "encode_export_dir exporting " << *dn << dendl;
// dn name
- ::encode(dn->name, exportbl);
- ::encode(dn->last, exportbl);
+ encode(dn->name, exportbl);
+ encode(dn->last, exportbl);
// state
dn->encode_export(exportbl);
inodeno_t ino = dn->get_linkage()->get_remote_ino();
unsigned char d_type = dn->get_linkage()->get_remote_d_type();
- ::encode(ino, exportbl);
- ::encode(d_type, exportbl);
+ encode(ino, exportbl);
+ encode(d_type, exportbl);
continue;
}
assert(it->second.tid == m->get_tid());
bufferlist::iterator bp = m->imported_caps.begin();
- ::decode(it->second.peer_imported, bp);
+ decode(it->second.peer_imported, bp);
it->second.state = EXPORT_LOGGINGFINISH;
assert (g_conf->mds_kill_export_at != 9);
++p) {
bufferlist::iterator q = p->begin();
dirfrag_t df;
- ::decode(df, q);
+ decode(df, q);
char start;
- ::decode(start, q);
+ decode(start, q);
dout(10) << " trace from " << df << " start " << start << " len " << p->length() << dendl;
CDir *cur = 0;
// new client sessions, open these after we journal
// include imported sessions in EImportStart
bufferlist::iterator cmp = m->client_map.begin();
- ::decode(onlogged->imported_client_map, cmp);
+ decode(onlogged->imported_client_map, cmp);
assert(cmp.end());
le->cmapv = mds->server->prepare_force_open_sessions(onlogged->imported_client_map, onlogged->sseqmap);
le->client_map.claim(m->client_map);
//assert(dir->replica_map.size() < 2 || mds->get_nodeid() != 0);
MExportDirAck *ack = new MExportDirAck(dir->dirfrag(), it->second.tid);
- ::encode(imported_caps, ack->imported_caps);
+ encode(imported_caps, ack->imported_caps);
mds->send_message_mds(ack, from);
assert (g_conf->mds_kill_import_at != 8);
inodeno_t ino;
snapid_t last;
- ::decode(ino, blp);
- ::decode(last, blp);
+ decode(ino, blp);
+ decode(last, blp);
bool added = false;
CInode *in = cache->get_inode(ino, last);
map<CInode*, map<client_t,Capability::Export> >& peer_exports)
{
map<client_t,Capability::Export> cap_map;
- ::decode(cap_map, blp);
+ decode(cap_map, blp);
if (auth_cap)
- ::decode(in->get_mds_caps_wanted(), blp);
+ decode(in->get_mds_caps_wanted(), blp);
if (!cap_map.empty() ||
(auth_cap && (in->get_caps_wanted() & ~CEPH_CAP_PIN))) {
peer_exports[in].swap(cap_map);
{
// set up dir
dirfrag_t df;
- ::decode(df, blp);
+ decode(df, blp);
CInode *diri = cache->get_inode(df.ino);
assert(diri);
// contents
__u32 nden;
- ::decode(nden, blp);
+ decode(nden, blp);
for (; nden>0; nden--) {
num_imported++;
// dentry
string dname;
snapid_t last;
- ::decode(dname, blp);
- ::decode(last, blp);
+ decode(dname, blp);
+ decode(last, blp);
CDentry *dn = dir->lookup_exact_snap(dname, last);
if (!dn)
// points to...
char icode;
- ::decode(icode, blp);
+ decode(icode, blp);
if (icode == 'N') {
// null dentry
// remote link
inodeno_t ino;
unsigned char d_type;
- ::decode(ino, blp);
- ::decode(d_type, blp);
+ decode(ino, blp);
+ decode(d_type, blp);
if (dn->get_linkage()->is_remote()) {
assert(dn->get_linkage()->get_remote_ino() == ino);
} else {
void PurgeItem::encode(bufferlist &bl) const
{
ENCODE_START(1, 1, bl);
- ::encode((uint8_t)action, bl);
- ::encode(ino, bl);
- ::encode(size, bl);
- ::encode(layout, bl, CEPH_FEATURE_FS_FILE_LAYOUT_V2);
- ::encode(old_pools, bl);
- ::encode(snapc, bl);
- ::encode(fragtree, bl);
+ encode((uint8_t)action, bl);
+ encode(ino, bl);
+ encode(size, bl);
+ encode(layout, bl, CEPH_FEATURE_FS_FILE_LAYOUT_V2);
+ encode(old_pools, bl);
+ encode(snapc, bl);
+ encode(fragtree, bl);
ENCODE_FINISH(bl);
}
void PurgeItem::decode(bufferlist::iterator &p)
{
DECODE_START(1, p);
- ::decode((uint8_t&)action, p);
- ::decode(ino, p);
- ::decode(size, p);
- ::decode(layout, p);
- ::decode(old_pools, p);
- ::decode(snapc, p);
- ::decode(fragtree, p);
+ decode((uint8_t&)action, p);
+ decode(ino, p);
+ decode(size, p);
+ decode(layout, p);
+ decode(old_pools, p);
+ decode(snapc, p);
+ decode(fragtree, p);
DECODE_FINISH(p);
}
bufferlist bl;
- ::encode(pi, bl);
+ encode(pi, bl);
journaler.append_entry(bl);
journaler.wait_for_flush(completion);
PurgeItem item;
bufferlist::iterator q = bl.begin();
try {
- ::decode(item, q);
+ decode(item, q);
} catch (const buffer::error &err) {
derr << "Decode error at read_pos=0x" << std::hex
<< journaler.get_read_pos() << dendl;
if (s == LOCK_MIX || s == LOCK_MIX_LOCK || s == LOCK_MIX_SYNC)
mark_need_recover();
- ::encode(s, bl);
+ using ceph::encode;
+ encode(s, bl);
}
void decode_state_rejoin(bufferlist::iterator& p, list<MDSInternalContextBase*>& waiters, bool survivor) {
int numlocks;
ceph_filelock lock;
bufferlist::iterator p = locks.begin();
- ::decode(numlocks, p);
+ decode(numlocks, p);
for (int i = 0; i < numlocks; ++i) {
- ::decode(lock, p);
+ decode(lock, p);
lock.client = client;
in->get_fcntl_lock_state()->held_locks.insert(pair<uint64_t, ceph_filelock>(lock.start, lock));
++in->get_fcntl_lock_state()->client_held_lock_counts[client];
}
- ::decode(numlocks, p);
+ decode(numlocks, p);
for (int i = 0; i < numlocks; ++i) {
- ::decode(lock, p);
+ decode(lock, p);
lock.client = client;
in->get_flock_lock_state()->held_locks.insert(pair<uint64_t, ceph_filelock> (lock.start, lock));
++in->get_flock_lock_state()->client_held_lock_counts[client];
e.seq = 0;
e.mask = -1;
e.duration_ms = -1;
- ::encode(e, bl);
+ encode(e, bl);
dout(20) << "encode_infinite_lease " << e << dendl;
}
e.seq = 0;
e.mask = 0;
e.duration_ms = 0;
- ::encode(e, bl);
+ encode(e, bl);
dout(20) << "encode_null_lease " << e << dendl;
}
dir->encode_dirstat(bl, whoami);
dout(20) << "set_trace_dist added dir " << *dir << dendl;
- ::encode(dn->get_name(), bl);
+ encode(dn->get_name(), bl);
if (snapid == CEPH_NOSNAP)
mds->locker->issue_client_lease(dn, client, bl, now, session);
else
MClientReply *reply = new MClientReply(req, 0);
if (created != inodeno_t()) {
bufferlist extra;
- ::encode(created, extra);
+ encode(created, extra);
reply->set_extra_bl(extra);
}
req->get_connection()->send_message(reply);
// xattrs on new inode?
map<string,bufferptr> xattrs;
- ::decode(xattrs, p);
+ decode(xattrs, p);
for (map<string,bufferptr>::iterator p = xattrs.begin(); p != xattrs.end(); ++p) {
dout(10) << "prepare_new_inode setting xattr " << p->first << dendl;
in->xattrs[p->first] = p->second;
if (mdr->client_request->get_connection()->has_feature(CEPH_FEATURE_REPLY_CREATE_INODE)) {
dout(10) << "adding ino to reply to indicate inode was created" << dendl;
// add the file created flag onto the reply if create_flags features is supported
- ::encode(in->inode.ino, mdr->reply_extra_bl);
+ encode(in->inode.ino, mdr->reply_extra_bl);
}
journal_and_reply(mdr, in, dn, le, fin);
// dentry
dout(12) << "including dn " << *dn << dendl;
- ::encode(dn->name, dnbl);
+ encode(dn->name, dnbl);
mds->locker->issue_client_lease(dn, client, dnbl, now, mdr->session);
// inode
}
// finish final blob
- ::encode(numfiles, dirbl);
- ::encode(flags, dirbl);
+ encode(numfiles, dirbl);
+ encode(flags, dirbl);
dirbl.claim_append(dnbl);
// yay, reply
lock_state->look_for_lock(checking_lock);
bufferlist lock_bl;
- ::encode(checking_lock, lock_bl);
+ encode(checking_lock, lock_bl);
mdr->reply_extra_bl = lock_bl;
respond_to_request(mdr, 0);
rollback.old_dir_mtime = pf->fragstat.mtime;
rollback.old_dir_rctime = pf->rstat.rctime;
rollback.was_inc = inc;
- ::encode(rollback, le->rollback);
+ encode(rollback, le->rollback);
mdr->more()->rollback_bl = le->rollback;
pi->ctime = mdr->get_op_stamp();
{
link_rollback rollback;
bufferlist::iterator p = rbl.begin();
- ::decode(rollback, p);
+ decode(rollback, p);
dout(10) << "do_link_rollback on " << rollback.reqid
<< (rollback.was_inc ? " inc":" dec")
rollback.src_dname = dn->name;
rollback.dest_dir = straydn->get_dir()->dirfrag();
rollback.dest_dname = straydn->name;
- ::encode(rollback, mdr->more()->rollback_bl);
+ encode(rollback, mdr->more()->rollback_bl);
dout(20) << " rollback is " << mdr->more()->rollback_bl.length() << " bytes" << dendl;
// set up commit waiter
rmdir_rollback rollback;
bufferlist::iterator p = rbl.begin();
- ::decode(rollback, p);
+ decode(rollback, p);
dout(10) << "do_rmdir_rollback on " << rollback.reqid << dendl;
mdcache->add_rollback(rollback.reqid, master); // need to finish this update before resolve finishes
bufferlist::iterator blp = mdr->more()->inode_import.begin();
// imported caps
- ::decode(mdr->more()->imported_client_map, blp);
- ::encode(mdr->more()->imported_client_map, *client_map_bl,
+ decode(mdr->more()->imported_client_map, blp);
+ encode(mdr->more()->imported_client_map, *client_map_bl,
mds->mdsmap->get_up_features());
prepare_force_open_sessions(mdr->more()->imported_client_map, mdr->more()->sseq_map);
}
mdr->more()->inode_import.clear();
- ::encode(imported_caps, mdr->more()->inode_import);
+ encode(imported_caps, mdr->more()->inode_import);
/* hack: add an auth pin for each xlock we hold. These were
* remote xlocks previously but now they're local and
rollback.stray.dirfrag_old_rctime = straydn->get_dir()->get_projected_fnode()->rstat.rctime;
rollback.stray.dname = straydn->name;
}
- ::encode(rollback, mdr->more()->rollback_bl);
+ encode(rollback, mdr->more()->rollback_bl);
dout(20) << " rollback is " << mdr->more()->rollback_bl.length() << " bytes" << dendl;
// journal.
(*p)->state_clear(CDir::STATE_EXPORTBOUND);
if (reply) {
- ::encode(exported_client_map, reply->inode_export, mds->mdsmap->get_up_features());
+ encode(exported_client_map, reply->inode_export, mds->mdsmap->get_up_features());
reply->inode_export.claim_append(inodebl);
reply->inode_export_v = srcdnl->get_inode()->inode.version;
}
map<client_t,Capability::Import> peer_imported;
bufferlist::iterator bp = mdr->more()->inode_import.begin();
- ::decode(peer_imported, bp);
+ decode(peer_imported, bp);
dout(10) << " finishing inode export on " << *destdnl->get_inode() << dendl;
mdcache->migrator->finish_export_inode(destdnl->get_inode(),
{
rename_rollback rollback;
bufferlist::iterator p = rbl.begin();
- ::decode(rollback, p);
+ decode(rollback, p);
dout(10) << "do_rename_rollback on " << rollback.reqid << dendl;
// need to finish this update before sending resolve to claim the subtree
if (int(start_len + snap_name.length() + sizeof(__u32) + sizeof(LeaseStat)) > max_bytes)
break;
- ::encode(snap_name, dnbl);
+ encode(snap_name, dnbl);
encode_infinite_lease(dnbl);
int r = diri->encode_inodestat(dnbl, mdr->session, realm, p->first, max_bytes - (int)dnbl.length());
++num;
}
- ::encode(num, dirbl);
+ encode(num, dirbl);
__u16 flags = 0;
if (p == infomap.end()) {
flags = CEPH_READDIR_FRAG_END;
if (last_snapid == 0)
flags |= CEPH_READDIR_FRAG_COMPLETE;
}
- ::encode(flags, dirbl);
+ encode(flags, dirbl);
dirbl.claim_append(dnbl);
mdr->reply_extra_bl = dirbl;
version_t stid = mdr->more()->stid;
snapid_t snapid;
bufferlist::iterator p = mdr->more()->snapidbl.begin();
- ::decode(snapid, p);
+ decode(snapid, p);
dout(10) << " stid " << stid << " snapid " << snapid << dendl;
// journal
version_t stid = mdr->more()->stid;
bufferlist::iterator p = mdr->more()->snapidbl.begin();
snapid_t seq;
- ::decode(seq, p);
+ decode(seq, p);
dout(10) << " stid is " << stid << ", seq is " << seq << dendl;
// journal
snapid_t stid = mdr->more()->stid;
bufferlist::iterator p = mdr->more()->snapidbl.begin();
snapid_t seq;
- ::decode(seq, p);
+ decode(seq, p);
diri->pop_and_dirty_projected_inode(mdr->ls);
mdr->apply();
{
bufferlist::iterator q = header_bl.begin();
DECODE_START(1, q)
- ::decode(version, q);
+ decode(version, q);
DECODE_FINISH(q);
}
bufferlist *header_bl)
{
ENCODE_START(1, 1, *header_bl);
- ::encode(version, *header_bl);
+ encode(version, *header_bl);
ENCODE_FINISH(*header_bl);
}
{
utime_t now = ceph_clock_now();
uint64_t pre;
- ::decode(pre, p);
+ decode(pre, p);
if (pre == (uint64_t)-1) {
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, p);
assert(struct_v >= 2);
- ::decode(version, p);
+ decode(version, p);
while (!p.end()) {
entity_inst_t inst;
- ::decode(inst.name, p);
+ decode(inst.name, p);
Session *s = get_or_add_session(inst);
if (s->is_closed())
s->set_state(Session::STATE_OPEN);
// this is a meaningless upper bound. can be ignored.
__u32 n;
- ::decode(n, p);
+ decode(n, p);
while (n-- && !p.end()) {
bufferlist::iterator p2 = p;
// encode/decode
void encode(bufferlist& bl) const {
ENCODE_START(2, 2, bl);
- ::encode(state, bl);
+ encode(state, bl);
if (have_more())
- ::encode(more()->gather_set, bl);
+ encode(more()->gather_set, bl);
else
- ::encode(empty_gather_set, bl);
+ encode(empty_gather_set, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& p) {
DECODE_START(2, p);
- ::decode(state, p);
+ decode(state, p);
set<__s32> g;
- ::decode(g, p);
+ decode(g, p);
if (!g.empty())
more()->gather_set.swap(g);
DECODE_FINISH(p);
}
void encode_state_for_replica(bufferlist& bl) const {
__s16 s = get_replica_state();
- ::encode(s, bl);
+ using ceph::encode;
+ encode(s, bl);
}
void decode_state(bufferlist::iterator& p, bool is_new=true) {
+ using ceph::decode;
__s16 s;
- ::decode(s, p);
+ decode(s, p);
if (is_new)
state = s;
}
void decode_state_rejoin(bufferlist::iterator& p, list<MDSInternalContextBase*>& waiters, bool survivor) {
__s16 s;
- ::decode(s, p);
+ using ceph::decode;
+ decode(s, p);
set_state_rejoin(s, waiters, survivor);
}
version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
bufferlist bl;
__u32 op = TABLE_OP_CREATE;
- ::encode(op, bl);
- ::encode(dirino, bl);
- ::encode(name, bl);
- ::encode(stamp, bl);
+ encode(op, bl);
+ encode(dirino, bl);
+ encode(name, bl);
+ encode(stamp, bl);
_prepare(bl, pstid, pbl, onfinish);
}
void prepare_create_realm(inodeno_t ino, version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
bufferlist bl;
__u32 op = TABLE_OP_CREATE;
- ::encode(op, bl);
- ::encode(ino, bl);
+ encode(op, bl);
+ encode(ino, bl);
_prepare(bl, pstid, pbl, onfinish);
}
void prepare_destroy(inodeno_t ino, snapid_t snapid, version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
bufferlist bl;
__u32 op = TABLE_OP_DESTROY;
- ::encode(op, bl);
- ::encode(ino, bl);
- ::encode(snapid, bl);
+ encode(op, bl);
+ encode(ino, bl);
+ encode(snapid, bl);
_prepare(bl, pstid, pbl, onfinish);
}
version_t *pstid, MDSInternalContextBase *onfinish) {
bufferlist bl;
__u32 op = TABLE_OP_UPDATE;
- ::encode(op, bl);
- ::encode(ino, bl);
- ::encode(snapid, bl);
- ::encode(name, bl);
- ::encode(stamp, bl);
+ encode(op, bl);
+ encode(ino, bl);
+ encode(snapid, bl);
+ encode(name, bl);
+ encode(stamp, bl);
_prepare(bl, pstid, NULL, onfinish);
}
};
info.my_snaps.push_back(p->first);
dout(10) << "build_snap_trace my_snaps " << info.my_snaps << dendl;
- ::encode(info, snapbl);
+ encode(info, snapbl);
if (parent)
parent->build_snap_trace(snapbl);
void SnapServer::_prepare(bufferlist &bl, uint64_t reqid, mds_rank_t bymds)
{
+ using ceph::decode;
+ using ceph::encode;
bufferlist::iterator p = bl.begin();
__u32 op;
- ::decode(op, p);
+ decode(op, p);
switch (op) {
case TABLE_OP_CREATE:
{
SnapInfo info;
- ::decode(info.ino, p);
+ decode(info.ino, p);
if (!p.end()) {
- ::decode(info.name, p);
- ::decode(info.stamp, p);
+ decode(info.name, p);
+ decode(info.stamp, p);
info.snapid = ++last_snap;
pending_update[version] = info;
dout(10) << "prepare v" << version << " create " << info << dendl;
dout(10) << "prepare v" << version << " noop" << dendl;
}
bl.clear();
- ::encode(last_snap, bl);
+ encode(last_snap, bl);
}
break;
{
inodeno_t ino;
snapid_t snapid;
- ::decode(ino, p); // not used, currently.
- ::decode(snapid, p);
+ decode(ino, p); // not used, currently.
+ decode(snapid, p);
// bump last_snap... we use it as a version value on the snaprealm.
++last_snap;
dout(10) << "prepare v" << version << " destroy " << snapid << " seq " << last_snap << dendl;
bl.clear();
- ::encode(last_snap, bl);
+ encode(last_snap, bl);
}
break;
case TABLE_OP_UPDATE:
{
SnapInfo info;
- ::decode(info.ino, p);
- ::decode(info.snapid, p);
- ::decode(info.name, p);
- ::decode(info.stamp, p);
+ decode(info.ino, p);
+ decode(info.snapid, p);
+ decode(info.name, p);
+ decode(info.stamp, p);
// bump last_snap... we use it as a version value on the snaprealm.
++last_snap;
void SnapServer::_get_reply_buffer(version_t tid, bufferlist *pbl) const
{
+ using ceph::encode;
auto p = pending_update.find(tid);
if (p != pending_update.end()) {
if (pbl && !snaps.count(p->second.snapid)) // create
- ::encode(p->second.snapid, *pbl);
+ encode(p->second.snapid, *pbl);
return;
}
auto q = pending_destroy.find(tid);
if (q != pending_destroy.end()) {
if (pbl)
- ::encode(q->second.second, *pbl);
+ encode(q->second.second, *pbl);
return;
}
auto r = pending_noop.find(tid);
if (r != pending_noop.end()) {
if (pbl)
- ::encode(last_snap, *pbl);
+ encode(last_snap, *pbl);
return;
}
assert (0 == "tid not found");
void SnapServer::_server_update(bufferlist& bl)
{
+ using ceph::decode;
bufferlist::iterator p = bl.begin();
map<int, vector<snapid_t> > purge;
- ::decode(purge, p);
+ decode(purge, p);
dout(7) << "_server_update purged " << purge << dendl;
for (map<int, vector<snapid_t> >::iterator p = purge.begin();
if (!all_purged.empty()) {
// prepare to remove from need_to_purge list
bufferlist bl;
- ::encode(all_purged, bl);
+ using ceph::encode;
+ encode(all_purged, bl);
do_server_update(bl);
}
void reset_state() override;
void encode_server_state(bufferlist& bl) const override {
ENCODE_START(3, 3, bl);
- ::encode(last_snap, bl);
- ::encode(snaps, bl);
- ::encode(need_to_purge, bl);
- ::encode(pending_update, bl);
- ::encode(pending_destroy, bl);
- ::encode(pending_noop, bl);
+ encode(last_snap, bl);
+ encode(snaps, bl);
+ encode(need_to_purge, bl);
+ encode(pending_update, bl);
+ encode(pending_destroy, bl);
+ encode(pending_noop, bl);
ENCODE_FINISH(bl);
}
void decode_server_state(bufferlist::iterator& bl) override {
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
- ::decode(last_snap, bl);
- ::decode(snaps, bl);
- ::decode(need_to_purge, bl);
- ::decode(pending_update, bl);
+ decode(last_snap, bl);
+ decode(snaps, bl);
+ decode(need_to_purge, bl);
+ decode(pending_update, bl);
if (struct_v >= 2)
- ::decode(pending_destroy, bl);
+ decode(pending_destroy, bl);
else {
map<version_t, snapid_t> t;
- ::decode(t, bl);
+ decode(t, bl);
for (map<version_t, snapid_t>::iterator p = t.begin(); p != t.end(); ++p)
pending_destroy[p->first].first = p->second;
}
- ::decode(pending_noop, bl);
+ decode(pending_noop, bl);
DECODE_FINISH(bl);
}
}
void add_orig_frag(frag_t df, dirfrag_rollback *drb=NULL) {
+ using ceph::encode;
orig_frags.push_back(df);
if (drb)
- ::encode(*drb, rollback);
+ encode(*drb, rollback);
}
EMetaBlob *get_metablob() override { return &metablob; }
// if this changes, update the versioning in encode for it!
void _encode_bits(uint64_t features) const {
+ using ceph::encode;
if (!dn_decoded) return;
- ::encode(dfull, dnbl, features);
- ::encode(dremote, dnbl);
- ::encode(dnull, dnbl);
+ encode(dfull, dnbl, features);
+ encode(dremote, dnbl);
+ encode(dnull, dnbl);
}
void _decode_bits() const {
+ using ceph::decode;
if (dn_decoded) return;
bufferlist::iterator p = dnbl.begin();
- ::decode(dfull, p);
- ::decode(dremote, p);
- ::decode(dnull, p);
+ decode(dfull, p);
+ decode(dremote, p);
+ decode(dnull, p);
dn_decoded = true;
}
public:
void encode(bufferlist& bl) const {
- ::encode(held_locks, bl);
- ::encode(client_held_lock_counts, bl);
+ using ceph::encode;
+ encode(held_locks, bl);
+ encode(client_held_lock_counts, bl);
}
void decode(bufferlist::iterator& bl) {
- ::decode(held_locks, bl);
- ::decode(client_held_lock_counts, bl);
+ using ceph::decode;
+ decode(held_locks, bl);
+ decode(client_held_lock_counts, bl);
}
bool empty() const {
return held_locks.empty() && waiting_locks.empty() &&
void inode_backpointer_t::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(dirino, bl);
- ::encode(dname, bl);
- ::encode(version, bl);
+ encode(dirino, bl);
+ encode(dname, bl);
+ encode(version, bl);
ENCODE_FINISH(bl);
}
void inode_backpointer_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(dirino, bl);
- ::decode(dname, bl);
- ::decode(version, bl);
+ decode(dirino, bl);
+ decode(dname, bl);
+ decode(version, bl);
DECODE_FINISH(bl);
}
void inode_backpointer_t::decode_old(bufferlist::iterator& bl)
{
- ::decode(dirino, bl);
- ::decode(dname, bl);
- ::decode(version, bl);
+ using ceph::decode;
+ decode(dirino, bl);
+ decode(dname, bl);
+ decode(version, bl);
}
void inode_backpointer_t::dump(Formatter *f) const
void inode_backtrace_t::encode(bufferlist& bl) const
{
ENCODE_START(5, 4, bl);
- ::encode(ino, bl);
- ::encode(ancestors, bl);
- ::encode(pool, bl);
- ::encode(old_pools, bl);
+ encode(ino, bl);
+ encode(ancestors, bl);
+ encode(pool, bl);
+ encode(old_pools, bl);
ENCODE_FINISH(bl);
}
DECODE_START_LEGACY_COMPAT_LEN(5, 4, 4, bl);
if (struct_v < 3)
return; // sorry, the old data was crap
- ::decode(ino, bl);
+ decode(ino, bl);
if (struct_v >= 4) {
- ::decode(ancestors, bl);
+ decode(ancestors, bl);
} else {
__u32 n;
- ::decode(n, bl);
+ decode(n, bl);
while (n--) {
ancestors.push_back(inode_backpointer_t());
ancestors.back().decode_old(bl);
}
}
if (struct_v >= 5) {
- ::decode(pool, bl);
- ::decode(old_pools, bl);
+ decode(pool, bl);
+ decode(old_pools, bl);
}
DECODE_FINISH(bl);
}
void EMetaBlob::fullbit::encode(bufferlist& bl, uint64_t features) const {
ENCODE_START(8, 5, bl);
- ::encode(dn, bl);
- ::encode(dnfirst, bl);
- ::encode(dnlast, bl);
- ::encode(dnv, bl);
- ::encode(inode, bl, features);
- ::encode(xattrs, bl);
+ encode(dn, bl);
+ encode(dnfirst, bl);
+ encode(dnlast, bl);
+ encode(dnv, bl);
+ encode(inode, bl, features);
+ encode(xattrs, bl);
if (inode.is_symlink())
- ::encode(symlink, bl);
+ encode(symlink, bl);
if (inode.is_dir()) {
- ::encode(dirfragtree, bl);
- ::encode(snapbl, bl);
+ encode(dirfragtree, bl);
+ encode(snapbl, bl);
}
- ::encode(state, bl);
+ encode(state, bl);
if (old_inodes.empty()) {
- ::encode(false, bl);
+ encode(false, bl);
} else {
- ::encode(true, bl);
- ::encode(old_inodes, bl, features);
+ encode(true, bl);
+ encode(old_inodes, bl, features);
}
if (!inode.is_dir())
- ::encode(snapbl, bl);
- ::encode(oldest_snap, bl);
+ encode(snapbl, bl);
+ encode(oldest_snap, bl);
ENCODE_FINISH(bl);
}
void EMetaBlob::fullbit::decode(bufferlist::iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(7, 5, 5, bl);
- ::decode(dn, bl);
- ::decode(dnfirst, bl);
- ::decode(dnlast, bl);
- ::decode(dnv, bl);
- ::decode(inode, bl);
- ::decode(xattrs, bl);
+ decode(dn, bl);
+ decode(dnfirst, bl);
+ decode(dnlast, bl);
+ decode(dnv, bl);
+ decode(inode, bl);
+ decode(xattrs, bl);
if (inode.is_symlink())
- ::decode(symlink, bl);
+ decode(symlink, bl);
if (inode.is_dir()) {
- ::decode(dirfragtree, bl);
- ::decode(snapbl, bl);
+ decode(dirfragtree, bl);
+ decode(snapbl, bl);
if ((struct_v == 2) || (struct_v == 3)) {
bool dir_layout_exists;
- ::decode(dir_layout_exists, bl);
+ decode(dir_layout_exists, bl);
if (dir_layout_exists) {
__u8 dir_struct_v;
- ::decode(dir_struct_v, bl); // default_file_layout version
- ::decode(inode.layout, bl); // and actual layout, that we care about
+ decode(dir_struct_v, bl); // default_file_layout version
+ decode(inode.layout, bl); // and actual layout, that we care about
}
}
}
if (struct_v >= 6) {
- ::decode(state, bl);
+ decode(state, bl);
} else {
bool dirty;
- ::decode(dirty, bl);
+ decode(dirty, bl);
state = dirty ? EMetaBlob::fullbit::STATE_DIRTY : 0;
}
if (struct_v >= 3) {
bool old_inodes_present;
- ::decode(old_inodes_present, bl);
+ decode(old_inodes_present, bl);
if (old_inodes_present) {
- ::decode(old_inodes, bl);
+ decode(old_inodes, bl);
}
}
if (!inode.is_dir()) {
if (struct_v >= 7)
- ::decode(snapbl, bl);
+ decode(snapbl, bl);
}
if (struct_v >= 8)
- ::decode(oldest_snap, bl);
+ decode(oldest_snap, bl);
else
oldest_snap = CEPH_NOSNAP;
void EMetaBlob::remotebit::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(dn, bl);
- ::encode(dnfirst, bl);
- ::encode(dnlast, bl);
- ::encode(dnv, bl);
- ::encode(ino, bl);
- ::encode(d_type, bl);
- ::encode(dirty, bl);
+ encode(dn, bl);
+ encode(dnfirst, bl);
+ encode(dnlast, bl);
+ encode(dnv, bl);
+ encode(ino, bl);
+ encode(d_type, bl);
+ encode(dirty, bl);
ENCODE_FINISH(bl);
}
void EMetaBlob::remotebit::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(dn, bl);
- ::decode(dnfirst, bl);
- ::decode(dnlast, bl);
- ::decode(dnv, bl);
- ::decode(ino, bl);
- ::decode(d_type, bl);
- ::decode(dirty, bl);
+ decode(dn, bl);
+ decode(dnfirst, bl);
+ decode(dnlast, bl);
+ decode(dnv, bl);
+ decode(ino, bl);
+ decode(d_type, bl);
+ decode(dirty, bl);
DECODE_FINISH(bl);
}
void EMetaBlob::nullbit::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(dn, bl);
- ::encode(dnfirst, bl);
- ::encode(dnlast, bl);
- ::encode(dnv, bl);
- ::encode(dirty, bl);
+ encode(dn, bl);
+ encode(dnfirst, bl);
+ encode(dnlast, bl);
+ encode(dnv, bl);
+ encode(dirty, bl);
ENCODE_FINISH(bl);
}
void EMetaBlob::nullbit::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(dn, bl);
- ::decode(dnfirst, bl);
- ::decode(dnlast, bl);
- ::decode(dnv, bl);
- ::decode(dirty, bl);
+ decode(dn, bl);
+ decode(dnfirst, bl);
+ decode(dnlast, bl);
+ decode(dnv, bl);
+ decode(dirty, bl);
DECODE_FINISH(bl);
}
void EMetaBlob::dirlump::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(2, 2, bl);
- ::encode(fnode, bl);
- ::encode(state, bl);
- ::encode(nfull, bl);
- ::encode(nremote, bl);
- ::encode(nnull, bl);
+ encode(fnode, bl);
+ encode(state, bl);
+ encode(nfull, bl);
+ encode(nremote, bl);
+ encode(nnull, bl);
_encode_bits(features);
- ::encode(dnbl, bl);
+ encode(dnbl, bl);
ENCODE_FINISH(bl);
}
void EMetaBlob::dirlump::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl)
- ::decode(fnode, bl);
- ::decode(state, bl);
- ::decode(nfull, bl);
- ::decode(nremote, bl);
- ::decode(nnull, bl);
- ::decode(dnbl, bl);
+ decode(fnode, bl);
+ decode(state, bl);
+ decode(nfull, bl);
+ decode(nremote, bl);
+ decode(nnull, bl);
+ decode(dnbl, bl);
dn_decoded = false; // don't decode bits unless we need them.
DECODE_FINISH(bl);
}
void EMetaBlob::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(8, 5, bl);
- ::encode(lump_order, bl);
- ::encode(lump_map, bl, features);
- ::encode(roots, bl, features);
- ::encode(table_tids, bl);
- ::encode(opened_ino, bl);
- ::encode(allocated_ino, bl);
- ::encode(used_preallocated_ino, bl);
- ::encode(preallocated_inos, bl);
- ::encode(client_name, bl);
- ::encode(inotablev, bl);
- ::encode(sessionmapv, bl);
- ::encode(truncate_start, bl);
- ::encode(truncate_finish, bl);
- ::encode(destroyed_inodes, bl);
- ::encode(client_reqs, bl);
- ::encode(renamed_dirino, bl);
- ::encode(renamed_dir_frags, bl);
+ encode(lump_order, bl);
+ encode(lump_map, bl, features);
+ encode(roots, bl, features);
+ encode(table_tids, bl);
+ encode(opened_ino, bl);
+ encode(allocated_ino, bl);
+ encode(used_preallocated_ino, bl);
+ encode(preallocated_inos, bl);
+ encode(client_name, bl);
+ encode(inotablev, bl);
+ encode(sessionmapv, bl);
+ encode(truncate_start, bl);
+ encode(truncate_finish, bl);
+ encode(destroyed_inodes, bl);
+ encode(client_reqs, bl);
+ encode(renamed_dirino, bl);
+ encode(renamed_dir_frags, bl);
{
// make MDSRank use v6 format happy
int64_t i = -1;
bool b = false;
- ::encode(i, bl);
- ::encode(b, bl);
+ encode(i, bl);
+ encode(b, bl);
}
- ::encode(client_flushes, bl);
+ encode(client_flushes, bl);
ENCODE_FINISH(bl);
}
void EMetaBlob::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(7, 5, 5, bl);
- ::decode(lump_order, bl);
- ::decode(lump_map, bl);
+ decode(lump_order, bl);
+ decode(lump_map, bl);
if (struct_v >= 4) {
- ::decode(roots, bl);
+ decode(roots, bl);
} else {
bufferlist rootbl;
- ::decode(rootbl, bl);
+ decode(rootbl, bl);
if (rootbl.length()) {
bufferlist::iterator p = rootbl.begin();
roots.push_back(ceph::shared_ptr<fullbit>(new fullbit(p)));
}
}
- ::decode(table_tids, bl);
- ::decode(opened_ino, bl);
- ::decode(allocated_ino, bl);
- ::decode(used_preallocated_ino, bl);
- ::decode(preallocated_inos, bl);
- ::decode(client_name, bl);
- ::decode(inotablev, bl);
- ::decode(sessionmapv, bl);
- ::decode(truncate_start, bl);
- ::decode(truncate_finish, bl);
- ::decode(destroyed_inodes, bl);
+ decode(table_tids, bl);
+ decode(opened_ino, bl);
+ decode(allocated_ino, bl);
+ decode(used_preallocated_ino, bl);
+ decode(preallocated_inos, bl);
+ decode(client_name, bl);
+ decode(inotablev, bl);
+ decode(sessionmapv, bl);
+ decode(truncate_start, bl);
+ decode(truncate_finish, bl);
+ decode(destroyed_inodes, bl);
if (struct_v >= 2) {
- ::decode(client_reqs, bl);
+ decode(client_reqs, bl);
} else {
list<metareqid_t> r;
- ::decode(r, bl);
+ decode(r, bl);
while (!r.empty()) {
client_reqs.push_back(pair<metareqid_t,uint64_t>(r.front(), 0));
r.pop_front();
}
}
if (struct_v >= 3) {
- ::decode(renamed_dirino, bl);
- ::decode(renamed_dir_frags, bl);
+ decode(renamed_dirino, bl);
+ decode(renamed_dir_frags, bl);
}
if (struct_v >= 6) {
// ignore
int64_t i;
bool b;
- ::decode(i, bl);
- ::decode(b, bl);
+ decode(i, bl);
+ decode(b, bl);
}
if (struct_v >= 8) {
- ::decode(client_flushes, bl);
+ decode(client_flushes, bl);
}
DECODE_FINISH(bl);
}
void ESession::encode(bufferlist &bl, uint64_t features) const
{
ENCODE_START(4, 3, bl);
- ::encode(stamp, bl);
- ::encode(client_inst, bl, features);
- ::encode(open, bl);
- ::encode(cmapv, bl);
- ::encode(inos, bl);
- ::encode(inotablev, bl);
- ::encode(client_metadata, bl);
+ encode(stamp, bl);
+ encode(client_inst, bl, features);
+ encode(open, bl);
+ encode(cmapv, bl);
+ encode(inos, bl);
+ encode(inotablev, bl);
+ encode(client_metadata, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(4, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(client_inst, bl);
- ::decode(open, bl);
- ::decode(cmapv, bl);
- ::decode(inos, bl);
- ::decode(inotablev, bl);
+ decode(stamp, bl);
+ decode(client_inst, bl);
+ decode(open, bl);
+ decode(cmapv, bl);
+ decode(inos, bl);
+ decode(inotablev, bl);
if (struct_v >= 4) {
- ::decode(client_metadata, bl);
+ decode(client_metadata, bl);
}
DECODE_FINISH(bl);
}
void ESessions::encode(bufferlist &bl, uint64_t features) const
{
ENCODE_START(1, 1, bl);
- ::encode(client_map, bl, features);
- ::encode(cmapv, bl);
- ::encode(stamp, bl);
+ encode(client_map, bl, features);
+ encode(cmapv, bl);
+ encode(stamp, bl);
ENCODE_FINISH(bl);
}
void ESessions::decode_old(bufferlist::iterator &bl)
{
- ::decode(client_map, bl);
- ::decode(cmapv, bl);
+ using ceph::decode;
+ decode(client_map, bl);
+ decode(cmapv, bl);
if (!bl.end())
- ::decode(stamp, bl);
+ decode(stamp, bl);
}
void ESessions::decode_new(bufferlist::iterator &bl)
{
DECODE_START(1, bl);
- ::decode(client_map, bl);
- ::decode(cmapv, bl);
+ decode(client_map, bl);
+ decode(cmapv, bl);
if (!bl.end())
- ::decode(stamp, bl);
+ decode(stamp, bl);
DECODE_FINISH(bl);
}
void ETableServer::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(3, 3, bl);
- ::encode(stamp, bl);
- ::encode(table, bl);
- ::encode(op, bl);
- ::encode(reqid, bl);
- ::encode(bymds, bl);
- ::encode(mutation, bl);
- ::encode(tid, bl);
- ::encode(version, bl);
+ encode(stamp, bl);
+ encode(table, bl);
+ encode(op, bl);
+ encode(reqid, bl);
+ encode(bymds, bl);
+ encode(mutation, bl);
+ encode(tid, bl);
+ encode(version, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(table, bl);
- ::decode(op, bl);
- ::decode(reqid, bl);
- ::decode(bymds, bl);
- ::decode(mutation, bl);
- ::decode(tid, bl);
- ::decode(version, bl);
+ decode(stamp, bl);
+ decode(table, bl);
+ decode(op, bl);
+ decode(reqid, bl);
+ decode(bymds, bl);
+ decode(mutation, bl);
+ decode(tid, bl);
+ decode(version, bl);
DECODE_FINISH(bl);
}
void ETableClient::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(3, 3, bl);
- ::encode(stamp, bl);
- ::encode(table, bl);
- ::encode(op, bl);
- ::encode(tid, bl);
+ encode(stamp, bl);
+ encode(table, bl);
+ encode(op, bl);
+ encode(tid, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(table, bl);
- ::decode(op, bl);
- ::decode(tid, bl);
+ decode(stamp, bl);
+ decode(table, bl);
+ decode(op, bl);
+ decode(tid, bl);
DECODE_FINISH(bl);
}
void EUpdate::encode(bufferlist &bl, uint64_t features) const
{
ENCODE_START(4, 4, bl);
- ::encode(stamp, bl);
- ::encode(type, bl);
- ::encode(metablob, bl, features);
- ::encode(client_map, bl);
- ::encode(cmapv, bl);
- ::encode(reqid, bl);
- ::encode(had_slaves, bl);
+ encode(stamp, bl);
+ encode(type, bl);
+ encode(metablob, bl, features);
+ encode(client_map, bl);
+ encode(cmapv, bl);
+ encode(reqid, bl);
+ encode(had_slaves, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(type, bl);
- ::decode(metablob, bl);
- ::decode(client_map, bl);
+ decode(stamp, bl);
+ decode(type, bl);
+ decode(metablob, bl);
+ decode(client_map, bl);
if (struct_v >= 3)
- ::decode(cmapv, bl);
- ::decode(reqid, bl);
- ::decode(had_slaves, bl);
+ decode(cmapv, bl);
+ decode(reqid, bl);
+ decode(had_slaves, bl);
DECODE_FINISH(bl);
}
// open client sessions?
map<client_t,entity_inst_t> cm;
bufferlist::iterator blp = client_map.begin();
- ::decode(cm, blp);
+ using ceph::decode;
+ decode(cm, blp);
mds->sessionmap.open_sessions(cm);
assert(mds->sessionmap.get_version() == cmapv);
void EOpen::encode(bufferlist &bl, uint64_t features) const {
ENCODE_START(4, 3, bl);
- ::encode(stamp, bl);
- ::encode(metablob, bl, features);
- ::encode(inos, bl);
- ::encode(snap_inos, bl);
+ encode(stamp, bl);
+ encode(metablob, bl, features);
+ encode(inos, bl);
+ encode(snap_inos, bl);
ENCODE_FINISH(bl);
}
void EOpen::decode(bufferlist::iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(metablob, bl);
- ::decode(inos, bl);
+ decode(stamp, bl);
+ decode(metablob, bl);
+ decode(inos, bl);
if (struct_v >= 4)
- ::decode(snap_inos, bl);
+ decode(snap_inos, bl);
DECODE_FINISH(bl);
}
void ECommitted::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(3, 3, bl);
- ::encode(stamp, bl);
- ::encode(reqid, bl);
+ encode(stamp, bl);
+ encode(reqid, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(reqid, bl);
+ decode(stamp, bl);
+ decode(reqid, bl);
DECODE_FINISH(bl);
}
void link_rollback::encode(bufferlist &bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(reqid, bl);
- ::encode(ino, bl);
- ::encode(was_inc, bl);
- ::encode(old_ctime, bl);
- ::encode(old_dir_mtime, bl);
- ::encode(old_dir_rctime, bl);
+ encode(reqid, bl);
+ encode(ino, bl);
+ encode(was_inc, bl);
+ encode(old_ctime, bl);
+ encode(old_dir_mtime, bl);
+ encode(old_dir_rctime, bl);
ENCODE_FINISH(bl);
}
void link_rollback::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(reqid, bl);
- ::decode(ino, bl);
- ::decode(was_inc, bl);
- ::decode(old_ctime, bl);
- ::decode(old_dir_mtime, bl);
- ::decode(old_dir_rctime, bl);
+ decode(reqid, bl);
+ decode(ino, bl);
+ decode(was_inc, bl);
+ decode(old_ctime, bl);
+ decode(old_dir_mtime, bl);
+ decode(old_dir_rctime, bl);
DECODE_FINISH(bl);
}
void rmdir_rollback::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(reqid, bl);
- ::encode(src_dir, bl);
- ::encode(src_dname, bl);
- ::encode(dest_dir, bl);
- ::encode(dest_dname, bl);
+ encode(reqid, bl);
+ encode(src_dir, bl);
+ encode(src_dname, bl);
+ encode(dest_dir, bl);
+ encode(dest_dname, bl);
ENCODE_FINISH(bl);
}
void rmdir_rollback::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(reqid, bl);
- ::decode(src_dir, bl);
- ::decode(src_dname, bl);
- ::decode(dest_dir, bl);
- ::decode(dest_dname, bl);
+ decode(reqid, bl);
+ decode(src_dir, bl);
+ decode(src_dname, bl);
+ decode(dest_dir, bl);
+ decode(dest_dname, bl);
DECODE_FINISH(bl);
}
void rename_rollback::drec::encode(bufferlist &bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(dirfrag, bl);
- ::encode(dirfrag_old_mtime, bl);
- ::encode(dirfrag_old_rctime, bl);
- ::encode(ino, bl);
- ::encode(remote_ino, bl);
- ::encode(dname, bl);
- ::encode(remote_d_type, bl);
- ::encode(old_ctime, bl);
+ encode(dirfrag, bl);
+ encode(dirfrag_old_mtime, bl);
+ encode(dirfrag_old_rctime, bl);
+ encode(ino, bl);
+ encode(remote_ino, bl);
+ encode(dname, bl);
+ encode(remote_d_type, bl);
+ encode(old_ctime, bl);
ENCODE_FINISH(bl);
}
void rename_rollback::drec::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(dirfrag, bl);
- ::decode(dirfrag_old_mtime, bl);
- ::decode(dirfrag_old_rctime, bl);
- ::decode(ino, bl);
- ::decode(remote_ino, bl);
- ::decode(dname, bl);
- ::decode(remote_d_type, bl);
- ::decode(old_ctime, bl);
+ decode(dirfrag, bl);
+ decode(dirfrag_old_mtime, bl);
+ decode(dirfrag_old_rctime, bl);
+ decode(ino, bl);
+ decode(remote_ino, bl);
+ decode(dname, bl);
+ decode(remote_d_type, bl);
+ decode(old_ctime, bl);
DECODE_FINISH(bl);
}
void rename_rollback::encode(bufferlist &bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(reqid, bl);
+ encode(reqid, bl);
encode(orig_src, bl);
encode(orig_dest, bl);
encode(stray, bl);
- ::encode(ctime, bl);
+ encode(ctime, bl);
ENCODE_FINISH(bl);
}
void rename_rollback::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(reqid, bl);
+ decode(reqid, bl);
decode(orig_src, bl);
decode(orig_dest, bl);
decode(stray, bl);
- ::decode(ctime, bl);
+ decode(ctime, bl);
DECODE_FINISH(bl);
}
void ESlaveUpdate::encode(bufferlist &bl, uint64_t features) const
{
ENCODE_START(3, 3, bl);
- ::encode(stamp, bl);
- ::encode(type, bl);
- ::encode(reqid, bl);
- ::encode(master, bl);
- ::encode(op, bl);
- ::encode(origop, bl);
- ::encode(commit, bl, features);
- ::encode(rollback, bl);
+ encode(stamp, bl);
+ encode(type, bl);
+ encode(reqid, bl);
+ encode(master, bl);
+ encode(op, bl);
+ encode(origop, bl);
+ encode(commit, bl, features);
+ encode(rollback, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(type, bl);
- ::decode(reqid, bl);
- ::decode(master, bl);
- ::decode(op, bl);
- ::decode(origop, bl);
- ::decode(commit, bl);
- ::decode(rollback, bl);
+ decode(stamp, bl);
+ decode(type, bl);
+ decode(reqid, bl);
+ decode(master, bl);
+ decode(op, bl);
+ decode(origop, bl);
+ decode(commit, bl);
+ decode(rollback, bl);
DECODE_FINISH(bl);
}
void ESubtreeMap::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(6, 5, bl);
- ::encode(stamp, bl);
- ::encode(metablob, bl, features);
- ::encode(subtrees, bl);
- ::encode(ambiguous_subtrees, bl);
- ::encode(expire_pos, bl);
- ::encode(event_seq, bl);
+ encode(stamp, bl);
+ encode(metablob, bl, features);
+ encode(subtrees, bl);
+ encode(ambiguous_subtrees, bl);
+ encode(expire_pos, bl);
+ encode(event_seq, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(6, 5, 5, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(metablob, bl);
- ::decode(subtrees, bl);
+ decode(stamp, bl);
+ decode(metablob, bl);
+ decode(subtrees, bl);
if (struct_v >= 4)
- ::decode(ambiguous_subtrees, bl);
+ decode(ambiguous_subtrees, bl);
if (struct_v >= 3)
- ::decode(expire_pos, bl);
+ decode(expire_pos, bl);
if (struct_v >= 6)
- ::decode(event_seq, bl);
+ decode(event_seq, bl);
DECODE_FINISH(bl);
}
void EFragment::encode(bufferlist &bl, uint64_t features) const {
ENCODE_START(5, 4, bl);
- ::encode(stamp, bl);
- ::encode(op, bl);
- ::encode(ino, bl);
- ::encode(basefrag, bl);
- ::encode(bits, bl);
- ::encode(metablob, bl, features);
- ::encode(orig_frags, bl);
- ::encode(rollback, bl);
+ encode(stamp, bl);
+ encode(op, bl);
+ encode(ino, bl);
+ encode(basefrag, bl);
+ encode(bits, bl);
+ encode(metablob, bl, features);
+ encode(orig_frags, bl);
+ encode(rollback, bl);
ENCODE_FINISH(bl);
}
void EFragment::decode(bufferlist::iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 4, 4, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
+ decode(stamp, bl);
if (struct_v >= 3)
- ::decode(op, bl);
- ::decode(ino, bl);
- ::decode(basefrag, bl);
- ::decode(bits, bl);
- ::decode(metablob, bl);
+ decode(op, bl);
+ decode(ino, bl);
+ decode(basefrag, bl);
+ decode(bits, bl);
+ decode(metablob, bl);
if (struct_v >= 5) {
- ::decode(orig_frags, bl);
- ::decode(rollback, bl);
+ decode(orig_frags, bl);
+ decode(rollback, bl);
}
DECODE_FINISH(bl);
}
void dirfrag_rollback::encode(bufferlist &bl) const
{
ENCODE_START(1, 1, bl);
- ::encode(fnode, bl);
+ encode(fnode, bl);
ENCODE_FINISH(bl);
}
void dirfrag_rollback::decode(bufferlist::iterator &bl)
{
DECODE_START(1, bl);
- ::decode(fnode, bl);
+ decode(fnode, bl);
DECODE_FINISH(bl);
}
void EExport::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(4, 3, bl);
- ::encode(stamp, bl);
- ::encode(metablob, bl, features);
- ::encode(base, bl);
- ::encode(bounds, bl);
- ::encode(target, bl);
+ encode(stamp, bl);
+ encode(metablob, bl, features);
+ encode(base, bl);
+ encode(bounds, bl);
+ encode(target, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(metablob, bl);
- ::decode(base, bl);
- ::decode(bounds, bl);
+ decode(stamp, bl);
+ decode(metablob, bl);
+ decode(base, bl);
+ decode(bounds, bl);
if (struct_v >= 4)
- ::decode(target, bl);
+ decode(target, bl);
DECODE_FINISH(bl);
}
<< " < " << cmapv << dendl;
map<client_t,entity_inst_t> cm;
bufferlist::iterator blp = client_map.begin();
- ::decode(cm, blp);
+ using ceph::decode;
+ decode(cm, blp);
mds->sessionmap.open_sessions(cm);
if (mds->sessionmap.get_version() != cmapv)
{
void EImportStart::encode(bufferlist &bl, uint64_t features) const {
ENCODE_START(4, 3, bl);
- ::encode(stamp, bl);
- ::encode(base, bl);
- ::encode(metablob, bl, features);
- ::encode(bounds, bl);
- ::encode(cmapv, bl);
- ::encode(client_map, bl);
- ::encode(from, bl);
+ encode(stamp, bl);
+ encode(base, bl);
+ encode(metablob, bl, features);
+ encode(bounds, bl);
+ encode(cmapv, bl);
+ encode(client_map, bl);
+ encode(from, bl);
ENCODE_FINISH(bl);
}
void EImportStart::decode(bufferlist::iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(base, bl);
- ::decode(metablob, bl);
- ::decode(bounds, bl);
- ::decode(cmapv, bl);
- ::decode(client_map, bl);
+ decode(stamp, bl);
+ decode(base, bl);
+ decode(metablob, bl);
+ decode(bounds, bl);
+ decode(cmapv, bl);
+ decode(client_map, bl);
if (struct_v >= 4)
- ::decode(from, bl);
+ decode(from, bl);
DECODE_FINISH(bl);
}
void EImportFinish::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(3, 3, bl);
- ::encode(stamp, bl);
- ::encode(base, bl);
- ::encode(success, bl);
+ encode(stamp, bl);
+ encode(base, bl);
+ encode(success, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
if (struct_v >= 2)
- ::decode(stamp, bl);
- ::decode(base, bl);
- ::decode(success, bl);
+ decode(stamp, bl);
+ decode(base, bl);
+ decode(success, bl);
DECODE_FINISH(bl);
}
void EResetJournal::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(2, 2, bl);
- ::encode(stamp, bl);
+ encode(stamp, bl);
ENCODE_FINISH(bl);
}
void EResetJournal::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(stamp, bl);
+ decode(stamp, bl);
DECODE_FINISH(bl);
}
void ENoOp::encode(bufferlist &bl, uint64_t features) const
{
ENCODE_START(2, 2, bl);
- ::encode(pad_size, bl);
+ encode(pad_size, bl);
uint8_t const pad = 0xff;
for (unsigned int i = 0; i < pad_size; ++i) {
- ::encode(pad, bl);
+ encode(pad, bl);
}
ENCODE_FINISH(bl);
}
void ENoOp::decode(bufferlist::iterator &bl)
{
DECODE_START(2, bl);
- ::decode(pad_size, bl);
+ decode(pad_size, bl);
if (bl.get_remaining() != pad_size) {
// This is spiritually an assertion, but expressing in a way that will let
// journal debug tools catch it and recognise a malformed entry.
void frag_info_t::encode(bufferlist &bl) const
{
ENCODE_START(3, 2, bl);
- ::encode(version, bl);
- ::encode(mtime, bl);
- ::encode(nfiles, bl);
- ::encode(nsubdirs, bl);
- ::encode(change_attr, bl);
+ encode(version, bl);
+ encode(mtime, bl);
+ encode(nfiles, bl);
+ encode(nsubdirs, bl);
+ encode(change_attr, bl);
ENCODE_FINISH(bl);
}
void frag_info_t::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
- ::decode(version, bl);
- ::decode(mtime, bl);
- ::decode(nfiles, bl);
- ::decode(nsubdirs, bl);
+ decode(version, bl);
+ decode(mtime, bl);
+ decode(nfiles, bl);
+ decode(nsubdirs, bl);
if (struct_v >= 3)
- ::decode(change_attr, bl);
+ decode(change_attr, bl);
else
change_attr = 0;
DECODE_FINISH(bl);
void nest_info_t::encode(bufferlist &bl) const
{
ENCODE_START(3, 2, bl);
- ::encode(version, bl);
- ::encode(rbytes, bl);
- ::encode(rfiles, bl);
- ::encode(rsubdirs, bl);
+ encode(version, bl);
+ encode(rbytes, bl);
+ encode(rfiles, bl);
+ encode(rsubdirs, bl);
{
// removed field
int64_t ranchors = 0;
- ::encode(ranchors, bl);
+ encode(ranchors, bl);
}
- ::encode(rsnaprealms, bl);
- ::encode(rctime, bl);
+ encode(rsnaprealms, bl);
+ encode(rctime, bl);
ENCODE_FINISH(bl);
}
void nest_info_t::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
- ::decode(version, bl);
- ::decode(rbytes, bl);
- ::decode(rfiles, bl);
- ::decode(rsubdirs, bl);
+ decode(version, bl);
+ decode(rbytes, bl);
+ decode(rfiles, bl);
+ decode(rsubdirs, bl);
{
int64_t ranchors;
- ::decode(ranchors, bl);
+ decode(ranchors, bl);
}
- ::decode(rsnaprealms, bl);
- ::decode(rctime, bl);
+ decode(rsnaprealms, bl);
+ decode(rctime, bl);
DECODE_FINISH(bl);
}
void client_writeable_range_t::encode(bufferlist &bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(range.first, bl);
- ::encode(range.last, bl);
- ::encode(follows, bl);
+ encode(range.first, bl);
+ encode(range.last, bl);
+ encode(follows, bl);
ENCODE_FINISH(bl);
}
void client_writeable_range_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(range.first, bl);
- ::decode(range.last, bl);
- ::decode(follows, bl);
+ decode(range.first, bl);
+ decode(range.last, bl);
+ decode(follows, bl);
DECODE_FINISH(bl);
}
*/
void inline_data_t::encode(bufferlist &bl) const
{
- ::encode(version, bl);
+ using ceph::encode;
+ encode(version, bl);
if (blp)
- ::encode(*blp, bl);
+ encode(*blp, bl);
else
- ::encode(bufferlist(), bl);
+ encode(bufferlist(), bl);
}
void inline_data_t::decode(bufferlist::iterator &p)
{
- ::decode(version, p);
+ using ceph::decode;
+ decode(version, p);
uint32_t inline_len;
- ::decode(inline_len, p);
+ decode(inline_len, p);
if (inline_len > 0)
- ::decode_nohead(inline_len, get_data(), p);
+ decode_nohead(inline_len, get_data(), p);
else
free_data();
}
{
ENCODE_START(15, 6, bl);
- ::encode(ino, bl);
- ::encode(rdev, bl);
- ::encode(ctime, bl);
+ encode(ino, bl);
+ encode(rdev, bl);
+ encode(ctime, bl);
- ::encode(mode, bl);
- ::encode(uid, bl);
- ::encode(gid, bl);
+ encode(mode, bl);
+ encode(uid, bl);
+ encode(gid, bl);
- ::encode(nlink, bl);
+ encode(nlink, bl);
{
// removed field
bool anchored = 0;
- ::encode(anchored, bl);
+ encode(anchored, bl);
}
- ::encode(dir_layout, bl);
- ::encode(layout, bl, features);
- ::encode(size, bl);
- ::encode(truncate_seq, bl);
- ::encode(truncate_size, bl);
- ::encode(truncate_from, bl);
- ::encode(truncate_pending, bl);
- ::encode(mtime, bl);
- ::encode(atime, bl);
- ::encode(time_warp_seq, bl);
- ::encode(client_ranges, bl);
-
- ::encode(dirstat, bl);
- ::encode(rstat, bl);
- ::encode(accounted_rstat, bl);
-
- ::encode(version, bl);
- ::encode(file_data_version, bl);
- ::encode(xattr_version, bl);
- ::encode(backtrace_version, bl);
- ::encode(old_pools, bl);
- ::encode(max_size_ever, bl);
- ::encode(inline_data, bl);
- ::encode(quota, bl);
-
- ::encode(stray_prior_path, bl);
-
- ::encode(last_scrub_version, bl);
- ::encode(last_scrub_stamp, bl);
-
- ::encode(btime, bl);
- ::encode(change_attr, bl);
-
- ::encode(export_pin, bl);
+ encode(dir_layout, bl);
+ encode(layout, bl, features);
+ encode(size, bl);
+ encode(truncate_seq, bl);
+ encode(truncate_size, bl);
+ encode(truncate_from, bl);
+ encode(truncate_pending, bl);
+ encode(mtime, bl);
+ encode(atime, bl);
+ encode(time_warp_seq, bl);
+ encode(client_ranges, bl);
+
+ encode(dirstat, bl);
+ encode(rstat, bl);
+ encode(accounted_rstat, bl);
+
+ encode(version, bl);
+ encode(file_data_version, bl);
+ encode(xattr_version, bl);
+ encode(backtrace_version, bl);
+ encode(old_pools, bl);
+ encode(max_size_ever, bl);
+ encode(inline_data, bl);
+ encode(quota, bl);
+
+ encode(stray_prior_path, bl);
+
+ encode(last_scrub_version, bl);
+ encode(last_scrub_stamp, bl);
+
+ encode(btime, bl);
+ encode(change_attr, bl);
+
+ encode(export_pin, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(15, 6, 6, p);
- ::decode(ino, p);
- ::decode(rdev, p);
- ::decode(ctime, p);
+ decode(ino, p);
+ decode(rdev, p);
+ decode(ctime, p);
- ::decode(mode, p);
- ::decode(uid, p);
- ::decode(gid, p);
+ decode(mode, p);
+ decode(uid, p);
+ decode(gid, p);
- ::decode(nlink, p);
+ decode(nlink, p);
{
bool anchored;
- ::decode(anchored, p);
+ decode(anchored, p);
}
if (struct_v >= 4)
- ::decode(dir_layout, p);
+ decode(dir_layout, p);
else
memset(&dir_layout, 0, sizeof(dir_layout));
- ::decode(layout, p);
- ::decode(size, p);
- ::decode(truncate_seq, p);
- ::decode(truncate_size, p);
- ::decode(truncate_from, p);
+ decode(layout, p);
+ decode(size, p);
+ decode(truncate_seq, p);
+ decode(truncate_size, p);
+ decode(truncate_from, p);
if (struct_v >= 5)
- ::decode(truncate_pending, p);
+ decode(truncate_pending, p);
else
truncate_pending = 0;
- ::decode(mtime, p);
- ::decode(atime, p);
- ::decode(time_warp_seq, p);
+ decode(mtime, p);
+ decode(atime, p);
+ decode(time_warp_seq, p);
if (struct_v >= 3) {
- ::decode(client_ranges, p);
+ decode(client_ranges, p);
} else {
map<client_t, client_writeable_range_t::byte_range_t> m;
- ::decode(m, p);
+ decode(m, p);
for (map<client_t, client_writeable_range_t::byte_range_t>::iterator
q = m.begin(); q != m.end(); ++q)
client_ranges[q->first].range = q->second;
}
- ::decode(dirstat, p);
- ::decode(rstat, p);
- ::decode(accounted_rstat, p);
+ decode(dirstat, p);
+ decode(rstat, p);
+ decode(accounted_rstat, p);
- ::decode(version, p);
- ::decode(file_data_version, p);
- ::decode(xattr_version, p);
+ decode(version, p);
+ decode(file_data_version, p);
+ decode(xattr_version, p);
if (struct_v >= 2)
- ::decode(backtrace_version, p);
+ decode(backtrace_version, p);
if (struct_v >= 7)
- ::decode(old_pools, p);
+ decode(old_pools, p);
if (struct_v >= 8)
- ::decode(max_size_ever, p);
+ decode(max_size_ever, p);
if (struct_v >= 9) {
- ::decode(inline_data, p);
+ decode(inline_data, p);
} else {
inline_data.version = CEPH_INLINE_NONE;
}
if (struct_v < 10)
backtrace_version = 0; // force update backtrace
if (struct_v >= 11)
- ::decode(quota, p);
+ decode(quota, p);
if (struct_v >= 12) {
- ::decode(stray_prior_path, p);
+ decode(stray_prior_path, p);
}
if (struct_v >= 13) {
- ::decode(last_scrub_version, p);
- ::decode(last_scrub_stamp, p);
+ decode(last_scrub_version, p);
+ decode(last_scrub_stamp, p);
}
if (struct_v >= 14) {
- ::decode(btime, p);
- ::decode(change_attr, p);
+ decode(btime, p);
+ decode(change_attr, p);
} else {
btime = utime_t();
change_attr = 0;
}
if (struct_v >= 15) {
- ::decode(export_pin, p);
+ decode(export_pin, p);
} else {
export_pin = MDS_RANK_NONE;
}
void old_inode_t::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(2, 2, bl);
- ::encode(first, bl);
- ::encode(inode, bl, features);
- ::encode(xattrs, bl);
+ encode(first, bl);
+ encode(inode, bl, features);
+ encode(xattrs, bl);
ENCODE_FINISH(bl);
}
void old_inode_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(first, bl);
- ::decode(inode, bl);
- ::decode(xattrs, bl);
+ decode(first, bl);
+ decode(inode, bl);
+ decode(xattrs, bl);
DECODE_FINISH(bl);
}
void fnode_t::encode(bufferlist &bl) const
{
ENCODE_START(4, 3, bl);
- ::encode(version, bl);
- ::encode(snap_purged_thru, bl);
- ::encode(fragstat, bl);
- ::encode(accounted_fragstat, bl);
- ::encode(rstat, bl);
- ::encode(accounted_rstat, bl);
- ::encode(damage_flags, bl);
- ::encode(recursive_scrub_version, bl);
- ::encode(recursive_scrub_stamp, bl);
- ::encode(localized_scrub_version, bl);
- ::encode(localized_scrub_stamp, bl);
+ encode(version, bl);
+ encode(snap_purged_thru, bl);
+ encode(fragstat, bl);
+ encode(accounted_fragstat, bl);
+ encode(rstat, bl);
+ encode(accounted_rstat, bl);
+ encode(damage_flags, bl);
+ encode(recursive_scrub_version, bl);
+ encode(recursive_scrub_stamp, bl);
+ encode(localized_scrub_version, bl);
+ encode(localized_scrub_stamp, bl);
ENCODE_FINISH(bl);
}
void fnode_t::decode(bufferlist::iterator &bl)
{
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
- ::decode(version, bl);
- ::decode(snap_purged_thru, bl);
- ::decode(fragstat, bl);
- ::decode(accounted_fragstat, bl);
- ::decode(rstat, bl);
- ::decode(accounted_rstat, bl);
+ decode(version, bl);
+ decode(snap_purged_thru, bl);
+ decode(fragstat, bl);
+ decode(accounted_fragstat, bl);
+ decode(rstat, bl);
+ decode(accounted_rstat, bl);
if (struct_v >= 3) {
- ::decode(damage_flags, bl);
+ decode(damage_flags, bl);
}
if (struct_v >= 4) {
- ::decode(recursive_scrub_version, bl);
- ::decode(recursive_scrub_stamp, bl);
- ::decode(localized_scrub_version, bl);
- ::decode(localized_scrub_stamp, bl);
+ decode(recursive_scrub_version, bl);
+ decode(recursive_scrub_stamp, bl);
+ decode(localized_scrub_version, bl);
+ decode(localized_scrub_stamp, bl);
}
DECODE_FINISH(bl);
}
void old_rstat_t::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(first, bl);
- ::encode(rstat, bl);
- ::encode(accounted_rstat, bl);
+ encode(first, bl);
+ encode(rstat, bl);
+ encode(accounted_rstat, bl);
ENCODE_FINISH(bl);
}
void old_rstat_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(first, bl);
- ::decode(rstat, bl);
- ::decode(accounted_rstat, bl);
+ decode(first, bl);
+ decode(rstat, bl);
+ decode(accounted_rstat, bl);
DECODE_FINISH(bl);
}
void session_info_t::encode(bufferlist& bl, uint64_t features) const
{
ENCODE_START(6, 3, bl);
- ::encode(inst, bl, features);
- ::encode(completed_requests, bl);
- ::encode(prealloc_inos, bl); // hacky, see below.
- ::encode(used_inos, bl);
- ::encode(client_metadata, bl);
- ::encode(completed_flushes, bl);
- ::encode(auth_name, bl);
+ encode(inst, bl, features);
+ encode(completed_requests, bl);
+ encode(prealloc_inos, bl); // hacky, see below.
+ encode(used_inos, bl);
+ encode(client_metadata, bl);
+ encode(completed_flushes, bl);
+ encode(auth_name, bl);
ENCODE_FINISH(bl);
}
void session_info_t::decode(bufferlist::iterator& p)
{
DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, p);
- ::decode(inst, p);
+ decode(inst, p);
if (struct_v <= 2) {
set<ceph_tid_t> s;
- ::decode(s, p);
+ decode(s, p);
while (!s.empty()) {
completed_requests[*s.begin()] = inodeno_t();
s.erase(s.begin());
}
} else {
- ::decode(completed_requests, p);
+ decode(completed_requests, p);
}
- ::decode(prealloc_inos, p);
- ::decode(used_inos, p);
+ decode(prealloc_inos, p);
+ decode(used_inos, p);
prealloc_inos.insert(used_inos);
used_inos.clear();
if (struct_v >= 4) {
- ::decode(client_metadata, p);
+ decode(client_metadata, p);
}
if (struct_v >= 5) {
- ::decode(completed_flushes, p);
+ decode(completed_flushes, p);
}
if (struct_v >= 6) {
- ::decode(auth_name, p);
+ decode(auth_name, p);
}
DECODE_FINISH(p);
}
void string_snap_t::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(name, bl);
- ::encode(snapid, bl);
+ encode(name, bl);
+ encode(snapid, bl);
ENCODE_FINISH(bl);
}
void string_snap_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(name, bl);
- ::decode(snapid, bl);
+ decode(name, bl);
+ decode(snapid, bl);
DECODE_FINISH(bl);
}
void MDSCacheObjectInfo::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(ino, bl);
- ::encode(dirfrag, bl);
- ::encode(dname, bl);
- ::encode(snapid, bl);
+ encode(ino, bl);
+ encode(dirfrag, bl);
+ encode(dname, bl);
+ encode(snapid, bl);
ENCODE_FINISH(bl);
}
void MDSCacheObjectInfo::decode(bufferlist::iterator& p)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, p);
- ::decode(ino, p);
- ::decode(dirfrag, p);
- ::decode(dname, p);
- ::decode(snapid, p);
+ decode(ino, p);
+ decode(dirfrag, p);
+ decode(dname, p);
+ decode(snapid, p);
DECODE_FINISH(p);
}
void mds_table_pending_t::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(reqid, bl);
- ::encode(mds, bl);
- ::encode(tid, bl);
+ encode(reqid, bl);
+ encode(mds, bl);
+ encode(tid, bl);
ENCODE_FINISH(bl);
}
void mds_table_pending_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(reqid, bl);
- ::decode(mds, bl);
- ::decode(tid, bl);
+ decode(reqid, bl);
+ decode(mds, bl);
+ decode(tid, bl);
DECODE_FINISH(bl);
}
{
ENCODE_START(2, 2, bl);
for (int i=0; i<NUM; i++)
- ::encode(vec[i], bl);
+ encode(vec[i], bl);
ENCODE_FINISH(bl);
}
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, p);
for (int i=0; i<NUM; i++)
- ::decode(vec[i], t, p);
+ decode(vec[i], t, p);
DECODE_FINISH(p);
}
*/
void mds_load_t::encode(bufferlist &bl) const {
ENCODE_START(2, 2, bl);
- ::encode(auth, bl);
- ::encode(all, bl);
- ::encode(req_rate, bl);
- ::encode(cache_hit_rate, bl);
- ::encode(queue_len, bl);
- ::encode(cpu_load_avg, bl);
+ encode(auth, bl);
+ encode(all, bl);
+ encode(req_rate, bl);
+ encode(cache_hit_rate, bl);
+ encode(queue_len, bl);
+ encode(cpu_load_avg, bl);
ENCODE_FINISH(bl);
}
void mds_load_t::decode(const utime_t &t, bufferlist::iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(auth, t, bl);
- ::decode(all, t, bl);
- ::decode(req_rate, bl);
- ::decode(cache_hit_rate, bl);
- ::decode(queue_len, bl);
- ::decode(cpu_load_avg, bl);
+ decode(auth, t, bl);
+ decode(all, t, bl);
+ decode(req_rate, bl);
+ decode(cache_hit_rate, bl);
+ decode(queue_len, bl);
+ decode(cpu_load_avg, bl);
DECODE_FINISH(bl);
}
void cap_reconnect_t::encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
encode_old(bl); // extract out when something changes
- ::encode(snap_follows, bl);
+ encode(snap_follows, bl);
ENCODE_FINISH(bl);
}
void cap_reconnect_t::encode_old(bufferlist& bl) const {
- ::encode(path, bl);
+ using ceph::encode;
+ encode(path, bl);
capinfo.flock_len = flockbl.length();
- ::encode(capinfo, bl);
- ::encode_nohead(flockbl, bl);
+ encode(capinfo, bl);
+ encode_nohead(flockbl, bl);
}
void cap_reconnect_t::decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
decode_old(bl); // extract out when something changes
if (struct_v >= 2)
- ::decode(snap_follows, bl);
+ decode(snap_follows, bl);
DECODE_FINISH(bl);
}
void cap_reconnect_t::decode_old(bufferlist::iterator& bl) {
- ::decode(path, bl);
- ::decode(capinfo, bl);
- ::decode_nohead(capinfo.flock_len, flockbl, bl);
+ using ceph::decode;
+ decode(path, bl);
+ decode(capinfo, bl);
+ decode_nohead(capinfo.flock_len, flockbl, bl);
}
void cap_reconnect_t::dump(Formatter *f) const
vinodeno_t(inodeno_t i, snapid_t s) : ino(i), snapid(s) {}
void encode(bufferlist& bl) const {
- ::encode(ino, bl);
- ::encode(snapid, bl);
+ using ceph::encode;
+ encode(ino, bl);
+ encode(snapid, bl);
}
void decode(bufferlist::iterator& p) {
- ::decode(ino, p);
- ::decode(snapid, p);
+ using ceph::decode;
+ decode(ino, p);
+ decode(snapid, p);
}
};
WRITE_CLASS_ENCODER(vinodeno_t)
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(max_bytes, bl);
- ::encode(max_files, bl);
+ encode(max_bytes, bl);
+ encode(max_files, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& p) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, p);
- ::decode(max_bytes, p);
- ::decode(max_files, p);
+ decode(max_bytes, p);
+ decode(max_files, p);
DECODE_FINISH(p);
}
};
inline void decode(client_writeable_range_t::byte_range_t& range, bufferlist::iterator& bl) {
- ::decode(range.first, bl);
- ::decode(range.last, bl);
+ decode(range.first, bl);
+ decode(range.last, bl);
}
WRITE_CLASS_ENCODER(client_writeable_range_t)
void encode(bufferlist& bl) const {
string key;
encode(key);
- ::encode(key, bl);
+ using ceph::encode;
+ encode(key, bl);
}
void encode(string& key) const {
char b[20];
}
static void decode_helper(bufferlist::iterator& bl, string& nm, snapid_t& sn) {
string key;
- ::decode(key, bl);
+ decode(key, bl);
decode_helper(key, nm, sn);
}
static void decode_helper(const string& key, string& nm, snapid_t& sn) {
metareqid_t() : tid(0) {}
metareqid_t(entity_name_t n, ceph_tid_t t) : name(n), tid(t) {}
void encode(bufferlist& bl) const {
- ::encode(name, bl);
- ::encode(tid, bl);
+ using ceph::encode;
+ encode(name, bl);
+ encode(tid, bl);
}
void decode(bufferlist::iterator &p) {
- ::decode(name, p);
- ::decode(tid, p);
+ using ceph::decode;
+ decode(name, p);
+ decode(tid, p);
}
};
WRITE_CLASS_ENCODER(metareqid_t)
}
void encode(bufferlist& bl) const {
- ::encode(path, bl);
- ::encode(capinfo, bl);
+ using ceph::encode;
+ encode(path, bl);
+ encode(capinfo, bl);
}
void decode(bufferlist::iterator& bl) {
- ::decode(path, bl);
- ::decode(capinfo, bl);
+ using ceph::decode;
+ decode(path, bl);
+ decode(capinfo, bl);
}
};
WRITE_CLASS_ENCODER(old_cap_reconnect_t)
dirfrag_t(inodeno_t i, frag_t f) : ino(i), frag(f) { }
void encode(bufferlist& bl) const {
- ::encode(ino, bl);
- ::encode(frag, bl);
+ using ceph::encode;
+ encode(ino, bl);
+ encode(frag, bl);
}
void decode(bufferlist::iterator& bl) {
- ::decode(ino, bl);
- ::decode(frag, bl);
+ using ceph::decode;
+ decode(ino, bl);
+ decode(frag, bl);
}
};
WRITE_CLASS_ENCODER(dirfrag_t)
void encode(bufferlist &bl) const {
ENCODE_START(2, 2, bl);
for (int i=0; i<NUM; i++)
- ::encode(vec[i], bl);
+ encode(vec[i], bl);
ENCODE_FINISH(bl);
}
void decode(const utime_t &t, bufferlist::iterator &p) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, p);
for (int i=0; i<NUM; i++)
- ::decode(vec[i], t, p);
+ decode(vec[i], t, p);
DECODE_FINISH(p);
}
// for dencoder infrastructure
void SnapInfo::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(snapid, bl);
- ::encode(ino, bl);
- ::encode(stamp, bl);
- ::encode(name, bl);
+ encode(snapid, bl);
+ encode(ino, bl);
+ encode(stamp, bl);
+ encode(name, bl);
ENCODE_FINISH(bl);
}
void SnapInfo::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(snapid, bl);
- ::decode(ino, bl);
- ::decode(stamp, bl);
- ::decode(name, bl);
+ decode(snapid, bl);
+ decode(ino, bl);
+ decode(stamp, bl);
+ decode(name, bl);
DECODE_FINISH(bl);
}
void snaplink_t::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode(ino, bl);
- ::encode(first, bl);
+ encode(ino, bl);
+ encode(first, bl);
ENCODE_FINISH(bl);
}
void snaplink_t::decode(bufferlist::iterator& bl)
{
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(ino, bl);
- ::decode(first, bl);
+ decode(ino, bl);
+ decode(first, bl);
DECODE_FINISH(bl);
}
void sr_t::encode(bufferlist& bl) const
{
ENCODE_START(4, 4, bl);
- ::encode(seq, bl);
- ::encode(created, bl);
- ::encode(last_created, bl);
- ::encode(last_destroyed, bl);
- ::encode(current_parent_since, bl);
- ::encode(snaps, bl);
- ::encode(past_parents, bl);
+ encode(seq, bl);
+ encode(created, bl);
+ encode(last_created, bl);
+ encode(last_destroyed, bl);
+ encode(current_parent_since, bl);
+ encode(snaps, bl);
+ encode(past_parents, bl);
ENCODE_FINISH(bl);
}
DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, p);
if (struct_v == 2) {
__u8 struct_v;
- ::decode(struct_v, p); // yes, really: extra byte for v2 encoding only, see 6ee52e7d.
+ decode(struct_v, p); // yes, really: extra byte for v2 encoding only, see 6ee52e7d.
}
- ::decode(seq, p);
- ::decode(created, p);
- ::decode(last_created, p);
- ::decode(last_destroyed, p);
- ::decode(current_parent_since, p);
- ::decode(snaps, p);
- ::decode(past_parents, p);
+ decode(seq, p);
+ decode(created, p);
+ decode(last_created, p);
+ decode(last_destroyed, p);
+ decode(current_parent_since, p);
+ decode(snaps, p);
+ decode(past_parents, p);
DECODE_FINISH(p);
}