diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-02-23 06:24:27 +0100 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-02-23 06:24:27 +0100 |
commit | 3628f901d471a484ca6c1e22c6f8601af95cd205 (patch) | |
tree | e805db31a13d8870efb434e0df4feda51927ad15 /src/mds/events/EMetaBlob.h | |
parent | mds: Add old_inodes to emetablob (diff) | |
download | ceph-3628f901d471a484ca6c1e22c6f8601af95cd205.tar.xz ceph-3628f901d471a484ca6c1e22c6f8601af95cd205.zip |
mds: make EMetaBlob::fullbit::old_inodes non-ptr
No need to put this separately on the heap, as a static map<> isn't much
more expensive than a pointer. Also, this ensures we unconditonally
reset in->old_inodes to a potentially empty value if we replay the same
inode multiple times and lose old inodes in subsequent versions.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/mds/events/EMetaBlob.h')
-rw-r--r-- | src/mds/events/EMetaBlob.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index 747bff36ce1..c8e1db21d42 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -69,7 +69,7 @@ public: bool dirty; struct default_file_layout *dir_layout; typedef map<snapid_t, old_inode_t> old_inodes_t; - old_inodes_t *old_inodes; + old_inodes_t old_inodes; bufferlist _enc; @@ -83,7 +83,7 @@ public: 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), old_inodes(NULL), _enc(1024) + dir_layout(NULL), _enc(1024) { ::encode(d, _enc); ::encode(df, _enc); @@ -105,12 +105,11 @@ public: if (oi) ::encode(*oi, _enc); } - fullbit(bufferlist::iterator &p) : dir_layout(NULL), old_inodes(NULL) { + fullbit(bufferlist::iterator &p) : dir_layout(NULL) { decode(p); } - fullbit() : dir_layout(NULL), old_inodes(NULL) {} + fullbit() : dir_layout(NULL) {} ~fullbit() { - delete old_inodes; delete dir_layout; } @@ -148,8 +147,7 @@ public: bool old_inodes_present; ::decode(old_inodes_present, bl); if (old_inodes_present) { - old_inodes = new old_inodes_t; - ::decode(*old_inodes, bl); + ::decode(old_inodes, bl); } } } |