From 06b5bf675a64707232c420f7917347935d6e1a0b Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 25 Oct 2013 13:41:29 -0700 Subject: [PATCH] osd: add category to object_copy_data_t We don't bump the encoding version -- and stick it in the middle -- since it's still brand-new. For simplicity, we encode it unconditionally rather than trying to embed it alongside the attrs or with its own "complete" flag in the cursor. Signed-off-by: Greg Farnum --- src/osd/ReplicatedPG.cc | 1 + src/osd/osd_types.cc | 2 ++ src/osd/osd_types.h | 1 + 3 files changed, 4 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 6d1bdbd0c31e0..16f12c1d27209 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4278,6 +4278,7 @@ int ReplicatedPG::fill_in_copy_get(bufferlist::iterator& bp, OSDOp& osd_op, // size, mtime reply_obj.size = oi.size; reply_obj.mtime = oi.mtime; + reply_obj.category = oi.category; // attrs map& out_attrs = reply_obj.attrs; diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index e3867905dc767..05b83c4af21bd 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -2550,6 +2550,7 @@ void object_copy_data_t::encode(bufferlist& bl) const ENCODE_START(1, 1, bl); ::encode(size, bl); ::encode(mtime, bl); + ::encode(category, bl); ::encode(attrs, bl); ::encode(data, bl); ::encode(omap, bl); @@ -2562,6 +2563,7 @@ void object_copy_data_t::decode(bufferlist::iterator& bl) DECODE_START(1, bl); ::decode(size, bl); ::decode(mtime, bl); + ::decode(category, bl); ::decode(attrs, bl); ::decode(data, bl); ::decode(omap, bl); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index c9f518e638d28..54fd52106c6d4 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1878,6 +1878,7 @@ struct object_copy_data_t { map attrs; bufferlist data; map omap; + string category; public: object_copy_data_t() : size((uint64_t)-1) {} -- 2.39.5