Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1481868
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 18/47] block-rbd: Fix jump targets in rbd_queue_workfn() |
| Date | 2016-09-12 21:10 +0200 |
| Message-ID | <sgEMa-7tX-35@gated-at.bofh.it> (permalink) |
| References | <qEuGl-43C-5@gated-at.bofh.it> <sgEsN-76N-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:28:23 +0200
* Adjust jump targets according to the current Linux coding
style convention.
* Delete a duplicate check then at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 97d4d63..2b5f76e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4113,7 +4113,7 @@ static void rbd_queue_workfn(struct work_struct *work)
dout("%s: non-fs request type %d\n", __func__,
(int) rq->cmd_type);
result = -EIO;
- goto err;
+ goto end_request;
}
if (req_op(rq) == REQ_OP_DISCARD)
@@ -4128,7 +4128,7 @@ static void rbd_queue_workfn(struct work_struct *work)
if (!length) {
dout("%s: zero-length request\n", __func__);
result = 0;
- goto err_rq;
+ goto put_snap_context;
}
/* Only reads are allowed to a read-only device */
@@ -4136,7 +4136,7 @@ static void rbd_queue_workfn(struct work_struct *work)
if (op_type != OBJ_OP_READ) {
if (rbd_dev->mapping.read_only) {
result = -EROFS;
- goto err_rq;
+ goto warn_more;
}
rbd_assert(rbd_dev->spec->snap_id == CEPH_NOSNAP);
}
@@ -4151,14 +4151,14 @@ static void rbd_queue_workfn(struct work_struct *work)
dout("request for non-existent snapshot");
rbd_assert(rbd_dev->spec->snap_id != CEPH_NOSNAP);
result = -ENXIO;
- goto err_rq;
+ goto warn_more;
}
if (offset && length > U64_MAX - offset + 1) {
rbd_warn(rbd_dev, "bad request range (%llu~%llu)", offset,
length);
result = -EINVAL;
- goto err_rq; /* Shouldn't happen */
+ goto warn_more; /* Shouldn't happen */
}
blk_mq_start_request(rq);
@@ -4176,7 +4176,7 @@ static void rbd_queue_workfn(struct work_struct *work)
rbd_warn(rbd_dev, "beyond EOD (%llu~%llu > %llu)", offset,
length, mapping_size);
result = -EIO;
- goto err_rq;
+ goto warn_more;
}
if (must_be_locked) {
@@ -4189,7 +4189,7 @@ static void rbd_queue_workfn(struct work_struct *work)
snapc);
if (!img_request) {
result = -ENOMEM;
- goto err_unlock;
+ goto unlock;
}
img_request->rq = rq;
snapc = NULL; /* img_request consumes a ref */
@@ -4201,27 +4201,30 @@ static void rbd_queue_workfn(struct work_struct *work)
result = rbd_img_request_fill(img_request, OBJ_REQUEST_BIO,
rq->bio);
if (result)
- goto err_img_request;
+ goto put_request;
result = rbd_img_request_submit(img_request);
if (result)
- goto err_img_request;
+ goto put_request;
if (must_be_locked)
up_read(&rbd_dev->lock_rwsem);
return;
-
-err_img_request:
+ put_request:
rbd_img_request_put(img_request);
-err_unlock:
+ unlock:
if (must_be_locked)
up_read(&rbd_dev->lock_rwsem);
-err_rq:
- if (result)
- rbd_warn(rbd_dev, "%s %llx at %llx result %d",
- obj_op_name(op_type), length, offset, result);
+ warn_more:
+ rbd_warn(rbd_dev,
+ "%s %llx at %llx result %d",
+ obj_op_name(op_type),
+ length,
+ offset,
+ result);
+ put_snap_context:
ceph_put_snap_context(snapc);
-err:
+ end_request:
blk_mq_end_request(rq, result);
}
--
2.10.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 20:50 +0200
[PATCH 05/47] block-rbd: One function call less in rbd_dev_image_id() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 20:50 +0200
[PATCH 08/47] block-rbd: Rename jump labels in rbd_dev_v2_snap_context() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 09/47] block-rbd: Rename a jump label in rbd_spec_fill_names() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 13/47] block-rbd: Delete an unnecessary initialisation in rbd_dev_v2_parent_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 11/47] block-rbd: Delete three unnecessary initialisations in rbd_dev_image_name() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 10/47] block-rbd: One function call less in rbd_dev_image_name() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 14/47] block-rbd: Rename a jump label in rbd_dev_v2_object_prefix() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 12/47] block-rbd: One function call less in rbd_dev_v2_parent_info() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:00 +0200
[PATCH 20/47] block-rbd: Rename a jump label in rbd_register_watch() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 19/47] block-rbd: Rename a jump label in rbd_reregister_watch() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 21/47] block-rbd: Rename jump labels in rbd_try_lock() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 16/47] block-rbd: Rename jump labels in rbd_dev_v1_header_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
Re: [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create() Ilya Dryomov <idryomov@gmail.com> - 2016-09-13 10:10 +0200
[PATCH 17/47] block-rbd: Rename jump labels in rbd_init_disk() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 18/47] block-rbd: Fix jump targets in rbd_queue_workfn() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 22/47] block-rbd: Rename a jump label in find_watcher() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:10 +0200
[PATCH 30/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_callback() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 29/47] block-rbd: Delete an unnecessary initialisation in rbd_img_obj_exists_submit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 24/47] block-rbd: Rename jump labels in rbd_request_lock() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 23/47] block-rbd: Rename jump labels in get_lock_owner_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 26/47] block-rbd: Rename a jump label in rbd_img_parent_read_callback() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 31/47] block-rbd: Fix three jump targets in rbd_img_obj_parent_read_full() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 27/47] block-rbd: Rename a jump label in rbd_img_request_submit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 25/47] block-rbd: Fix jump targets in rbd_img_parent_read() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
[PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:20 +0200
Re: [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit() Ilya Dryomov <idryomov@gmail.com> - 2016-09-13 10:20 +0200
[PATCH 39/47] block-rbd: Rename a jump label in rbd_ioctl_set_ro() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 35/47] block-rbd: Rename jump labels in rbd_osd_req_create_copyup() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 33/47] block-rbd: Adjust the position of a jump label in rbd_img_request_fill() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 38/47] block-rbd: Rename jump labels in rbd_client_create() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 32/47] block-rbd: Rename a jump label in rbd_img_obj_parent_read_full_callback() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 34/47] block-rbd: Rename a jump label in rbd_img_obj_callback() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 37/47] block-rbd: Rename a jump label in bio_chain_clone_range() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 36/47] block-rbd: Rename jump labels in rbd_osd_req_create() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:30 +0200
[PATCH 47/47] block-rbd: Delete unwanted spaces behind usages of the sizeof operator SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 44/47] block-rbd: Delete an unnecessary initialisation in do_rbd_add() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 45/47] block-rbd: Rename a jump label in rbd_slab_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 42/47] block-rbd: Rename jump labels in rbd_dev_image_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 40/47] block-rbd: One function call less in rbd_dev_probe_parent() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 46/47] block-rbd: Rename jump labels in rbd_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 41/47] block-rbd: Rename jump labels in rbd_dev_device_setup() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
[PATCH 43/47] block-rbd: Rename jump labels in do_rbd_add() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-12 21:40 +0200
csiph-web