]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: remove duplicated code.
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 9 Mar 2017 13:57:26 +0000 (21:57 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 9 Mar 2017 13:57:26 +0000 (21:57 +0800)
In fact, the following code in this function
>> if (op->may_write()) {
>>  ....
>>    // invalid?
>>    if (m->get_snapid() != CEPH_NOSNAP) {
>>      dout(20) << __func__ << ": write to clone not valid " << *m << dendl;
>>      osd->reply_op_error(op, -EINVAL);
>>      return;
>>    }
has the same function. So remove the duplicated code.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/osd/PrimaryLogPG.cc

index c1d79481832c0ddb435f87c279f31e8ca262179e..97f06ecfb00e79b1824f52277270a61737e1703f 100644 (file)
@@ -1962,13 +1962,6 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
     wait_for_degraded_object(snapdir, op);
     return;
   }
-  // asking for SNAPDIR is only ok for reads
-  if (m->get_snapid() == CEPH_SNAPDIR && op->may_write()) {
-    dout(20) << __func__ << ": write to snapdir not valid " << *m << dendl;
-    osd->reply_op_error(op, -EINVAL);
-    return;
-  }
 
   // dup/resent?
   if (op->may_write() || op->may_cache()) {