]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: expose the copy-get()'ed object's category 769/head
authorGreg Farnum <greg@inktank.com>
Wed, 9 Oct 2013 22:07:07 +0000 (15:07 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 25 Oct 2013 20:52:57 +0000 (13:52 -0700)
In the OSD, store the category in the CopyOp using this.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h
src/osdc/Objecter.h

index 16f12c1d272090ac50cc7cf695606dad3ff9a78d..c6a92830feb93af0c898133c4767205f96802c6f 100644 (file)
@@ -4380,8 +4380,8 @@ void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop)
     assert(cop->cursor.is_initial());
   }
   op.copy_get(&cop->cursor, cct->_conf->osd_copyfrom_max_chunk,
-             &cop->size, &cop->mtime, &cop->attrs,
-             &cop->data, &cop->omap,
+             &cop->size, &cop->mtime, &cop->category,
+             &cop->attrs, &cop->data, &cop->omap,
              &cop->rval);
 
   C_Copyfrom *fin = new C_Copyfrom(this, obc->obs.oi.soid,
index fa93c8d0dfce5df94c0ccf3e937cb12c2fa85d54..afa0ca7902edd42ab7f5573682319c1db4efefbe 100644 (file)
@@ -108,6 +108,7 @@ public:
     object_copy_cursor_t cursor;
     uint64_t size;
     utime_t mtime;
+    string category;
     map<string,bufferlist> attrs;
     bufferlist data;
     map<string,bufferlist> omap;
index 9b89f9586f4c926b0d07243d84bb30833fe876d3..41973ddaf5ffab382897cdcc20f3864eb549a433 100644 (file)
@@ -569,6 +569,7 @@ struct ObjectOperation {
     object_copy_cursor_t *cursor;
     uint64_t *out_size;
     utime_t *out_mtime;
+    string *out_category;
     std::map<std::string,bufferlist> *out_attrs;
     bufferlist *out_data;
     std::map<std::string,bufferlist> *out_omap;
@@ -576,13 +577,14 @@ struct ObjectOperation {
     C_ObjectOperation_copyget(object_copy_cursor_t *c,
                              uint64_t *s,
                              utime_t *m,
+                             string *cat,
                              std::map<std::string,bufferlist> *a,
                              bufferlist *d,
                              std::map<std::string,bufferlist> *o,
                              int *r)
       : cursor(c),
-       out_size(s), out_mtime(m), out_attrs(a),
-       out_data(d), out_omap(o), prval(r) {}
+       out_size(s), out_mtime(m), out_category(cat),
+       out_attrs(a), out_data(d), out_omap(o), prval(r) {}
     void finish(int r) {
       if (r < 0)
        return;
@@ -594,6 +596,8 @@ struct ObjectOperation {
          *out_size = copy_reply.size;
        if (out_mtime)
          *out_mtime = copy_reply.mtime;
+       if (out_category)
+         *out_category = copy_reply.category;
        if (out_attrs)
          *out_attrs = copy_reply.attrs;
        if (out_data)
@@ -612,6 +616,7 @@ struct ObjectOperation {
                uint64_t max,
                uint64_t *out_size,
                utime_t *out_mtime,
+               string *out_category,
                std::map<std::string,bufferlist> *out_attrs,
                bufferlist *out_data,
                std::map<std::string,bufferlist> *out_omap,
@@ -623,7 +628,8 @@ struct ObjectOperation {
     unsigned p = ops.size() - 1;
     out_rval[p] = prval;
     C_ObjectOperation_copyget *h =
-      new C_ObjectOperation_copyget(cursor, out_size, out_mtime, out_attrs, out_data, out_omap, prval);
+      new C_ObjectOperation_copyget(cursor, out_size, out_mtime, out_category,
+                                    out_attrs, out_data, out_omap, prval);
     out_bl[p] = &h->bl;
     out_handler[p] = h;
   }