Merge branch 'testing' into unstable

Conflicts:
	src/osd/ReplicatedPG.cc
This commit is contained in:
Sage Weil 2010-09-16 16:16:32 -07:00
commit d669ba26a5
2 changed files with 12 additions and 5 deletions

View File

@ -1612,8 +1612,7 @@ void ReplicatedPG::make_writeable(OpContext *ctx)
}
snap_oi->version = ctx->at_version;
snap_oi->prior_version = oi.version;
snap_oi->last_reqid = oi.last_reqid;
snap_oi->mtime = oi.mtime;
snap_oi->copy_user_bits(oi);
snap_oi->snaps = snaps;
_make_clone(t, soid, coid, snap_oi);
@ -3563,9 +3562,8 @@ int ReplicatedPG::recover_primary(int max)
object_info_t oi(soid);
oi.version = latest->version;
oi.prior_version = latest->prior_version;
oi.last_reqid = headobc->obs.oi.last_reqid;
oi.mtime = headobc->obs.oi.mtime;
::decode(oi.snaps, latest->snaps);
oi.copy_user_bits(headobc->obs.oi);
_make_clone(*t, head, soid, &oi);
put_object_context(headobc);

View File

@ -693,7 +693,7 @@ struct pg_pool_t {
* we know which mode we're using based on whether removed_snaps is empty.
*/
bool is_pool_snaps_mode() const {
return removed_snaps.empty();
return removed_snaps.empty() && get_snap_seq() > 0;
}
bool is_removed_snap(snapid_t s) const {
@ -1264,6 +1264,15 @@ struct object_info_t {
uint64_t truncate_seq, truncate_size;
void copy_user_bits(const object_info_t& other) {
// these bits are copied from head->clone.
size = other.size;
mtime = other.mtime;
last_reqid = other.last_reqid;
truncate_seq = other.truncate_seq;
truncate_size = other.truncate_size;
}
void encode(bufferlist& bl) const {
const __u8 v = 1;
::encode(v, bl);