]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: disable ENOENT tracking within the object cacher 21308/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 9 Apr 2018 15:01:23 +0000 (11:01 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 9 Apr 2018 15:27:58 +0000 (11:27 -0400)
Now that the in-memory cache has been flattened, we don't want/need
to track the existence of individual objects within an image and
its parent hierarchy.

Fixes: http://tracker.ceph.com/issues/23597
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/LibrbdWriteback.cc
src/librbd/cache/ObjectCacherObjectDispatch.cc
src/librbd/io/ImageRequest.cc
src/librbd/io/ReadResult.cc
src/librbd/io/ReadResult.h

index 41127c4808a6635787c828a7bbf169f25dcadd7f..082cc22c7d071cdfa8bfdeed2ba19763cc1a8716 100644 (file)
@@ -145,7 +145,7 @@ namespace librbd {
     aio_comp->set_request_count(1);
 
     auto req_comp = new io::ReadResult::C_ObjectReadRequest(
-      aio_comp, off, len, {{0, len}}, false);
+      aio_comp, off, len, {{0, len}});
 
     auto req = io::ObjectDispatchSpec::create_read(
       m_ictx, io::OBJECT_DISPATCH_LAYER_CACHE, oid.name, object_no, off, len,
index 3a5ac40e7528922cea199037796b0d4a293828b2..504a181ef2f9d1e87771d321c5a61c398af83ba9 100644 (file)
@@ -132,7 +132,6 @@ void ObjectCacherObjectDispatch<I>::init() {
 
   m_object_set = new ObjectCacher::ObjectSet(nullptr,
                                              m_image_ctx->data_ctx.get_id(), 0);
-  m_object_set->return_enoent = true;
   m_object_cacher->start();
   m_cache_lock.Unlock();
 
index 496b43dcec3741ac54d84e57be1ebebe6c615798..0b2aa121c8f9d7b9a7644ecf10bf289f56e0b288 100644 (file)
@@ -208,7 +208,7 @@ void ImageReadRequest<I>::send_request() {
 
       auto req_comp = new io::ReadResult::C_ObjectReadRequest(
         aio_comp, extent.offset, extent.length,
-        std::move(extent.buffer_extents), true);
+        std::move(extent.buffer_extents));
       auto req = ObjectDispatchSpec::create_read(
         &image_ctx, OBJECT_DISPATCH_LAYER_NONE, extent.oid.name,
         extent.objectno, extent.offset, extent.length, snap_id, m_op_flags,
index 5a4dc18e9b612c9c7313f535968481853e628c8e..20ba6f045216bb6d7cff01d5549ed41a1f91ebed 100644 (file)
@@ -108,10 +108,9 @@ void ReadResult::C_ImageReadRequest::finish(int r) {
 
 ReadResult::C_ObjectReadRequest::C_ObjectReadRequest(
     AioCompletion *aio_completion, uint64_t object_off, uint64_t object_len,
-    Extents&& buffer_extents, bool ignore_enoent)
+    Extents&& buffer_extents)
   : aio_completion(aio_completion), object_off(object_off),
-    object_len(object_len), buffer_extents(std::move(buffer_extents)),
-    ignore_enoent(ignore_enoent) {
+    object_len(object_len), buffer_extents(std::move(buffer_extents)) {
   aio_completion->add_request();
 }
 
@@ -120,7 +119,7 @@ void ReadResult::C_ObjectReadRequest::finish(int r) {
   ldout(cct, 10) << "C_ObjectReadRequest: r=" << r
                  << dendl;
 
-  if (ignore_enoent && r == -ENOENT) {
+  if (r == -ENOENT) {
     r = 0;
   }
   if (r >= 0) {
index 5ae6e978aa591262acc4c97e7adc42c62928f587..6fb5e4a4c18f26ced445a65231401d90f7a1e370 100644 (file)
@@ -41,14 +41,12 @@ public:
     uint64_t object_off;
     uint64_t object_len;
     Extents buffer_extents;
-    bool ignore_enoent;
 
     bufferlist bl;
     ExtentMap extent_map;
 
     C_ObjectReadRequest(AioCompletion *aio_completion, uint64_t object_off,
-                        uint64_t object_len, Extents&& buffer_extents,
-                        bool ignore_enoent);
+                        uint64_t object_len, Extents&& buffer_extents);
 
     void finish(int r) override;
   };