diff options
author | Alex Elder <elder@inktank.com> | 2013-02-19 13:25:56 -0500 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-02-25 16:37:08 -0500 |
commit | cc344fa1b541b116190291d366583585f03d0fe6 (patch) | |
tree | babe0e154582d2542df314fee9c662ba43fe9553 /drivers/block/rbd.c | |
parent | c9ffc77adebf9dfe3026ede6c8b3c61586b485b7 (diff) |
rbd: eliminate sparse warnings
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>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index a9c86ca5889f..c6b15d4b3d73 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) | |||
1141 | } | 1141 | } |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | struct ceph_osd_req_op *rbd_osd_req_op_create(u16 opcode, ...) | 1144 | static struct ceph_osd_req_op *rbd_osd_req_op_create(u16 opcode, ...) |
1145 | { | 1145 | { |
1146 | struct ceph_osd_req_op *op; | 1146 | struct ceph_osd_req_op *op; |
1147 | va_list args; | 1147 | va_list args; |
@@ -1537,7 +1537,8 @@ static void rbd_obj_request_destroy(struct kref *kref) | |||
1537 | * that comprises the image request, and the Linux request pointer | 1537 | * that comprises the image request, and the Linux request pointer |
1538 | * (if there is one). | 1538 | * (if there is one). |
1539 | */ | 1539 | */ |
1540 | struct rbd_img_request *rbd_img_request_create(struct rbd_device *rbd_dev, | 1540 | static struct rbd_img_request *rbd_img_request_create( |
1541 | struct rbd_device *rbd_dev, | ||
1541 | u64 offset, u64 length, | 1542 | u64 offset, u64 length, |
1542 | bool write_request) | 1543 | bool write_request) |
1543 | { | 1544 | { |
@@ -1971,6 +1972,7 @@ out: | |||
1971 | } | 1972 | } |
1972 | 1973 | ||
1973 | static void rbd_request_fn(struct request_queue *q) | 1974 | static void rbd_request_fn(struct request_queue *q) |
1975 | __releases(q->queue_lock) __acquires(q->queue_lock) | ||
1974 | { | 1976 | { |
1975 | struct rbd_device *rbd_dev = q->queuedata; | 1977 | struct rbd_device *rbd_dev = q->queuedata; |
1976 | bool read_only = rbd_dev->mapping.read_only; | 1978 | bool read_only = rbd_dev->mapping.read_only; |
@@ -2705,7 +2707,7 @@ static void rbd_spec_free(struct kref *kref) | |||
2705 | kfree(spec); | 2707 | kfree(spec); |
2706 | } | 2708 | } |
2707 | 2709 | ||
2708 | struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, | 2710 | static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, |
2709 | struct rbd_spec *spec) | 2711 | struct rbd_spec *spec) |
2710 | { | 2712 | { |
2711 | struct rbd_device *rbd_dev; | 2713 | struct rbd_device *rbd_dev; |
@@ -4256,7 +4258,7 @@ static void rbd_sysfs_cleanup(void) | |||
4256 | device_unregister(&rbd_root_dev); | 4258 | device_unregister(&rbd_root_dev); |
4257 | } | 4259 | } |
4258 | 4260 | ||
4259 | int __init rbd_init(void) | 4261 | static int __init rbd_init(void) |
4260 | { | 4262 | { |
4261 | int rc; | 4263 | int rc; |
4262 | 4264 | ||
@@ -4272,7 +4274,7 @@ int __init rbd_init(void) | |||
4272 | return 0; | 4274 | return 0; |
4273 | } | 4275 | } |
4274 | 4276 | ||
4275 | void __exit rbd_exit(void) | 4277 | static void __exit rbd_exit(void) |
4276 | { | 4278 | { |
4277 | rbd_sysfs_cleanup(); | 4279 | rbd_sysfs_cleanup(); |
4278 | } | 4280 | } |