]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: skip promotion for flush/evict op
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Thu, 12 Mar 2015 06:26:11 +0000 (14:26 +0800)
committerZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 17 Apr 2015 01:12:03 +0000 (09:12 +0800)
In the cases when issuing flush/evict op on an object which is not in
the cache tier, there is no need to promote the object or proxy/redirect
the op.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/osd/OSD.cc

index c5cc613b635c0776b0acf917254d8efd176f0672..8946376b2fe211f443a7358d21f5d50cbf81025f 100644 (file)
@@ -8677,6 +8677,14 @@ int OSD::init_op_flags(OpRequestRef& op)
       }
       break;
 
+    case CEPH_OSD_OP_CACHE_TRY_FLUSH:
+    case CEPH_OSD_OP_CACHE_FLUSH:
+    case CEPH_OSD_OP_CACHE_EVICT:
+      // If try_flush/flush/evict is the only op, no need to promote.
+      if (m->ops.size() == 1) {
+       op->set_skip_promote();
+      }
+
     default:
       break;
     }