From patchwork Sat Nov 10 03:54:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1723161 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 037993FC8F for ; Sat, 10 Nov 2012 03:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753101Ab2KJDyb (ORCPT ); Fri, 9 Nov 2012 22:54:31 -0500 Received: from mail-ia0-f174.google.com ([209.85.210.174]:58787 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751719Ab2KJDyb (ORCPT ); Fri, 9 Nov 2012 22:54:31 -0500 Received: by mail-ia0-f174.google.com with SMTP id y32so3216943iag.19 for ; Fri, 09 Nov 2012 19:54:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=dA+K5q2qYPUjK6ykfacuIR3CFUZVq9WU1NIdHYycAa4=; b=VxaN8eVeELJZK0uVEX7A6ZTVi4UypXDNyj6S1/3DQgpyiuohw85W6vY3upyp+j0VN2 LnjHNkJBLuQE/iSYwb5UaLosXF6W48jfx9HPPA66n/61hDfKloOoJJTD65xGcQ++S2FT f6HBUY/U2QUMVHR1P0GsGluNZ2x8/7ovTwvRqrvEqVHBWUyqKfSKFf6/FZ9XXvzxip0T 4fmX/Y4NvRaLnDORGqCoRMfAabMgGwEJex2apVoxzB3OmwvQsp994HttbrEQGL8OByQo DCvf+pvy11xTfgp8gf2tVN05mVk9w2CnzE5B7De2zLjGg2TBa/CwO5dO4dcwS2tVPAo/ 5PmA== Received: by 10.42.147.74 with SMTP id m10mr13467977icv.0.1352519670920; Fri, 09 Nov 2012 19:54:30 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id eo7sm437478igc.12.2012.11.09.19.54.29 (version=SSLv3 cipher=OTHER); Fri, 09 Nov 2012 19:54:30 -0800 (PST) Message-ID: <509DCFF9.7040801@inktank.com> Date: Fri, 09 Nov 2012 21:54:33 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH] rbd: don't bother setting snapid in rbd_do_request() X-Gm-Message-State: ALoCoQl81VHCj0yiODywClZuZ2UoaCJg0hm1aHmbwEseL/0bQ9/c2JfKHRmLULzvnQRxBDYST1bd Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org For some reason, the snapid field of the osd request header is explicitly set to CEPH_NOSNAP in rbd_do_request(). Just a few lines later--with no code that would access this field in between--a call is made to ceph_calc_raw_layout() passing the snapid provided to rbd_do_request(), which encodes the snapid value it is provided into that field instead. In other words, there is no need to fill in CEPH_NOSNAP, and doing so suggests it might be necessary. Don't do that any more. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b3d25c3..cd51216 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1134,7 +1134,6 @@ static int rbd_do_request(struct request *rq, u64 bno; struct timespec mtime = CURRENT_TIME; struct rbd_request *rbd_req; - struct ceph_osd_request_head *reqhead; struct ceph_osd_client *osdc; rbd_req = kzalloc(sizeof(*rbd_req), GFP_NOIO); @@ -1167,9 +1166,6 @@ static int rbd_do_request(struct request *rq, osd_req->r_priv = rbd_req; - reqhead = osd_req->r_request->front.iov_base; - reqhead->snapid = cpu_to_le64(CEPH_NOSNAP); - strncpy(osd_req->r_oid, object_name, sizeof(osd_req->r_oid)); osd_req->r_oid_len = strlen(osd_req->r_oid);