Skip to content

Commit

Permalink
Merge remote branch 'origin/wip-mds-old-inodes'
Browse files Browse the repository at this point in the history
Reviewed-by: Greg Farnum <[email protected]>
  • Loading branch information
gregsfortytwo committed Feb 23, 2012
2 parents 5aa60ce + 3628f90 commit c88da93
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/mds/events/EMetaBlob.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class EMetaBlob {
bufferlist snapbl;
bool dirty;
struct default_file_layout *dir_layout;
typedef map<snapid_t, old_inode_t> old_inodes_t;
old_inodes_t old_inodes;

bufferlist _enc;

Expand All @@ -77,7 +79,8 @@ class EMetaBlob {
fullbit(const string& d, snapid_t df, snapid_t dl,
version_t v, inode_t& i, fragtree_t &dft,
map<string,bufferptr> &xa, const string& sym,
bufferlist &sbl, bool dr, default_file_layout *defl = NULL) :
bufferlist &sbl, bool dr, default_file_layout *defl = NULL,
old_inodes_t *oi = NULL) :
//dn(d), dnfirst(df), dnlast(dl), dnv(v),
//inode(i), dirfragtree(dft), xattrs(xa), symlink(sym), snapbl(sbl), dirty(dr)
dir_layout(NULL), _enc(1024)
Expand All @@ -98,15 +101,20 @@ class EMetaBlob {
::encode(*defl, _enc);
}
::encode(dr, _enc);
::encode(oi ? true : false, _enc);
if (oi)
::encode(*oi, _enc);
}
fullbit(bufferlist::iterator &p) : dir_layout(NULL) {
decode(p);
}
fullbit(bufferlist::iterator &p) : dir_layout(NULL) { decode(p); }
fullbit() : dir_layout(NULL) {}
~fullbit() {
delete dir_layout;
}

void encode(bufferlist& bl) const {
__u8 struct_v = 2;
__u8 struct_v = 3;
::encode(struct_v, bl);
assert(_enc.length());
bl.append(_enc);
Expand Down Expand Up @@ -135,6 +143,13 @@ class EMetaBlob {
}
}
::decode(dirty, bl);
if (struct_v >= 3) {
bool old_inodes_present;
::decode(old_inodes_present, bl);
if (old_inodes_present) {
::decode(old_inodes, bl);
}
}
}

void update_inode(MDS *mds, CInode *in);
Expand Down Expand Up @@ -562,7 +577,8 @@ class EMetaBlob {
*pi, in->dirfragtree,
*in->get_projected_xattrs(),
in->symlink, snapbl,
dirty, default_layout)));
dirty, default_layout,
&in->old_inodes)));
if (pi)
lump.get_dfull().back()->inode = *pi;
return &lump.get_dfull().back()->inode;
Expand Down Expand Up @@ -614,7 +630,7 @@ class EMetaBlob {
0,
*pi, *pdft, *px,
in->symlink, snapbl,
dirty, default_layout);
dirty, default_layout, &in->old_inodes);
return &root->inode;
}

Expand Down
1 change: 1 addition & 0 deletions src/mds/journal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ void EMetaBlob::fullbit::update_inode(MDS *mds, CInode *in)
} else if (in->inode.is_symlink()) {
in->symlink = symlink;
}
in->old_inodes = old_inodes;
}

void EMetaBlob::replay(MDS *mds, LogSegment *logseg)
Expand Down

0 comments on commit c88da93

Please sign in to comment.