From patchwork Wed Feb 20 00:45:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2165751 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1D564DF24C for ; Wed, 20 Feb 2013 00:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933360Ab3BTApT (ORCPT ); Tue, 19 Feb 2013 19:45:19 -0500 Received: from mail-ie0-f170.google.com ([209.85.223.170]:62125 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932691Ab3BTApS (ORCPT ); Tue, 19 Feb 2013 19:45:18 -0500 Received: by mail-ie0-f170.google.com with SMTP id c11so9465631ieb.29 for ; Tue, 19 Feb 2013 16:45:17 -0800 (PST) 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 :content-type:content-transfer-encoding:x-gm-message-state; bh=2T5DcwvIhAlv7vb0P8AMZhn2faJqLUXDBgretReZhKY=; b=aXHDmSUCNEUE3gO0ft514hiAJTh0GH9Re31jVQEpZc0fngdP1jzKCd/G/YGo42hZu3 mDxPRg+tB+qSNpLGFGT6L5opcHYFq0WY+M3tMf7qh6rpm9wnOLQTZU2Be8RVYwtqHSAQ xBhB2aTo1bXDra5TeaMHIux4mXWgbZf72QTE/SxemuA9qsYi6Y1Qoc10ZkEDshKz+o6f S7Qs3W1ZKWMRAesZmwyRzCTlOI5n/Z/hHwX6m3JVezdu7vSAxBOte3l34tD8juRPgTbk so9ZiSaKHGyxzo4n9r2BWYAI4tBY35cU7b2ilSouviCwi2bsgBt1xpYgJb0ROP6Vl/4+ NuNw== X-Received: by 10.50.88.129 with SMTP id bg1mr9804845igb.33.1361321117782; Tue, 19 Feb 2013 16:45:17 -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 wo8sm14730424igb.6.2013.02.19.16.45.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 16:45:16 -0800 (PST) Message-ID: <51241C9B.209@inktank.com> Date: Tue, 19 Feb 2013 18:45:15 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: ceph-devel Subject: [PATCH] rbd: eliminate sparse warnings X-Gm-Message-State: ALoCoQkXYU69EDbiYmX7oHIBeUSTLk2eMh5jZ88jewA8uFHyi/xTf+rQWIfFrKOf/xn5g6tphA8A Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Fengguang Wu reminded me that there were outstanding sparse reports in the ceph and rbd code. This patch fixes these problems in rbd that lead to those reports: - Convert functions that are never referenced externally to have static scope. - Add a lockdep annotation to rbd_request_fn(), because it releases a lock before acquiring it again. This partially resolves: http://tracker.ceph.com/issues/4184 Reported-by: Fengguang Wu Signed-off-by: Alex Elder --- drivers/block/rbd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) va_list args; @@ -1482,7 +1482,8 @@ static void rbd_obj_request_destroy(struct kref *kref) * that comprises the image request, and the Linux request pointer * (if there is one). */ -struct rbd_img_request *rbd_img_request_create(struct rbd_device *rbd_dev, +static struct rbd_img_request *rbd_img_request_create( + struct rbd_device *rbd_dev, u64 offset, u64 length, bool write_request) { @@ -1903,6 +1904,7 @@ out: } static void rbd_request_fn(struct request_queue *q) + __releases(q->queue_lock) __acquires(q->queue_lock) { struct rbd_device *rbd_dev = q->queuedata; bool read_only = rbd_dev->mapping.read_only; @@ -2627,7 +2629,7 @@ static void rbd_spec_free(struct kref *kref) kfree(spec); } -struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, +static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, struct rbd_spec *spec) { struct rbd_device *rbd_dev; @@ -4178,7 +4180,7 @@ static void rbd_sysfs_cleanup(void) device_unregister(&rbd_root_dev); } -int __init rbd_init(void) +static int __init rbd_init(void) { int rc; @@ -4194,7 +4196,7 @@ int __init rbd_init(void) return 0; } -void __exit rbd_exit(void) +static void __exit rbd_exit(void) { rbd_sysfs_cleanup(); } diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b0eea3e..ff5476c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1127,7 +1127,7 @@ static bool obj_request_type_valid(enum obj_request_type type) } } -struct ceph_osd_req_op *rbd_osd_req_op_create(u16 opcode, ...) +static struct ceph_osd_req_op *rbd_osd_req_op_create(u16 opcode, ...) { struct ceph_osd_req_op *op;