]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge remote branch 'gh/master' into wip-op-data-mux
authorSage Weil <sage.weil@dreamhost.com>
Mon, 16 Jan 2012 18:16:23 +0000 (10:16 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 16 Jan 2012 18:16:23 +0000 (10:16 -0800)
Conflicts:
src/librados.cc
src/objclass/class_api.cc
src/rgw/rgw_rados.cc

1  2 
src/include/rados/librados.hpp
src/librados.cc
src/objclass/class_api.cc
src/osd/OSD.cc
src/osd/ReplicatedPG.cc
src/rgw/rgw_rados.cc

Simple merge
diff --cc src/librados.cc
index e8617844065f06696c57125ab3ef83e596a48dee,247e244a6ec3fbe62d1e644f3a6ccfd2e3d2ecbf..1e48cabc808ef289b3b88ad946a36a9aa214b317
@@@ -183,28 -183,34 +183,34 @@@ void librados::ObjectOperation::src_cmp
    o->src_cmpxattr(oid, CEPH_NOSNAP, name, bl, op, CEPH_OSD_CMPXATTR_MODE_U64);
  }
  
 -void librados::ObjectReadOperation::stat()
+ void librados::ObjectOperation::exec(const char *cls, const char *method, bufferlist& inbl)
+ {
+   ::ObjectOperation *o = (::ObjectOperation *)impl;
+   o->call(cls, method, inbl);
+ }
 +void librados::ObjectReadOperation::stat(uint64_t *psize, int *prval)
  {
    ::ObjectOperation *o = (::ObjectOperation *)impl;
 -  o->add_op(CEPH_OSD_OP_STAT);
 +  o->stat(psize, NULL, prval);
  }
  
 -void librados::ObjectReadOperation::read(size_t off, uint64_t len)
 +void librados::ObjectReadOperation::read(size_t off, uint64_t len, bufferlist *pbl, int *prval)
  {
    ::ObjectOperation *o = (::ObjectOperation *)impl;
 -  o->read(off, len);
 +  o->read(off, len, pbl, prval);
  }
  
 -void librados::ObjectReadOperation::getxattr(const char *name)
 +void librados::ObjectReadOperation::getxattr(const char *name, bufferlist *pbl, int *prval)
  {
    ::ObjectOperation *o = (::ObjectOperation *)impl;
 -  o->getxattr(name);
 +  o->getxattr(name, pbl, prval);
  }
  
 -void librados::ObjectReadOperation::getxattrs()
 +void librados::ObjectReadOperation::getxattrs(map<string, bufferlist> *pattrs, int *prval)
  {
    ::ObjectOperation *o = (::ObjectOperation *)impl;
 -  o->getxattrs();
 +  o->getxattrs(pattrs, prval);
  }
  
  void librados::ObjectWriteOperation::create(bool exclusive)
index c1be9306670605f86e009d4619d078ad5bd2a190,3645b23a8dcfbd565acfb40b256536aa0930b090..be65f6d8f1969447ca3e290cc865b3c9a4de4bc5
@@@ -266,9 -274,13 +266,13 @@@ int cls_cxx_map_read_header(cls_method_
    if (ret < 0)
      return ret;
  
-   // decode and return the header
-   bufferlist::iterator map_iter = ops[0].outdata.begin();
-   ::decode(*outbl, map_iter);
+   try {
+     //decode and return the header
 -    bufferlist::iterator map_iter = full_map.begin();
++    bufferlist::iterator map_iter = ops[0].outdata.begin();
+     ::decode(*outbl, map_iter);
+   } catch (buffer::error& e) {
+     return -EINVAL;
+   }
    return 0;
  }
  int cls_cxx_map_read_key(cls_method_context_t hctx, string key, bufferlist *outbl)
    string next_key;
    bufferlist next_val;
    __u32 nkeys;
 -  bufferlist::iterator map_iter = full_map.begin();
 +  bufferlist::iterator map_iter = ops[0].outdata.begin();
-   ::decode(header, map_iter);
-   ::decode(nkeys, map_iter);
-   while (nkeys) {
-     ::decode(next_key, map_iter);
-     ::decode(next_val, map_iter);
-     if (next_key == key) {
-       *outbl = next_val;
-       return 0;
+   try {
+     ::decode(header, map_iter);
+     ::decode(nkeys, map_iter);
+     while (nkeys) {
+       ::decode(next_key, map_iter);
+       ::decode(next_val, map_iter);
+       if (next_key == key) {
+         *outbl = next_val;
+         return 0;
+       }
+       if (next_key > key)
+         return -ENOENT;
+       --nkeys;
      }
-     if (next_key > key)
-       return -ENOENT;
-     --nkeys;
+   } catch (buffer::error& e) {
+     return -EINVAL;
    }
    return -ENOENT;
  }
diff --cc src/osd/OSD.cc
Simple merge
Simple merge
index a7e9050044f316163646fdf94e42f9abdf66cc3c,96a721821d803df8c7e4fb83acac2eaeaf43c13e..d11556a833f058e3246da9b47d0fe86957d07aa6
@@@ -1728,12 -1753,12 +1753,12 @@@ int RGWRados::read(void *ctx, rgw_obj& 
    if (r < 0)
      return r;
  
 -  op.read(ofs, size);
 +  op.read(ofs, size, &bl, NULL);
  
 -  r = io_ctx.operate(oid, &op, &bl);
 +  r = io_ctx.operate(oid, &op, NULL);
    if (r == -ECANCELED) {
      /* a race! object was replaced, we need to set attr on the original obj */
-     dout(0) << "RGWRados::get_obj: raced with another process, going to the shadow obj instead" << dendl;
+     dout(0) << "NOTICE: RGWRados::get_obj: raced with another process, going to the shadow obj instead" << dendl;
      string loc = obj.loc();
      rgw_obj shadow(obj.bucket, astate->shadow_obj, loc, shadow_ns);
      r = read(NULL, shadow, ofs, size, bl);