From patchwork Sat Nov 10 03:43:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1723121 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 5CA703FC8F for ; Sat, 10 Nov 2012 03:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836Ab2KJDnw (ORCPT ); Fri, 9 Nov 2012 22:43:52 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:57136 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705Ab2KJDnw (ORCPT ); Fri, 9 Nov 2012 22:43:52 -0500 Received: by mail-ie0-f174.google.com with SMTP id k13so6904726iea.19 for ; Fri, 09 Nov 2012 19:43:52 -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:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=165NAG9uM7RNEUQZ+wCZcmBuYWHwUdNqWsvf3UZn3mQ=; b=XitL9XMQJGqWE6aSXDHmi7OW3Axb5szz2nkkP5zpHcYgMQPJMTQ3ATKIkrN2Xtifop IneU39zbpANlIg/M9ivskvHP0i7pDAEcoRaLbnheURLPpF5uu3kOJI6qcCot0tyJVA4v XlGuHCZh86kpUEb8L64kjlkH0LjXgpKAuuxMylpK0am4F81Z1+WOxzcq4tglSwFGh9w2 Zj5WJ3aiOsn3AZMymBlqrptlLVGKffaJwc56zNzWy1hvNrFMCYn1mK0QRIr+vtxTUdc2 dNebgDxmni074ymgqCQSgUoSC84OUjJQRkNmfTSmaPHfI5oHOxzMDke3DiNQH3FHQqRP tt6g== Received: by 10.43.135.135 with SMTP id ig7mr13323377icc.8.1352519032021; Fri, 09 Nov 2012 19:43:52 -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 i10sm2833293igb.12.2012.11.09.19.43.50 (version=SSLv3 cipher=OTHER); Fri, 09 Nov 2012 19:43:51 -0800 (PST) Message-ID: <509DCD7A.6020106@inktank.com> Date: Fri, 09 Nov 2012 21:43:54 -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 1/4] rbd: drop oid parameters from ceph_osdc_build_request() References: <509DCCE6.5060009@inktank.com> In-Reply-To: <509DCCE6.5060009@inktank.com> X-Gm-Message-State: ALoCoQnUo4XTpxUU4x1rhLGJ3H9BlGRxVAwE7BZ3BcSVCavnIO+h5xehNCSwow1xoG34aAciZ/Xk Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The last two parameters to ceph_osd_build_request() describe the object id, but the values passed always come from the osd request structure whose address is also provided. Get rid of those last two parameters. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 6 +----- include/linux/ceph/osd_client.h | 4 +--- net/ceph/osd_client.c | 13 +++++-------- 3 files changed, 7 insertions(+), 16 deletions(-) struct ceph_osd_request_head *head; @@ -397,9 +395,9 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, /* fill in oid */ - head->object_len = cpu_to_le32(oid_len); - memcpy(p, oid, oid_len); - p += oid_len; + head->object_len = cpu_to_le32(req->r_oid_len); + memcpy(p, req->r_oid, req->r_oid_len); + p += req->r_oid_len; src_op = src_ops; while (src_op->op) { @@ -498,8 +496,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, ceph_osdc_build_request(req, off, plen, ops, snapc, - mtime, - req->r_oid, req->r_oid_len); + mtime); return req; } diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 2d8f2ed..499e53a 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1178,11 +1178,7 @@ static int rbd_do_request(struct request *rq, snapid, ofs, &len, &bno, osd_req, ops); rbd_assert(ret == 0); - ceph_osdc_build_request(osd_req, ofs, &len, - ops, - snapc, - &mtime, - osd_req->r_oid, osd_req->r_oid_len); + ceph_osdc_build_request(osd_req, ofs, &len, ops, snapc, &mtime); if (linger_req) { ceph_osdc_set_request_linger(osdc, osd_req); diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index d9b880e..f2e5d2c 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -227,9 +227,7 @@ extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, u64 *plen, struct ceph_osd_req_op *src_ops, struct ceph_snap_context *snapc, - struct timespec *mtime, - const char *oid, - int oid_len); + struct timespec *mtime); extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, struct ceph_file_layout *layout, diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index ccbdfbb..540276e 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -368,9 +368,7 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, u64 *plen, struct ceph_osd_req_op *src_ops, struct ceph_snap_context *snapc, - struct timespec *mtime, - const char *oid, - int oid_len) + struct timespec *mtime) { struct ceph_msg *msg = req->r_request;