From: Alex Elder <elder@inktank.com>
To: "ceph-devel@vger.kernel.org >> ceph-devel" <ceph-devel@vger.kernel.org>
Subject: [PATCH, v2] rbd: eliminate sparse warnings
Date: Fri, 22 Feb 2013 11:21:02 -0600 [thread overview]
Message-ID: <5127A8FE.9050002@inktank.com> (raw)
In-Reply-To: <5127A85D.1070000@inktank.com>
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 <fengguang.wu@intel.com>
Signed-off-by: Alex Elder <elder@inktank.com>
---
v2: rebased
drivers/block/rbd.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a9c86ca..c6b15d4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1141,7 +1141,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;
va_list args;
@@ -1537,7 +1537,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)
{
@@ -1971,6 +1972,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;
@@ -2705,7 +2707,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;
@@ -4256,7 +4258,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;
@@ -4272,7 +4274,7 @@ int __init rbd_init(void)
return 0;
}
-void __exit rbd_exit(void)
+static void __exit rbd_exit(void)
{
rbd_sysfs_cleanup();
}
--
1.7.9.5
next prev parent reply other threads:[~2013-02-22 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-22 17:18 Updated sparse warning message patches Alex Elder
2013-02-22 17:21 ` Alex Elder [this message]
2013-02-22 17:21 ` [PATCH, v2] ceph: eliminate sparse warnings in fs code Alex Elder
2013-02-22 17:21 ` [PATCH, v2] libceph: eliminate sparse warnings Alex Elder
2013-02-22 17:21 ` [PATCH 0/5, v2] libceph clean up con_work() Alex Elder
2013-02-22 17:23 ` [PATCH 1/5] libceph: encapsulate connection backoff Alex Elder
2013-02-22 17:23 ` [PATCH 2/5] libceph: separate non-locked fault handling Alex Elder
2013-02-22 17:26 ` Alex Elder
2013-02-22 17:32 ` Alex Elder
2013-02-22 17:26 ` [PATCH 3/5, v2] libceph: use a flag to indicate a fault has occurred Alex Elder
2013-02-22 17:30 ` [PATCH 4/5, v2] libceph: use a do..while loop in con_work() Alex Elder
2013-02-22 17:30 ` [PATCH 5/5, v2] libceph: indent properly Alex Elder
2013-02-25 19:15 ` Updated sparse warning message patches Josh Durgin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5127A8FE.9050002@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.