]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set PULL subop cost to size of requested data
authorSage Weil <sage@inktank.com>
Mon, 21 Jan 2013 21:57:59 +0000 (13:57 -0800)
committerSamuel Just <sam.just@inktank.com>
Sat, 26 Jan 2013 01:16:19 +0000 (17:16 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a1bf8220e545f29b83d965f07b1abfbea06238b3)

src/messages/MOSDSubOp.h

index e69042b121a60ed1e264f584fa2eb80f0076da1d..50b1a92695724371f203907d2498f556242ba291 100644 (file)
@@ -86,6 +86,12 @@ public:
   // indicates that we must fix hobject_t encoding
   bool hobject_incorrect_pool;
 
+  int get_cost() const {
+    if (ops.size() == 1 && ops[0].op.op == CEPH_OSD_OP_PULL)
+      return ops[0].op.extent.length;
+    return data.length();
+  }
+
   virtual void decode_payload() {
     hobject_incorrect_pool = false;
     bufferlist::iterator p = payload.begin();