osd_types: add ObjectModDesc into pg_log_entry_t

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2013-12-03 16:23:50 -08:00
parent a7a6a2f153
commit 63f64de118
2 changed files with 17 additions and 1 deletions

View File

@ -19,6 +19,7 @@ extern "C" {
}
#include "PG.h"
#include "OSDMap.h"
#include "PGBackend.h"
const char *ceph_osd_flag_name(unsigned flag)
{
@ -2281,7 +2282,7 @@ void pg_log_entry_t::decode_with_checksum(bufferlist::iterator& p)
void pg_log_entry_t::encode(bufferlist &bl) const
{
ENCODE_START(8, 4, bl);
ENCODE_START(9, 4, bl);
::encode(op, bl);
::encode(soid, bl);
::encode(version, bl);
@ -2304,6 +2305,7 @@ void pg_log_entry_t::encode(bufferlist &bl) const
::encode(prior_version, bl);
::encode(snaps, bl);
::encode(user_version, bl);
::encode(mod_desc, bl);
ENCODE_FINISH(bl);
}
@ -2351,6 +2353,11 @@ void pg_log_entry_t::decode(bufferlist::iterator &bl)
else
user_version = version.version;
if (struct_v >= 9)
::decode(mod_desc, bl);
else
mod_desc.mark_unrollbackable();
DECODE_FINISH(bl);
}
@ -2376,6 +2383,11 @@ void pg_log_entry_t::dump(Formatter *f) const
f->dump_unsigned("snap", *p);
f->close_section();
}
{
f->open_object_section("mod_desc");
mod_desc.dump(f);
f->close_section();
}
}
void pg_log_entry_t::generate_test_instances(list<pg_log_entry_t*>& o)

View File

@ -19,6 +19,7 @@
#include <stdio.h>
#include <memory>
#include <boost/scoped_ptr.hpp>
#include <boost/optional.hpp>
#include "include/rados/rados_types.hpp"
@ -1732,6 +1733,9 @@ struct pg_log_entry_t {
bool invalid_pool; // only when decoding pool-less hobject based entries
uint64_t offset; // [soft state] my offset on disk
/// describes state for a locally-rollbackable entry
ObjectModDesc mod_desc;
pg_log_entry_t()
: op(0), user_version(0),