From patchwork Fri Apr 26 12:05:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2493271 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 A730F3FC64 for ; Fri, 26 Apr 2013 12:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085Ab3DZMF4 (ORCPT ); Fri, 26 Apr 2013 08:05:56 -0400 Received: from mail-ia0-f170.google.com ([209.85.210.170]:37574 "EHLO mail-ia0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654Ab3DZMFz (ORCPT ); Fri, 26 Apr 2013 08:05:55 -0400 Received: by mail-ia0-f170.google.com with SMTP id k20so555724iak.29 for ; Fri, 26 Apr 2013 05:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=aw8S0NDKCNNu24lm5Pfpcpc1eWwd+3UcYJUhPnJqun8=; b=XDg/V+YlW07VvjbWbVlGbRwdn/tpU7AndATB+yjnGoPTFJ47Zd3799y90pNllQZbfX Ehc0kyaSdiXhvSgvQt9LruPy2OIx3kyV2WVflBWYgUfrYD44mZTF8+UJMgdcV0YiT3vR LJuRT0XdhK1gHZPqFV0D4efoE8ipeTBcfs1DCZYs3PVz+ywZlNq4TuRvt11NdME+pbWm QXNg9Axy06K/cWLpMTSlsIhRJk58ypR3MwSFsHPGK9oE54dOrZbk0LkqCkKCyicQAuWo m/tzpm7cll/S/9WEKYTUUZErt9J3s4uLqciLnPgwH2uSUGsLVE+A9CWwIvLAEfmJMDzG 3zdg== X-Received: by 10.43.90.137 with SMTP id bi9mr23824442icc.51.1366977954762; Fri, 26 Apr 2013 05:05:54 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id dy5sm2838369igc.1.2013.04.26.05.05.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 05:05:54 -0700 (PDT) Message-ID: <517A6DA1.90809@inktank.com> Date: Fri, 26 Apr 2013 07:05:53 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 2/6] rbd: make snap_size order parameter optional References: <517A6D39.80000@inktank.com> In-Reply-To: <517A6D39.80000@inktank.com> X-Gm-Message-State: ALoCoQn916ZHrCXmWL6chb0z4OPTBUxkeV5EEVxS3H5gaLCv5P12aW7tD6Xn1aZ777Mj8FqnwamM Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Only one of the two callers of _rbd_dev_v2_snap_size() needs the order value returned. So make that an optional argument--a null pointer if the caller doesn't need it. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) dout(" snap_id 0x%016llx order = %u, snap_size = %llu\n", @@ -3939,11 +3940,10 @@ static char *rbd_dev_v2_snap_info(struct rbd_device *rbd_dev, u32 which, u64 *snap_size, u64 *snap_features) { u64 snap_id; - u8 order; int ret; snap_id = rbd_dev->header.snapc->snaps[which]; - ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, &order, snap_size); + ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, NULL, snap_size); if (ret) return ERR_PTR(ret); ret = _rbd_dev_v2_snap_features(rbd_dev, snap_id, snap_features); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 28b652c..1e01f0d 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3494,7 +3494,8 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id, if (ret < sizeof (size_buf)) return -ERANGE; - *order = size_buf.order; + if (order) + *order = size_buf.order; *snap_size = le64_to_cpu(size_buf.size);