]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix OP_TRY_RENAME
authorSage Weil <sage@redhat.com>
Tue, 8 Mar 2016 20:49:16 +0000 (15:49 -0500)
committerSage Weil <sage@redhat.com>
Fri, 11 Mar 2016 15:41:39 +0000 (10:41 -0500)
We don't need to create the dest onode.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index f73b1cda770b650afa12f7b597c745c210116b63..2b8407a15ab3084f173fb689c70e787d6579b2e2 100644 (file)
@@ -4483,7 +4483,8 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_COLL_MOVE_RENAME:
-      {
+    case Transaction::OP_TRY_RENAME:
+    {
        assert(op->cid == op->dest_cid);
        const ghobject_t& noid = i.get_oid(op->dest_oid);
        OnodeRef& no = ovec[op->dest_oid];
@@ -4491,15 +4492,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
          no = c->get_onode(noid, false);
        }
        r = _rename(txc, c, o, no, noid);
-      }
-      break;
-
-    case Transaction::OP_TRY_RENAME:
-      {
-       const ghobject_t& noid = i.get_oid(op->dest_oid);
-       OnodeRef no = c->get_onode(noid, true);
-       r = _rename(txc, c, o, no, noid);
-       if (r == -ENOENT)
+       if (r == -ENOENT && op->op == Transaction::OP_TRY_RENAME)
          r = 0;
       }
       break;