* [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations
[not found] <566ABCD9.1060404@users.sourceforge.net>
@ 2016-09-12 18:40 ` SF Markus Elfring
2016-09-12 18:42 ` [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk() SF Markus Elfring
` (48 more replies)
0 siblings, 49 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:40 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:35:20 +0200
Several update suggestions were taken into account
from static source code analysis.
Markus Elfring (47):
Use kmalloc_array() in rbd_header_from_disk()
Less function calls in rbd_header_from_disk() after error detection
Adjust the position of a jump label in rbd_header_from_disk()
Refactor two calls for memory allocations in rbd_dev_image_id()
One function call less in rbd_dev_image_id() after error detection
Rename jump labels in rbd_add_parse_args()
Rename a jump label in rbd_dev_v2_snap_name()
Rename jump labels in rbd_dev_v2_snap_context()
Rename a jump label in rbd_spec_fill_names()
One function call less in rbd_dev_image_name() after error detection
Delete three unnecessary initialisations in rbd_dev_image_name()
One function call less in rbd_dev_v2_parent_info() after error detection
Delete an unnecessary initialisation in rbd_dev_v2_parent_info()
Rename a jump label in rbd_dev_v2_object_prefix()
Rename jump labels in rbd_dev_create()
Rename jump labels in rbd_dev_v1_header_info()
Rename jump labels in rbd_init_disk()
Fix jump targets in rbd_queue_workfn()
Rename a jump label in rbd_reregister_watch()
Rename a jump label in rbd_register_watch()
Rename jump labels in rbd_try_lock()
Rename a jump label in find_watcher()
Rename jump labels in get_lock_owner_info()
Rename jump labels in rbd_request_lock()
Fix jump targets in rbd_img_parent_read()
Rename a jump label in rbd_img_parent_read_callback()
Rename a jump label in rbd_img_request_submit()
Refactor a jump target in rbd_img_obj_exists_submit()
Delete an unnecessary initialisation in rbd_img_obj_exists_submit()
Refactor a jump target in rbd_img_obj_exists_callback()
Fix three jump targets in rbd_img_obj_parent_read_full()
Rename a jump label in rbd_img_obj_parent_read_full_callback()
Adjust the position of a jump label in rbd_img_request_fill()
Rename a jump label in rbd_img_obj_callback()
Rename jump labels in rbd_osd_req_create_copyup()
Rename jump labels in rbd_osd_req_create()
Rename a jump label in bio_chain_clone_range()
Rename jump labels in rbd_client_create()
Rename a jump label in rbd_ioctl_set_ro()
One function call less in rbd_dev_probe_parent() after error detection
Rename jump labels in rbd_dev_device_setup()
Rename jump labels in rbd_dev_image_probe()
Rename jump labels in do_rbd_add()
Delete an unnecessary initialisation in do_rbd_add()
Rename a jump label in rbd_slab_init()
Rename jump labels in rbd_init()
Delete unwanted spaces behind usages of the sizeof operator
drivers/block/rbd.c | 544 ++++++++++++++++++++++++++--------------------------
1 file changed, 272 insertions(+), 272 deletions(-)
--
2.10.0
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
@ 2016-09-12 18:42 ` SF Markus Elfring
2016-09-14 15:25 ` Ilya Dryomov
2016-09-12 18:43 ` [PATCH 02/47] block-rbd: Less function calls in rbd_header_from_disk() after error detection SF Markus Elfring
` (47 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:42 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 11 Sep 2016 12:21:25 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Delete the local variable "size" which became unnecessary with
this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 35fc1da..e406c27 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -979,7 +979,6 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
char *snap_names = NULL;
u64 *snap_sizes = NULL;
u32 snap_count;
- size_t size;
int ret = -ENOMEM;
u32 i;
@@ -1017,9 +1016,9 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
goto out_err;
/* ...as well as the array of their sizes. */
-
- size = snap_count * sizeof (*header->snap_sizes);
- snap_sizes = kmalloc(size, GFP_KERNEL);
+ snap_sizes = kmalloc_array(snap_count,
+ sizeof(*header->snap_sizes),
+ GFP_KERNEL);
if (!snap_sizes)
goto out_err;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 02/47] block-rbd: Less function calls in rbd_header_from_disk() after error detection
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
2016-09-12 18:42 ` [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk() SF Markus Elfring
@ 2016-09-12 18:43 ` SF Markus Elfring
2016-09-13 7:58 ` Ilya Dryomov
2016-09-12 18:44 ` [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk() SF Markus Elfring
` (46 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:43 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 11 Sep 2016 13:18:57 +0200
The functions "ceph_put_snap_context" and "kfree" were called in a few
cases by the function "rbd_header_from_disk" during error handling
even if the passed variables contained a null pointer.
Adjust jump targets according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e406c27..f4212e1 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1001,7 +1001,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
snap_count = le32_to_cpu(ondisk->snap_count);
snapc = ceph_create_snap_context(snap_count, GFP_KERNEL);
if (!snapc)
- goto out_err;
+ goto free_prefix;
snapc->seq = le64_to_cpu(ondisk->snap_seq);
if (snap_count) {
struct rbd_image_snap_ondisk *snaps;
@@ -1013,14 +1013,14 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
goto out_2big;
snap_names = kmalloc(snap_names_len, GFP_KERNEL);
if (!snap_names)
- goto out_err;
+ goto put_snap_context;
/* ...as well as the array of their sizes. */
snap_sizes = kmalloc_array(snap_count,
sizeof(*header->snap_sizes),
GFP_KERNEL);
if (!snap_sizes)
- goto out_err;
+ goto free_names;
/*
* Copy the names, and fill in each snapshot's id
@@ -1066,10 +1066,12 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
return 0;
out_2big:
ret = -EIO;
-out_err:
kfree(snap_sizes);
+ free_names:
kfree(snap_names);
+ put_snap_context:
ceph_put_snap_context(snapc);
+ free_prefix:
kfree(object_prefix);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
2016-09-12 18:42 ` [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk() SF Markus Elfring
2016-09-12 18:43 ` [PATCH 02/47] block-rbd: Less function calls in rbd_header_from_disk() after error detection SF Markus Elfring
@ 2016-09-12 18:44 ` SF Markus Elfring
2016-09-13 8:01 ` Ilya Dryomov
2016-09-12 18:45 ` [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id() SF Markus Elfring
` (45 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:44 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 11 Sep 2016 13:37:34 +0200
Add a space character before a single jump label in this function
according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f4212e1..d61a066 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1064,7 +1064,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
header->snap_sizes = snap_sizes;
return 0;
-out_2big:
+ out_2big:
ret = -EIO;
kfree(snap_sizes);
free_names:
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (2 preceding siblings ...)
2016-09-12 18:44 ` [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk() SF Markus Elfring
@ 2016-09-12 18:45 ` SF Markus Elfring
2016-09-13 8:03 ` Ilya Dryomov
2016-09-12 18:46 ` [PATCH 05/47] block-rbd: One function call less in rbd_dev_image_id() after error detection SF Markus Elfring
` (44 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:45 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 11 Sep 2016 14:48:41 +0200
* Pass the sizes for memory allocations to the corresponding functions
directly without storing the calculated values in an
intermediate variable.
* Delete the local variable "size" which became unnecessary with
this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d61a066..c1da844 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5833,7 +5833,6 @@ again:
static int rbd_dev_image_id(struct rbd_device *rbd_dev)
{
int ret;
- size_t size;
char *object_name;
void *response;
char *image_id;
@@ -5854,17 +5853,16 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
* First, see if the format 2 image id file exists, and if
* so, get the image's persistent id from it.
*/
- size = sizeof (RBD_ID_PREFIX) + strlen(rbd_dev->spec->image_name);
- object_name = kmalloc(size, GFP_NOIO);
+ object_name = kmalloc(sizeof(RBD_ID_PREFIX)
+ + strlen(rbd_dev->spec->image_name),
+ GFP_NOIO);
if (!object_name)
return -ENOMEM;
sprintf(object_name, "%s%s", RBD_ID_PREFIX, rbd_dev->spec->image_name);
dout("rbd id object name is %s\n", object_name);
/* Response will be an encoded string, which includes a length */
-
- size = sizeof (__le32) + RBD_IMAGE_ID_LEN_MAX;
- response = kzalloc(size, GFP_NOIO);
+ response = kzalloc(sizeof(__le32) + RBD_IMAGE_ID_LEN_MAX, GFP_NOIO);
if (!response) {
ret = -ENOMEM;
goto out;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 05/47] block-rbd: One function call less in rbd_dev_image_id() after error detection
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (3 preceding siblings ...)
2016-09-12 18:45 ` [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id() SF Markus Elfring
@ 2016-09-12 18:46 ` SF Markus Elfring
2016-09-12 18:46 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations Joe Perches
` (43 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:46 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 11 Sep 2016 15:05:49 +0200
The kfree() function was called in one case by the rbd_dev_image_id()
function during error handling even if the passed variable "response"
contained a null pointer.
Adjust a jump target according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index c1da844..a6d9a06 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5865,7 +5865,7 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
response = kzalloc(sizeof(__le32) + RBD_IMAGE_ID_LEN_MAX, GFP_NOIO);
if (!response) {
ret = -ENOMEM;
- goto out;
+ goto free_name;
}
/* If it doesn't exist we'll assume it's a format 1 image */
@@ -5893,8 +5893,8 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
rbd_dev->spec->image_id = image_id;
dout("image_id is %s\n", image_id);
}
-out:
kfree(response);
+ free_name:
kfree(object_name);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* Re: [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (4 preceding siblings ...)
2016-09-12 18:46 ` [PATCH 05/47] block-rbd: One function call less in rbd_dev_image_id() after error detection SF Markus Elfring
@ 2016-09-12 18:46 ` Joe Perches
2016-09-12 18:47 ` [PATCH 06/47] block-rbd: Rename jump labels in rbd_add_parse_args() SF Markus Elfring
` (42 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: Joe Perches @ 2016-09-12 18:46 UTC (permalink / raw)
To: SF Markus Elfring, ceph-devel, Alex Elder, Ilya Dryomov,
Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
On Mon, 2016-09-12 at 20:40 +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 12 Sep 2016 20:35:20 +0200
This email header and all children contains:
References: <566ABCD9.1060404@users.sourceforge.net>
Markus, just stop using references lines.
Stop.
It doesn't add any value for any patch you've submitted here.
^ permalink raw reply [flat|nested] 65+ messages in thread
* [PATCH 06/47] block-rbd: Rename jump labels in rbd_add_parse_args()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (5 preceding siblings ...)
2016-09-12 18:46 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations Joe Perches
@ 2016-09-12 18:47 ` SF Markus Elfring
2016-09-13 8:05 ` Ilya Dryomov
2016-09-12 18:48 ` [PATCH 07/47] block-rbd: Rename a jump label in rbd_dev_v2_snap_name() SF Markus Elfring
` (41 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:47 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 11 Sep 2016 15:20:48 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a6d9a06..dd4da1f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5709,27 +5709,27 @@ static int rbd_add_parse_args(const char *buf,
return -ENOMEM;
if (!*options) {
rbd_warn(NULL, "no options provided");
- goto out_err;
+ goto free_options;
}
spec = rbd_spec_alloc();
if (!spec)
- goto out_mem;
+ goto status_indication;
spec->pool_name = dup_token(&buf, NULL);
if (!spec->pool_name)
- goto out_mem;
+ goto status_indication;
if (!*spec->pool_name) {
rbd_warn(NULL, "no pool name provided");
- goto out_err;
+ goto free_options;
}
spec->image_name = dup_token(&buf, NULL);
if (!spec->image_name)
- goto out_mem;
+ goto status_indication;
if (!*spec->image_name) {
rbd_warn(NULL, "no image name provided");
- goto out_err;
+ goto free_options;
}
/*
@@ -5742,11 +5742,11 @@ static int rbd_add_parse_args(const char *buf,
len = sizeof (RBD_SNAP_HEAD_NAME) - 1;
} else if (len > RBD_MAX_SNAP_NAME_LEN) {
ret = -ENAMETOOLONG;
- goto out_err;
+ goto free_options;
}
snap_name = kmemdup(buf, len + 1, GFP_KERNEL);
if (!snap_name)
- goto out_mem;
+ goto status_indication;
*(snap_name + len) = '\0';
spec->snap_name = snap_name;
@@ -5754,7 +5754,7 @@ static int rbd_add_parse_args(const char *buf,
rbd_opts = kzalloc(sizeof (*rbd_opts), GFP_KERNEL);
if (!rbd_opts)
- goto out_mem;
+ goto status_indication;
rbd_opts->read_only = RBD_READ_ONLY_DEFAULT;
rbd_opts->queue_depth = RBD_QUEUE_DEPTH_DEFAULT;
@@ -5764,7 +5764,7 @@ static int rbd_add_parse_args(const char *buf,
parse_rbd_opts_token, rbd_opts);
if (IS_ERR(copts)) {
ret = PTR_ERR(copts);
- goto out_err;
+ goto free_options;
}
kfree(options);
@@ -5773,9 +5773,9 @@ static int rbd_add_parse_args(const char *buf,
*rbd_spec = spec;
return 0;
-out_mem:
+ status_indication:
ret = -ENOMEM;
-out_err:
+ free_options:
kfree(rbd_opts);
rbd_spec_put(spec);
kfree(options);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 07/47] block-rbd: Rename a jump label in rbd_dev_v2_snap_name()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (6 preceding siblings ...)
2016-09-12 18:47 ` [PATCH 06/47] block-rbd: Rename jump labels in rbd_add_parse_args() SF Markus Elfring
@ 2016-09-12 18:48 ` SF Markus Elfring
2016-09-12 18:49 ` [PATCH 08/47] block-rbd: Rename jump labels in rbd_dev_v2_snap_context() SF Markus Elfring
` (40 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:48 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 17:53:19 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index dd4da1f..4164551 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5532,18 +5532,18 @@ static const char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev,
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0) {
snap_name = ERR_PTR(ret);
- goto out;
+ goto free_buffer;
}
p = reply_buf;
end = reply_buf + ret;
snap_name = ceph_extract_encoded_string(&p, end, NULL, GFP_KERNEL);
if (IS_ERR(snap_name))
- goto out;
+ goto free_buffer;
dout(" snap_id 0x%016llx snap_name = %s\n",
(unsigned long long)snap_id, snap_name);
-out:
+ free_buffer:
kfree(reply_buf);
return snap_name;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 08/47] block-rbd: Rename jump labels in rbd_dev_v2_snap_context()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (7 preceding siblings ...)
2016-09-12 18:48 ` [PATCH 07/47] block-rbd: Rename a jump label in rbd_dev_v2_snap_name() SF Markus Elfring
@ 2016-09-12 18:49 ` SF Markus Elfring
2016-09-12 18:50 ` [PATCH 09/47] block-rbd: Rename a jump label in rbd_spec_fill_names() SF Markus Elfring
` (39 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:49 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 17:55:51 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4164551..45109ff 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5465,13 +5465,13 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
reply_buf, size);
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
- goto out;
+ goto free_buffer;
p = reply_buf;
end = reply_buf + ret;
ret = -ERANGE;
- ceph_decode_64_safe(&p, end, seq, out);
- ceph_decode_32_safe(&p, end, snap_count, out);
+ ceph_decode_64_safe(&p, end, seq, free_buffer);
+ ceph_decode_32_safe(&p, end, snap_count, free_buffer);
/*
* Make sure the reported number of snapshot ids wouldn't go
@@ -5482,16 +5482,16 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
if (snap_count > (SIZE_MAX - sizeof (struct ceph_snap_context))
/ sizeof (u64)) {
ret = -EINVAL;
- goto out;
+ goto free_buffer;
}
if (!ceph_has_room(&p, end, snap_count * sizeof (__le64)))
- goto out;
+ goto free_buffer;
ret = 0;
snapc = ceph_create_snap_context(snap_count, GFP_KERNEL);
if (!snapc) {
ret = -ENOMEM;
- goto out;
+ goto free_buffer;
}
snapc->seq = seq;
for (i = 0; i < snap_count; i++)
@@ -5502,7 +5502,7 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
dout(" snap context seq = %llu, snap_count = %u\n",
(unsigned long long)seq, (unsigned int)snap_count);
-out:
+ free_buffer:
kfree(reply_buf);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 09/47] block-rbd: Rename a jump label in rbd_spec_fill_names()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (8 preceding siblings ...)
2016-09-12 18:49 ` [PATCH 08/47] block-rbd: Rename jump labels in rbd_dev_v2_snap_context() SF Markus Elfring
@ 2016-09-12 18:50 ` SF Markus Elfring
2016-09-12 18:51 ` [PATCH 10/47] block-rbd: One function call less in rbd_dev_image_name() after error detection SF Markus Elfring
` (38 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:50 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 17:58:18 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 45109ff..aac51a1 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5421,7 +5421,7 @@ static int rbd_spec_fill_names(struct rbd_device *rbd_dev)
snap_name = rbd_snap_name(rbd_dev, spec->snap_id);
if (IS_ERR(snap_name)) {
ret = PTR_ERR(snap_name);
- goto out_err;
+ goto free_name;
}
spec->pool_name = pool_name;
@@ -5429,8 +5429,7 @@ static int rbd_spec_fill_names(struct rbd_device *rbd_dev)
spec->snap_name = snap_name;
return 0;
-
-out_err:
+ free_name:
kfree(image_name);
kfree(pool_name);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 10/47] block-rbd: One function call less in rbd_dev_image_name() after error detection
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (9 preceding siblings ...)
2016-09-12 18:50 ` [PATCH 09/47] block-rbd: Rename a jump label in rbd_spec_fill_names() SF Markus Elfring
@ 2016-09-12 18:51 ` SF Markus Elfring
2016-09-12 18:54 ` [PATCH 11/47] block-rbd: Delete three unnecessary initialisations in rbd_dev_image_name() SF Markus Elfring
` (37 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:51 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:00:18 +0200
The kfree() function was called in one case by the rbd_dev_image_name()
function during error handling even if the passed variable "reply_buf"
contained a null pointer.
Adjust jump targets according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index aac51a1..145bbcc 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5276,14 +5276,14 @@ static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
size = sizeof (__le32) + RBD_IMAGE_NAME_LEN_MAX;
reply_buf = kmalloc(size, GFP_KERNEL);
if (!reply_buf)
- goto out;
+ goto free_id;
ret = rbd_obj_method_sync(rbd_dev, RBD_DIRECTORY,
"rbd", "dir_get_name",
image_id, image_id_size,
reply_buf, size);
if (ret < 0)
- goto out;
+ goto free_buffer;
p = reply_buf;
end = reply_buf + ret;
@@ -5292,8 +5292,9 @@ static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
image_name = NULL;
else
dout("%s: name is %s len is %zd\n", __func__, image_name, len);
-out:
+ free_buffer:
kfree(reply_buf);
+ free_id:
kfree(image_id);
return image_name;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 11/47] block-rbd: Delete three unnecessary initialisations in rbd_dev_image_name()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (10 preceding siblings ...)
2016-09-12 18:51 ` [PATCH 10/47] block-rbd: One function call less in rbd_dev_image_name() after error detection SF Markus Elfring
@ 2016-09-12 18:54 ` SF Markus Elfring
2016-09-12 18:57 ` [PATCH 12/47] block-rbd: One function call less in rbd_dev_v2_parent_info() after error detection SF Markus Elfring
` (36 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:54 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:02:16 +0200
Three local variables will be set to appropriate values a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 145bbcc..90797aa 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5256,9 +5256,9 @@ static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
void *p;
void *end;
size_t size;
- void *reply_buf = NULL;
- size_t len = 0;
- char *image_name = NULL;
+ void *reply_buf;
+ size_t len;
+ char *image_name;
int ret;
rbd_assert(!rbd_dev->spec->image_name);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 12/47] block-rbd: One function call less in rbd_dev_v2_parent_info() after error detection
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (11 preceding siblings ...)
2016-09-12 18:54 ` [PATCH 11/47] block-rbd: Delete three unnecessary initialisations in rbd_dev_image_name() SF Markus Elfring
@ 2016-09-12 18:57 ` SF Markus Elfring
2016-09-12 18:58 ` [PATCH 13/47] block-rbd: Delete an unnecessary initialisation in rbd_dev_v2_parent_info() SF Markus Elfring
` (35 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:57 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:05:00 +0200
The kfree() function was called in one case by the rbd_dev_v2_parent_info()
function during error handling even if the passed variable "reply_buf"
contained a null pointer.
Adjust jump targets according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 90797aa..946e3ca 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5105,7 +5105,7 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
reply_buf = kmalloc(size, GFP_KERNEL);
if (!reply_buf) {
ret = -ENOMEM;
- goto out_err;
+ goto put_spec;
}
snapid = cpu_to_le64(rbd_dev->spec->snap_id);
@@ -5115,12 +5115,12 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
reply_buf, size);
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
- goto out_err;
+ goto free_buffer;
p = reply_buf;
end = reply_buf + ret;
ret = -ERANGE;
- ceph_decode_64_safe(&p, end, pool_id, out_err);
+ ceph_decode_64_safe(&p, end, pool_id, free_buffer);
if (pool_id == CEPH_NOPOOL) {
/*
* Either the parent never existed, or we have
@@ -5138,7 +5138,7 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
rbd_dev->disk->disk_name);
}
- goto out; /* No parent? No problem. */
+ goto success_indication; /* No parent? No problem. */
}
/* The ceph file layout needs to fit pool id in 32 bits */
@@ -5147,16 +5147,16 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
if (pool_id > (u64)U32_MAX) {
rbd_warn(NULL, "parent pool id too large (%llu > %u)",
(unsigned long long)pool_id, U32_MAX);
- goto out_err;
+ goto free_buffer;
}
image_id = ceph_extract_encoded_string(&p, end, NULL, GFP_KERNEL);
if (IS_ERR(image_id)) {
ret = PTR_ERR(image_id);
- goto out_err;
+ goto free_buffer;
}
- ceph_decode_64_safe(&p, end, snap_id, out_err);
- ceph_decode_64_safe(&p, end, overlap, out_err);
+ ceph_decode_64_safe(&p, end, snap_id, free_buffer);
+ ceph_decode_64_safe(&p, end, overlap, free_buffer);
/*
* The parent won't change (except when the clone is
@@ -5189,11 +5189,11 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
}
}
rbd_dev->parent_overlap = overlap;
-
-out:
+ success_indication:
ret = 0;
-out_err:
+ free_buffer:
kfree(reply_buf);
+ put_spec:
rbd_spec_put(parent_spec);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 13/47] block-rbd: Delete an unnecessary initialisation in rbd_dev_v2_parent_info()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (12 preceding siblings ...)
2016-09-12 18:57 ` [PATCH 12/47] block-rbd: One function call less in rbd_dev_v2_parent_info() after error detection SF Markus Elfring
@ 2016-09-12 18:58 ` SF Markus Elfring
2016-09-12 18:59 ` [PATCH 14/47] block-rbd: Rename a jump label in rbd_dev_v2_object_prefix() SF Markus Elfring
` (34 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:58 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:08:14 +0200
The local variable "reply_buf" will be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 946e3ca..aff8c4e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5084,7 +5084,7 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
{
struct rbd_spec *parent_spec;
size_t size;
- void *reply_buf = NULL;
+ void *reply_buf;
__le64 snapid;
void *p;
void *end;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 14/47] block-rbd: Rename a jump label in rbd_dev_v2_object_prefix()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (13 preceding siblings ...)
2016-09-12 18:58 ` [PATCH 13/47] block-rbd: Delete an unnecessary initialisation in rbd_dev_v2_parent_info() SF Markus Elfring
@ 2016-09-12 18:59 ` SF Markus Elfring
2016-09-12 19:00 ` [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create() SF Markus Elfring
` (33 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 18:59 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:10:02 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index aff8c4e..6acddc53 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5017,7 +5017,7 @@ static int rbd_dev_v2_object_prefix(struct rbd_device *rbd_dev)
reply_buf, RBD_OBJ_PREFIX_LEN_MAX);
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
- goto out;
+ goto free_buffer;
p = reply_buf;
rbd_dev->header.object_prefix = ceph_extract_encoded_string(&p,
@@ -5030,7 +5030,7 @@ static int rbd_dev_v2_object_prefix(struct rbd_device *rbd_dev)
} else {
dout(" object_prefix = %s\n", rbd_dev->header.object_prefix);
}
-out:
+ free_buffer:
kfree(reply_buf);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (14 preceding siblings ...)
2016-09-12 18:59 ` [PATCH 14/47] block-rbd: Rename a jump label in rbd_dev_v2_object_prefix() SF Markus Elfring
@ 2016-09-12 19:00 ` SF Markus Elfring
2016-09-13 8:07 ` Ilya Dryomov
2016-09-12 19:01 ` [PATCH 16/47] block-rbd: Rename jump labels in rbd_dev_v1_header_info() SF Markus Elfring
` (32 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:00 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:12:39 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 6acddc53..262805a 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4930,23 +4930,22 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,
minor_to_rbd_dev_id(1 << MINORBITS),
GFP_KERNEL);
if (rbd_dev->dev_id < 0)
- goto fail_rbd_dev;
+ goto free_device;
sprintf(rbd_dev->name, RBD_DRV_NAME "%d", rbd_dev->dev_id);
rbd_dev->task_wq = alloc_ordered_workqueue("%s-tasks", WQ_MEM_RECLAIM,
rbd_dev->name);
if (!rbd_dev->task_wq)
- goto fail_dev_id;
+ goto remove_id;
/* we have a ref from do_rbd_add() */
__module_get(THIS_MODULE);
dout("%s rbd_dev %p dev_id %d\n", __func__, rbd_dev, rbd_dev->dev_id);
return rbd_dev;
-
-fail_dev_id:
+ remove_id:
ida_simple_remove(&rbd_dev_id_ida, rbd_dev->dev_id);
-fail_rbd_dev:
+ free_device:
rbd_dev_free(rbd_dev);
return NULL;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 16/47] block-rbd: Rename jump labels in rbd_dev_v1_header_info()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (15 preceding siblings ...)
2016-09-12 19:00 ` [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create() SF Markus Elfring
@ 2016-09-12 19:01 ` SF Markus Elfring
2016-09-12 19:03 ` [PATCH 17/47] block-rbd: Rename jump labels in rbd_init_disk() SF Markus Elfring
` (31 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:01 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:15:44 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 262805a..0b6f0f9 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4352,17 +4352,17 @@ static int rbd_dev_v1_header_info(struct rbd_device *rbd_dev)
ret = rbd_obj_read_sync(rbd_dev, rbd_dev->header_oid.name,
0, size, ondisk);
if (ret < 0)
- goto out;
+ goto free_header;
if ((size_t)ret < size) {
ret = -ENXIO;
rbd_warn(rbd_dev, "short header read (want %zd got %d)",
size, ret);
- goto out;
+ goto free_header;
}
if (!rbd_dev_ondisk_valid(ondisk)) {
ret = -ENXIO;
rbd_warn(rbd_dev, "invalid header");
- goto out;
+ goto free_header;
}
names_size = le64_to_cpu(ondisk->snap_names_len);
@@ -4371,7 +4371,7 @@ static int rbd_dev_v1_header_info(struct rbd_device *rbd_dev)
} while (snap_count != want_count);
ret = rbd_header_from_disk(rbd_dev, ondisk);
-out:
+ free_header:
kfree(ondisk);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 17/47] block-rbd: Rename jump labels in rbd_init_disk()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (16 preceding siblings ...)
2016-09-12 19:01 ` [PATCH 16/47] block-rbd: Rename jump labels in rbd_dev_v1_header_info() SF Markus Elfring
@ 2016-09-12 19:03 ` SF Markus Elfring
2016-09-12 19:04 ` [PATCH 18/47] block-rbd: Fix jump targets in rbd_queue_workfn() SF Markus Elfring
` (30 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:03 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 18:26:28 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 0b6f0f9..97d4d63 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4500,12 +4500,12 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
err = blk_mq_alloc_tag_set(&rbd_dev->tag_set);
if (err)
- goto out_disk;
+ goto put_disk;
q = blk_mq_init_queue(&rbd_dev->tag_set);
if (IS_ERR(q)) {
err = PTR_ERR(q);
- goto out_tag_set;
+ goto free_tag_set;
}
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
@@ -4537,9 +4537,9 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
rbd_dev->disk = disk;
return 0;
-out_tag_set:
+ free_tag_set:
blk_mq_free_tag_set(&rbd_dev->tag_set);
-out_disk:
+ put_disk:
put_disk(disk);
return err;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 18/47] block-rbd: Fix jump targets in rbd_queue_workfn()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (17 preceding siblings ...)
2016-09-12 19:03 ` [PATCH 17/47] block-rbd: Rename jump labels in rbd_init_disk() SF Markus Elfring
@ 2016-09-12 19:04 ` SF Markus Elfring
2016-09-12 19:05 ` [PATCH 19/47] block-rbd: Rename a jump label in rbd_reregister_watch() SF Markus Elfring
` (29 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:04 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
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
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 19/47] block-rbd: Rename a jump label in rbd_reregister_watch()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (18 preceding siblings ...)
2016-09-12 19:04 ` [PATCH 18/47] block-rbd: Fix jump targets in rbd_queue_workfn() SF Markus Elfring
@ 2016-09-12 19:05 ` SF Markus Elfring
2016-09-12 19:06 ` [PATCH 20/47] block-rbd: Rename a jump label in rbd_register_watch() SF Markus Elfring
` (28 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:05 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:31:04 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 2b5f76e..97dbc1a 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3950,7 +3950,7 @@ static void rbd_reregister_watch(struct work_struct *work)
mutex_lock(&rbd_dev->watch_mutex);
if (rbd_dev->watch_state != RBD_WATCH_STATE_ERROR)
- goto fail_unlock;
+ goto unlock;
ret = __rbd_register_watch(rbd_dev);
if (ret) {
@@ -3959,7 +3959,7 @@ static void rbd_reregister_watch(struct work_struct *work)
queue_delayed_work(rbd_dev->task_wq,
&rbd_dev->watch_dwork,
RBD_RETRY_DELAY);
- goto fail_unlock;
+ goto unlock;
}
rbd_dev->watch_state = RBD_WATCH_STATE_REGISTERED;
@@ -3980,8 +3980,7 @@ static void rbd_reregister_watch(struct work_struct *work)
up_write(&rbd_dev->lock_rwsem);
wake_requests(rbd_dev, true);
return;
-
-fail_unlock:
+ unlock:
mutex_unlock(&rbd_dev->watch_mutex);
up_write(&rbd_dev->lock_rwsem);
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 20/47] block-rbd: Rename a jump label in rbd_register_watch()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (19 preceding siblings ...)
2016-09-12 19:05 ` [PATCH 19/47] block-rbd: Rename a jump label in rbd_reregister_watch() SF Markus Elfring
@ 2016-09-12 19:06 ` SF Markus Elfring
2016-09-12 19:07 ` [PATCH 21/47] block-rbd: Rename jump labels in rbd_try_lock() SF Markus Elfring
` (27 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:06 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:33:00 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 97dbc1a..b0b5a3b 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3900,12 +3900,11 @@ static int rbd_register_watch(struct rbd_device *rbd_dev)
rbd_assert(rbd_dev->watch_state == RBD_WATCH_STATE_UNREGISTERED);
ret = __rbd_register_watch(rbd_dev);
if (ret)
- goto out;
+ goto unlock;
rbd_dev->watch_state = RBD_WATCH_STATE_REGISTERED;
rbd_dev->watch_cookie = rbd_dev->watch_handle->linger_id;
-
-out:
+ unlock:
mutex_unlock(&rbd_dev->watch_mutex);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 21/47] block-rbd: Rename jump labels in rbd_try_lock()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (20 preceding siblings ...)
2016-09-12 19:06 ` [PATCH 20/47] block-rbd: Rename a jump label in rbd_register_watch() SF Markus Elfring
@ 2016-09-12 19:07 ` SF Markus Elfring
2016-09-12 19:08 ` [PATCH 22/47] block-rbd: Rename a jump label in find_watcher() SF Markus Elfring
` (26 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:07 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:35:08 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b0b5a3b..7802351 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3478,7 +3478,7 @@ static int rbd_try_lock(struct rbd_device *rbd_dev)
if (ret) {
if (ret > 0)
ret = 0; /* have to request lock */
- goto out;
+ goto free_lockers;
}
rbd_warn(rbd_dev, "%s%llu seems dead, breaking lock",
@@ -3489,7 +3489,7 @@ static int rbd_try_lock(struct rbd_device *rbd_dev)
if (ret) {
rbd_warn(rbd_dev, "blacklist of %s%llu failed: %d",
ENTITY_NAME(lockers[0].id.name), ret);
- goto out;
+ goto free_lockers;
}
ret = ceph_cls_break_lock(&client->osdc, &rbd_dev->header_oid,
@@ -3497,13 +3497,11 @@ static int rbd_try_lock(struct rbd_device *rbd_dev)
lockers[0].id.cookie,
&lockers[0].id.name);
if (ret && ret != -ENOENT)
- goto out;
-
-again:
+ goto free_lockers;
+ again:
ceph_free_lockers(lockers, num_lockers);
}
-
-out:
+ free_lockers:
ceph_free_lockers(lockers, num_lockers);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 22/47] block-rbd: Rename a jump label in find_watcher()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (21 preceding siblings ...)
2016-09-12 19:07 ` [PATCH 21/47] block-rbd: Rename jump labels in rbd_try_lock() SF Markus Elfring
@ 2016-09-12 19:08 ` SF Markus Elfring
2016-09-12 19:09 ` [PATCH 23/47] block-rbd: Rename jump labels in get_lock_owner_info() SF Markus Elfring
` (25 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:08 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:36:23 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7802351..ba8fb74 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3440,13 +3440,13 @@ static int find_watcher(struct rbd_device *rbd_dev,
rbd_dev, cid.gid, cid.handle);
rbd_set_owner_cid(rbd_dev, &cid);
ret = 1;
- goto out;
+ goto free_watchers;
}
}
dout("%s rbd_dev %p no watchers\n", __func__, rbd_dev);
ret = 0;
-out:
+free_watchers:
kfree(watchers);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 23/47] block-rbd: Rename jump labels in get_lock_owner_info()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (22 preceding siblings ...)
2016-09-12 19:08 ` [PATCH 22/47] block-rbd: Rename a jump label in find_watcher() SF Markus Elfring
@ 2016-09-12 19:09 ` SF Markus Elfring
2016-09-12 19:10 ` [PATCH 24/47] block-rbd: Rename jump labels in rbd_request_lock() SF Markus Elfring
` (24 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:09 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:37:52 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index ba8fb74..e175d21 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3381,20 +3381,20 @@ static int get_lock_owner_info(struct rbd_device *rbd_dev,
if (*num_lockers == 0) {
dout("%s rbd_dev %p no lockers detected\n", __func__, rbd_dev);
- goto out;
+ goto free_tag;
}
if (strcmp(lock_tag, RBD_LOCK_TAG)) {
rbd_warn(rbd_dev, "locked by external mechanism, tag %s",
lock_tag);
ret = -EBUSY;
- goto out;
+ goto free_tag;
}
if (lock_type == CEPH_CLS_LOCK_SHARED) {
rbd_warn(rbd_dev, "shared lock type detected");
ret = -EBUSY;
- goto out;
+ goto free_tag;
}
if (strncmp((*lockers)[0].id.cookie, RBD_LOCK_COOKIE_PREFIX,
@@ -3402,10 +3402,8 @@ static int get_lock_owner_info(struct rbd_device *rbd_dev,
rbd_warn(rbd_dev, "locked by external mechanism, cookie %s",
(*lockers)[0].id.cookie);
ret = -EBUSY;
- goto out;
}
-
-out:
+ free_tag:
kfree(lock_tag);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 24/47] block-rbd: Rename jump labels in rbd_request_lock()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (23 preceding siblings ...)
2016-09-12 19:09 ` [PATCH 23/47] block-rbd: Rename jump labels in get_lock_owner_info() SF Markus Elfring
@ 2016-09-12 19:10 ` SF Markus Elfring
2016-09-12 19:11 ` [PATCH 25/47] block-rbd: Fix jump targets in rbd_img_parent_read() SF Markus Elfring
` (23 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:10 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:38:52 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e175d21..09a0ed3 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3297,7 +3297,7 @@ static int rbd_request_lock(struct rbd_device *rbd_dev)
&reply_pages, &reply_len);
if (ret && ret != -ETIMEDOUT) {
rbd_warn(rbd_dev, "failed to request lock: %d", ret);
- goto out;
+ goto release_page_vector;
}
if (reply_len > 0 && reply_len <= PAGE_SIZE) {
@@ -3321,7 +3321,7 @@ static int rbd_request_lock(struct rbd_device *rbd_dev)
rbd_warn(rbd_dev,
"duplicate lock owners detected");
ret = -EIO;
- goto out;
+ goto release_page_vector;
}
lock_owner_responded = true;
@@ -3342,14 +3342,12 @@ static int rbd_request_lock(struct rbd_device *rbd_dev)
rbd_warn(rbd_dev, "no lock owners detected");
ret = -ETIMEDOUT;
}
-
-out:
+ release_page_vector:
ceph_release_page_vector(reply_pages, calc_pages_for(0, reply_len));
return ret;
-
-e_inval:
+ e_inval:
ret = -EINVAL;
- goto out;
+ goto release_page_vector;
}
static void wake_requests(struct rbd_device *rbd_dev, bool wake_all)
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 25/47] block-rbd: Fix jump targets in rbd_img_parent_read()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (24 preceding siblings ...)
2016-09-12 19:10 ` [PATCH 24/47] block-rbd: Rename jump labels in rbd_request_lock() SF Markus Elfring
@ 2016-09-12 19:11 ` SF Markus Elfring
2016-09-12 19:12 ` [PATCH 26/47] block-rbd: Rename a jump label in rbd_img_parent_read_callback() SF Markus Elfring
` (22 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:11 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:39:54 +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 | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 09a0ed3..6777464 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3120,7 +3120,7 @@ static void rbd_img_parent_read(struct rbd_obj_request *obj_request)
obj_request->length);
result = -ENOMEM;
if (!img_request)
- goto out_err;
+ goto status_indication;
if (obj_request->type == OBJ_REQUEST_BIO)
result = rbd_img_request_fill(img_request, OBJ_REQUEST_BIO,
@@ -3129,17 +3129,17 @@ static void rbd_img_parent_read(struct rbd_obj_request *obj_request)
result = rbd_img_request_fill(img_request, OBJ_REQUEST_PAGES,
obj_request->pages);
if (result)
- goto out_err;
+ goto put_request;
img_request->callback = rbd_img_parent_read_callback;
result = rbd_img_request_submit(img_request);
if (result)
- goto out_err;
+ goto put_request;
return;
-out_err:
- if (img_request)
- rbd_img_request_put(img_request);
+ put_request:
+ rbd_img_request_put(img_request);
+ status_indication:
obj_request->result = result;
obj_request->xferred = 0;
obj_request_done_set(obj_request);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 26/47] block-rbd: Rename a jump label in rbd_img_parent_read_callback()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (25 preceding siblings ...)
2016-09-12 19:11 ` [PATCH 25/47] block-rbd: Fix jump targets in rbd_img_parent_read() SF Markus Elfring
@ 2016-09-12 19:12 ` SF Markus Elfring
2016-09-12 19:13 ` [PATCH 27/47] block-rbd: Rename a jump label in rbd_img_request_submit() SF Markus Elfring
` (21 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:12 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:40:45 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 6777464..23812e4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3077,7 +3077,7 @@ static void rbd_img_parent_read_callback(struct rbd_img_request *img_request)
obj_request->result = img_result;
if (obj_request->result)
- goto out;
+ goto callback;
/*
* We need to zero anything beyond the parent overlap
@@ -3099,7 +3099,7 @@ static void rbd_img_parent_read_callback(struct rbd_img_request *img_request)
} else {
obj_request->xferred = img_xferred;
}
-out:
+ callback:
rbd_img_obj_request_read_callback(obj_request);
rbd_obj_request_complete(obj_request);
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 27/47] block-rbd: Rename a jump label in rbd_img_request_submit()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (26 preceding siblings ...)
2016-09-12 19:12 ` [PATCH 26/47] block-rbd: Rename a jump label in rbd_img_parent_read_callback() SF Markus Elfring
@ 2016-09-12 19:13 ` SF Markus Elfring
2016-09-12 19:14 ` [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit() SF Markus Elfring
` (20 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:13 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:43:35 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 23812e4..17bdc21 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3033,10 +3033,9 @@ static int rbd_img_request_submit(struct rbd_img_request *img_request)
for_each_obj_request_safe(img_request, obj_request, next_obj_request) {
ret = rbd_img_obj_request_submit(obj_request);
if (ret)
- goto out_put_ireq;
+ goto put_request;
}
-
-out_put_ireq:
+ put_request:
rbd_img_request_put(img_request);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (27 preceding siblings ...)
2016-09-12 19:13 ` [PATCH 27/47] block-rbd: Rename a jump label in rbd_img_request_submit() SF Markus Elfring
@ 2016-09-12 19:14 ` SF Markus Elfring
2016-09-13 8:10 ` Ilya Dryomov
2016-09-12 19:15 ` [PATCH 29/47] block-rbd: Delete an unnecessary initialisation " SF Markus Elfring
` (19 subsequent siblings)
48 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:14 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:44:30 +0200
Adjust a jump target so that a duplicate check can then be avoided
at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 17bdc21..66801ec 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2920,7 +2920,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
stat_request = rbd_obj_request_create(obj_request->object_name, 0, 0,
OBJ_REQUEST_PAGES);
if (!stat_request)
- goto out;
+ goto put_request;
rbd_obj_request_get(obj_request);
stat_request->obj_request = obj_request;
@@ -2932,7 +2932,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
stat_request->osd_req = rbd_osd_req_create(rbd_dev, OBJ_OP_READ, 1,
stat_request);
if (!stat_request->osd_req)
- goto out;
+ goto put_request;
stat_request->callback = rbd_img_obj_exists_callback;
osd_req_op_init(stat_request->osd_req, 0, CEPH_OSD_OP_STAT, 0);
@@ -2942,8 +2942,8 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
osdc = &rbd_dev->rbd_client->client->osdc;
ret = rbd_obj_request_submit(osdc, stat_request);
-out:
if (ret)
+ put_request:
rbd_obj_request_put(obj_request);
return ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 29/47] block-rbd: Delete an unnecessary initialisation in rbd_img_obj_exists_submit()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (28 preceding siblings ...)
2016-09-12 19:14 ` [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit() SF Markus Elfring
@ 2016-09-12 19:15 ` SF Markus Elfring
2016-09-12 19:16 ` [PATCH 30/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_callback() SF Markus Elfring
` (18 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:15 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:45:29 +0200
The local variable "pages" will be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 66801ec..f3f2919 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2897,7 +2897,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
struct rbd_obj_request *stat_request;
struct rbd_device *rbd_dev;
struct ceph_osd_client *osdc;
- struct page **pages = NULL;
+ struct page **pages;
u32 page_count;
size_t size;
int ret;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 30/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_callback()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (29 preceding siblings ...)
2016-09-12 19:15 ` [PATCH 29/47] block-rbd: Delete an unnecessary initialisation " SF Markus Elfring
@ 2016-09-12 19:16 ` SF Markus Elfring
2016-09-12 19:18 ` [PATCH 31/47] block-rbd: Fix three jump targets in rbd_img_obj_parent_read_full() SF Markus Elfring
` (17 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:16 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:46:43 +0200
Adjust a jump target so that a duplicate check can then be avoided
at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f3f2919..7d5f7b9 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2879,7 +2879,7 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request)
obj_request_existence_set(orig_request, false);
} else if (result) {
orig_request->result = result;
- goto out;
+ goto complete_request;
}
/*
@@ -2887,8 +2887,8 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request)
* whether the target object exists.
*/
orig_request->result = rbd_img_obj_request_submit(orig_request);
-out:
if (orig_request->result)
+ complete_request:
rbd_obj_request_complete(orig_request);
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 31/47] block-rbd: Fix three jump targets in rbd_img_obj_parent_read_full()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (30 preceding siblings ...)
2016-09-12 19:16 ` [PATCH 30/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_callback() SF Markus Elfring
@ 2016-09-12 19:18 ` SF Markus Elfring
2016-09-12 19:20 ` [PATCH 32/47] block-rbd: Rename a jump label in rbd_img_obj_parent_read_full_callback() SF Markus Elfring
` (16 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:18 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:48:46 +0200
* Adjust jump targets according to the current Linux coding
style convention.
* Delete two duplicate checks then at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
I find that this function implementation needs another close look.
It seems that four lines can not be executed according to the shown
control flow at the moment.
How do you think about to avoid "dead" source code there anyhow?
drivers/block/rbd.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7d5f7b9..1b8a8c5 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2789,18 +2789,18 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request)
if (IS_ERR(pages)) {
result = PTR_ERR(pages);
pages = NULL;
- goto out_err;
+ goto status_indication;
}
result = -ENOMEM;
parent_request = rbd_parent_request_create(obj_request,
img_offset, length);
if (!parent_request)
- goto out_err;
+ goto release_page_vector;
result = rbd_img_request_fill(parent_request, OBJ_REQUEST_PAGES, pages);
if (result)
- goto out_err;
+ goto put_request;
parent_request->copyup_pages = pages;
parent_request->copyup_page_count = page_count;
@@ -2813,11 +2813,11 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request)
parent_request->copyup_page_count = 0;
parent_request->obj_request = NULL;
rbd_obj_request_put(obj_request);
-out_err:
- if (pages)
- ceph_release_page_vector(pages, page_count);
- if (parent_request)
- rbd_img_request_put(parent_request);
+ put_request:
+ rbd_img_request_put(parent_request);
+ release_page_vector:
+ ceph_release_page_vector(pages, page_count);
+ status_indication:
obj_request->result = result;
obj_request->xferred = 0;
obj_request_done_set(obj_request);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 32/47] block-rbd: Rename a jump label in rbd_img_obj_parent_read_full_callback()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (31 preceding siblings ...)
2016-09-12 19:18 ` [PATCH 31/47] block-rbd: Fix three jump targets in rbd_img_obj_parent_read_full() SF Markus Elfring
@ 2016-09-12 19:20 ` SF Markus Elfring
2016-09-12 19:22 ` [PATCH 33/47] block-rbd: Adjust the position of a jump label in rbd_img_request_fill() SF Markus Elfring
` (15 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:20 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:49:33 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 1b8a8c5..7a43711 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2687,7 +2687,7 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
}
if (img_result)
- goto out_err;
+ goto status_indication;
/*
* The original osd request is of no use to use any more.
@@ -2698,7 +2698,7 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
img_result = -ENOMEM;
osd_req = rbd_osd_req_create_copyup(orig_request);
if (!osd_req)
- goto out_err;
+ goto status_indication;
rbd_osd_req_destroy(orig_request->osd_req);
orig_request->osd_req = osd_req;
orig_request->copyup_pages = pages;
@@ -2721,7 +2721,7 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
img_result = rbd_obj_request_submit(osdc, orig_request);
if (!img_result)
return;
-out_err:
+ status_indication:
/* Record the error code and complete the request */
orig_request->result = img_result;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 33/47] block-rbd: Adjust the position of a jump label in rbd_img_request_fill()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (32 preceding siblings ...)
2016-09-12 19:20 ` [PATCH 32/47] block-rbd: Rename a jump label in rbd_img_obj_parent_read_full_callback() SF Markus Elfring
@ 2016-09-12 19:22 ` SF Markus Elfring
2016-09-12 19:23 ` [PATCH 34/47] block-rbd: Rename a jump label in rbd_img_obj_callback() SF Markus Elfring
` (14 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:22 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From a0cfdf15bae448d9a0e2d5d6480c70cfa3f77322 Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:50:43 +0200
Subject: [PATCH 33/47] block-rbd: Adjust the position of a jump label in
rbd_img_request_fill()
Add a space character before a single jump label in this function
according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7a43711..34ccbf1 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2588,8 +2588,7 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
}
return 0;
-
-out_unwind:
+ out_unwind:
for_each_obj_request_safe(img_request, obj_request, next_obj_request)
rbd_img_obj_request_del(img_request, obj_request);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 34/47] block-rbd: Rename a jump label in rbd_img_obj_callback()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (33 preceding siblings ...)
2016-09-12 19:22 ` [PATCH 33/47] block-rbd: Adjust the position of a jump label in rbd_img_request_fill() SF Markus Elfring
@ 2016-09-12 19:23 ` SF Markus Elfring
2016-09-12 19:24 ` [PATCH 35/47] block-rbd: Rename jump labels in rbd_osd_req_create_copyup() SF Markus Elfring
` (13 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:23 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:51:29 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 34ccbf1..c349975 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2394,7 +2394,7 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
spin_lock_irq(&img_request->completion_lock);
if (which != img_request->next_completion)
- goto out;
+ goto unlock;
for_each_obj_request_from(img_request, obj_request) {
rbd_assert(more);
@@ -2408,7 +2408,7 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
rbd_assert(more ^ (which == img_request->obj_request_count));
img_request->next_completion = which;
-out:
+ unlock:
spin_unlock_irq(&img_request->completion_lock);
rbd_img_request_put(img_request);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 35/47] block-rbd: Rename jump labels in rbd_osd_req_create_copyup()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (34 preceding siblings ...)
2016-09-12 19:23 ` [PATCH 34/47] block-rbd: Rename a jump label in rbd_img_obj_callback() SF Markus Elfring
@ 2016-09-12 19:24 ` SF Markus Elfring
2016-09-12 19:25 ` [PATCH 36/47] block-rbd: Rename jump labels in rbd_osd_req_create() SF Markus Elfring
` (12 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:24 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:53:26 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index c349975..f779ff3 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2046,7 +2046,7 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request)
osd_req = ceph_osdc_alloc_request(osdc, snapc, num_osd_ops,
false, GFP_NOIO);
if (!osd_req)
- goto fail;
+ goto put_request;
osd_req->r_flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK;
osd_req->r_callback = rbd_osd_req_callback;
@@ -2055,14 +2055,13 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request)
osd_req->r_base_oloc.pool = rbd_dev->layout.pool_id;
if (ceph_oid_aprintf(&osd_req->r_base_oid, GFP_NOIO, "%s",
obj_request->object_name))
- goto fail;
+ goto put_request;
if (ceph_osdc_alloc_messages(osd_req, GFP_NOIO))
- goto fail;
+ goto put_request;
return osd_req;
-
-fail:
+ put_request:
ceph_osdc_put_request(osd_req);
return NULL;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 36/47] block-rbd: Rename jump labels in rbd_osd_req_create()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (35 preceding siblings ...)
2016-09-12 19:24 ` [PATCH 35/47] block-rbd: Rename jump labels in rbd_osd_req_create_copyup() SF Markus Elfring
@ 2016-09-12 19:25 ` SF Markus Elfring
2016-09-12 19:26 ` [PATCH 37/47] block-rbd: Rename a jump label in bio_chain_clone_range() SF Markus Elfring
` (11 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:25 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:54:39 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f779ff3..8e9d30f7 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1988,7 +1988,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
osd_req = ceph_osdc_alloc_request(osdc, snapc, num_ops, false,
GFP_NOIO);
if (!osd_req)
- goto fail;
+ goto put_request;
if (op_type == OBJ_OP_WRITE || op_type == OBJ_OP_DISCARD)
osd_req->r_flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK;
@@ -2001,14 +2001,13 @@ static struct ceph_osd_request *rbd_osd_req_create(
osd_req->r_base_oloc.pool = rbd_dev->layout.pool_id;
if (ceph_oid_aprintf(&osd_req->r_base_oid, GFP_NOIO, "%s",
obj_request->object_name))
- goto fail;
+ goto put_request;
if (ceph_osdc_alloc_messages(osd_req, GFP_NOIO))
- goto fail;
+ goto put_request;
return osd_req;
-
-fail:
+ put_request:
ceph_osdc_put_request(osd_req);
return NULL;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 37/47] block-rbd: Rename a jump label in bio_chain_clone_range()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (36 preceding siblings ...)
2016-09-12 19:25 ` [PATCH 36/47] block-rbd: Rename jump labels in rbd_osd_req_create() SF Markus Elfring
@ 2016-09-12 19:26 ` SF Markus Elfring
2016-09-12 19:27 ` [PATCH 38/47] block-rbd: Rename jump labels in rbd_client_create() SF Markus Elfring
` (10 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:26 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:56:37 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8e9d30f7..abc2dcb 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1421,12 +1421,12 @@ static struct bio *bio_chain_clone_range(struct bio **bio_src,
if (!bi) {
rbd_warn(NULL, "bio_chain exhausted with %u left", len);
- goto out_err; /* EINVAL; ran out of bio's */
+ goto put_chain; /* EINVAL; ran out of bio's */
}
bi_size = min_t(unsigned int, bi->bi_iter.bi_size - off, len);
bio = bio_clone_range(bi, off, bi_size, gfpmask);
if (!bio)
- goto out_err; /* ENOMEM */
+ goto put_chain; /* ENOMEM */
*end = bio;
end = &bio->bi_next;
@@ -1442,7 +1442,7 @@ static struct bio *bio_chain_clone_range(struct bio **bio_src,
*offset = off;
return chain;
-out_err:
+ put_chain:
bio_chain_put(chain);
return NULL;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 38/47] block-rbd: Rename jump labels in rbd_client_create()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (37 preceding siblings ...)
2016-09-12 19:26 ` [PATCH 37/47] block-rbd: Rename a jump label in bio_chain_clone_range() SF Markus Elfring
@ 2016-09-12 19:27 ` SF Markus Elfring
2016-09-12 19:28 ` [PATCH 39/47] block-rbd: Rename a jump label in rbd_ioctl_set_ro() SF Markus Elfring
` (9 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:27 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:57:19 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index abc2dcb..9902a7f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -718,19 +718,19 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts)
dout("%s:\n", __func__);
rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL);
if (!rbdc)
- goto out_opt;
+ goto check_input;
kref_init(&rbdc->kref);
INIT_LIST_HEAD(&rbdc->node);
rbdc->client = ceph_create_client(ceph_opts, rbdc, 0, 0);
if (IS_ERR(rbdc->client))
- goto out_rbdc;
+ goto free_rbdc;
ceph_opts = NULL; /* Now rbdc->client is responsible for ceph_opts */
ret = ceph_open_session(rbdc->client);
if (ret < 0)
- goto out_client;
+ goto destroy_client;
spin_lock(&rbd_client_list_lock);
list_add_tail(&rbdc->node, &rbd_client_list);
@@ -739,11 +739,11 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts)
dout("%s: rbdc %p\n", __func__, rbdc);
return rbdc;
-out_client:
+ destroy_client:
ceph_destroy_client(rbdc->client);
-out_rbdc:
+ free_rbdc:
kfree(rbdc);
-out_opt:
+ check_input:
if (ceph_opts)
ceph_destroy_options(ceph_opts);
dout("%s: error %d\n", __func__, ret);
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 39/47] block-rbd: Rename a jump label in rbd_ioctl_set_ro()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (38 preceding siblings ...)
2016-09-12 19:27 ` [PATCH 38/47] block-rbd: Rename jump labels in rbd_client_create() SF Markus Elfring
@ 2016-09-12 19:28 ` SF Markus Elfring
2016-09-12 19:29 ` [PATCH 40/47] block-rbd: One function call less in rbd_dev_probe_parent() after error detection SF Markus Elfring
` (8 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:28 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 19:58:22 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 9902a7f..e01df3c 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -654,15 +654,14 @@ static int rbd_ioctl_set_ro(struct rbd_device *rbd_dev, unsigned long arg)
/* prevent others open this device */
if (rbd_dev->open_count > 1) {
ret = -EBUSY;
- goto out;
+ goto unlock;
}
if (rbd_dev->mapping.read_only != ro) {
rbd_dev->mapping.read_only = ro;
ro_changed = true;
}
-
-out:
+ unlock:
spin_unlock_irq(&rbd_dev->lock);
/* set_disk_ro() may sleep, so call it after releasing rbd_dev->lock */
if (ret == 0 && ro_changed)
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 40/47] block-rbd: One function call less in rbd_dev_probe_parent() after error detection
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (39 preceding siblings ...)
2016-09-12 19:28 ` [PATCH 39/47] block-rbd: Rename a jump label in rbd_ioctl_set_ro() SF Markus Elfring
@ 2016-09-12 19:29 ` SF Markus Elfring
2016-09-12 19:30 ` [PATCH 41/47] block-rbd: Rename jump labels in rbd_dev_device_setup() SF Markus Elfring
` (7 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:29 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:00:08 +0200
The rbd_dev_destroy() function was called in two cases by the
rbd_dev_probe_parent() function during error handling even if
the passed variable contained a null pointer.
* Adjust jump targets according to the current Linux coding
style convention.
* Delete an initialisation for the variable "parent" at the beginning
which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e01df3c..a037a5d 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5950,7 +5950,7 @@ out_err:
*/
static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
{
- struct rbd_device *parent = NULL;
+ struct rbd_device *parent;
int ret;
if (!rbd_dev->parent_spec)
@@ -5959,13 +5959,13 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
if (++depth > RBD_MAX_PARENT_CHAIN_LEN) {
pr_info("parent chain is too long (%d)\n", depth);
ret = -EINVAL;
- goto out_err;
+ goto unparent_device;
}
parent = __rbd_dev_create(rbd_dev->rbd_client, rbd_dev->parent_spec);
if (!parent) {
ret = -ENOMEM;
- goto out_err;
+ goto unparent_device;
}
/*
@@ -5977,15 +5977,15 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
ret = rbd_dev_image_probe(parent, depth);
if (ret < 0)
- goto out_err;
+ goto destroy_device;
rbd_dev->parent = parent;
atomic_set(&rbd_dev->parent_ref, 1);
return 0;
-
-out_err:
- rbd_dev_unparent(rbd_dev);
+ destroy_device:
rbd_dev_destroy(parent);
+ unparent_device:
+ rbd_dev_unparent(rbd_dev);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 41/47] block-rbd: Rename jump labels in rbd_dev_device_setup()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (40 preceding siblings ...)
2016-09-12 19:29 ` [PATCH 40/47] block-rbd: One function call less in rbd_dev_probe_parent() after error detection SF Markus Elfring
@ 2016-09-12 19:30 ` SF Markus Elfring
2016-09-12 19:31 ` [PATCH 42/47] block-rbd: Rename jump labels in rbd_dev_image_probe() SF Markus Elfring
` (6 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:30 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:01:03 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a037a5d..80983f6 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6002,7 +6002,7 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
if (!single_major) {
ret = register_blkdev(0, rbd_dev->name);
if (ret < 0)
- goto err_out_unlock;
+ goto unlock;
rbd_dev->major = ret;
rbd_dev->minor = 0;
@@ -6015,11 +6015,11 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
ret = rbd_init_disk(rbd_dev);
if (ret)
- goto err_out_blkdev;
+ goto check_single;
ret = rbd_dev_mapping_set(rbd_dev);
if (ret)
- goto err_out_disk;
+ goto free_disk;
set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only);
@@ -6027,7 +6027,7 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
dev_set_name(&rbd_dev->dev, "%d", rbd_dev->dev_id);
ret = device_add(&rbd_dev->dev);
if (ret)
- goto err_out_mapping;
+ goto clear_mapping;
/* Everything's ready. Announce the disk to the world. */
@@ -6044,15 +6044,14 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
rbd_dev->header.features);
return ret;
-
-err_out_mapping:
+ clear_mapping:
rbd_dev_mapping_clear(rbd_dev);
-err_out_disk:
+ free_disk:
rbd_free_disk(rbd_dev);
-err_out_blkdev:
+ check_single:
if (!single_major)
unregister_blkdev(rbd_dev->major, rbd_dev->name);
-err_out_unlock:
+ unlock:
up_write(&rbd_dev->header_rwsem);
return ret;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 42/47] block-rbd: Rename jump labels in rbd_dev_image_probe()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (41 preceding siblings ...)
2016-09-12 19:30 ` [PATCH 41/47] block-rbd: Rename jump labels in rbd_dev_device_setup() SF Markus Elfring
@ 2016-09-12 19:31 ` SF Markus Elfring
2016-09-12 19:32 ` [PATCH 43/47] block-rbd: Rename jump labels in do_rbd_add() SF Markus Elfring
` (5 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:31 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:02:16 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 80983f6..eec41ed 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6108,7 +6108,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
ret = rbd_dev_header_name(rbd_dev);
if (ret)
- goto err_out_format;
+ goto status_indication;
if (!depth) {
ret = rbd_register_watch(rbd_dev);
@@ -6117,13 +6117,13 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
pr_info("image %s/%s does not exist\n",
rbd_dev->spec->pool_name,
rbd_dev->spec->image_name);
- goto err_out_format;
+ goto status_indication;
}
}
ret = rbd_dev_header_info(rbd_dev);
if (ret)
- goto err_out_watch;
+ goto check_input;
/*
* If this image is the one being mapped, we have pool name and
@@ -6141,13 +6141,13 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
rbd_dev->spec->pool_name,
rbd_dev->spec->image_name,
rbd_dev->spec->snap_name);
- goto err_out_probe;
+ goto unprobe_device;
}
if (rbd_dev->header.features & RBD_FEATURE_LAYERING) {
ret = rbd_dev_v2_parent_info(rbd_dev);
if (ret)
- goto err_out_probe;
+ goto unprobe_device;
/*
* Need to warn users if this image is the one being
@@ -6160,18 +6160,17 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
ret = rbd_dev_probe_parent(rbd_dev, depth);
if (ret)
- goto err_out_probe;
+ goto unprobe_device;
dout("discovered format %u image, header name is %s\n",
rbd_dev->image_format, rbd_dev->header_oid.name);
return 0;
-
-err_out_probe:
+ unprobe_device:
rbd_dev_unprobe(rbd_dev);
-err_out_watch:
+ check_input:
if (!depth)
rbd_unregister_watch(rbd_dev);
-err_out_format:
+ status_indication:
rbd_dev->image_format = 0;
kfree(rbd_dev->spec->image_id);
rbd_dev->spec->image_id = NULL;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 43/47] block-rbd: Rename jump labels in do_rbd_add()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (42 preceding siblings ...)
2016-09-12 19:31 ` [PATCH 42/47] block-rbd: Rename jump labels in rbd_dev_image_probe() SF Markus Elfring
@ 2016-09-12 19:32 ` SF Markus Elfring
2016-09-12 19:33 ` [PATCH 44/47] block-rbd: Delete an unnecessary initialisation " SF Markus Elfring
` (4 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:32 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:03:34 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index eec41ed..7df0b90 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6195,12 +6195,12 @@ static ssize_t do_rbd_add(struct bus_type *bus,
/* parse add command */
rc = rbd_add_parse_args(buf, &ceph_opts, &rbd_opts, &spec);
if (rc < 0)
- goto out;
+ goto put_module;
rbdc = rbd_get_client(ceph_opts);
if (IS_ERR(rbdc)) {
rc = PTR_ERR(rbdc);
- goto err_out_args;
+ goto put_spec;
}
/* pick the pool */
@@ -6208,14 +6208,14 @@ static ssize_t do_rbd_add(struct bus_type *bus,
if (rc < 0) {
if (rc == -ENOENT)
pr_info("pool %s does not exist\n", spec->pool_name);
- goto err_out_client;
+ goto put_client;
}
spec->pool_id = (u64)rc;
rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts);
if (!rbd_dev) {
rc = -ENOMEM;
- goto err_out_client;
+ goto put_client;
}
rbdc = NULL; /* rbd_dev now owns this */
spec = NULL; /* rbd_dev now owns this */
@@ -6224,14 +6224,14 @@ static ssize_t do_rbd_add(struct bus_type *bus,
rbd_dev->config_info = kstrdup(buf, GFP_KERNEL);
if (!rbd_dev->config_info) {
rc = -ENOMEM;
- goto err_out_rbd_dev;
+ goto destroy_device;
}
down_write(&rbd_dev->header_rwsem);
rc = rbd_dev_image_probe(rbd_dev, 0);
if (rc < 0) {
up_write(&rbd_dev->header_rwsem);
- goto err_out_rbd_dev;
+ goto destroy_device;
}
/* If we are mapping a snapshot it must be marked read-only */
@@ -6250,22 +6250,21 @@ static ssize_t do_rbd_add(struct bus_type *bus,
*/
rbd_unregister_watch(rbd_dev);
rbd_dev_image_release(rbd_dev);
- goto out;
+ goto put_module;
}
rc = count;
-out:
+ put_module:
module_put(THIS_MODULE);
return rc;
-
-err_out_rbd_dev:
+ destroy_device:
rbd_dev_destroy(rbd_dev);
-err_out_client:
+ put_client:
rbd_put_client(rbdc);
-err_out_args:
+ put_spec:
rbd_spec_put(spec);
kfree(rbd_opts);
- goto out;
+ goto put_module;
}
static ssize_t rbd_add(struct bus_type *bus,
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 44/47] block-rbd: Delete an unnecessary initialisation in do_rbd_add()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (43 preceding siblings ...)
2016-09-12 19:32 ` [PATCH 43/47] block-rbd: Rename jump labels in do_rbd_add() SF Markus Elfring
@ 2016-09-12 19:33 ` SF Markus Elfring
2016-09-12 19:34 ` [PATCH 45/47] block-rbd: Rename a jump label in rbd_slab_init() SF Markus Elfring
` (3 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:33 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:04:31 +0200
The local variable "rbd_dev" will be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7df0b90..b106c68 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6181,7 +6181,7 @@ static ssize_t do_rbd_add(struct bus_type *bus,
const char *buf,
size_t count)
{
- struct rbd_device *rbd_dev = NULL;
+ struct rbd_device *rbd_dev;
struct ceph_options *ceph_opts = NULL;
struct rbd_options *rbd_opts = NULL;
struct rbd_spec *spec = NULL;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 45/47] block-rbd: Rename a jump label in rbd_slab_init()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (44 preceding siblings ...)
2016-09-12 19:33 ` [PATCH 44/47] block-rbd: Delete an unnecessary initialisation " SF Markus Elfring
@ 2016-09-12 19:34 ` SF Markus Elfring
2016-09-12 19:35 ` [PATCH 46/47] block-rbd: Rename jump labels in rbd_init() SF Markus Elfring
` (2 subsequent siblings)
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:34 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:05:42 +0200
Adjust a jump label according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b106c68..8802a06 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6454,14 +6454,14 @@ static int rbd_slab_init(void)
rbd_assert(!rbd_obj_request_cache);
rbd_obj_request_cache = KMEM_CACHE(rbd_obj_request, 0);
if (!rbd_obj_request_cache)
- goto out_err;
+ goto destroy_cache;
rbd_assert(!rbd_segment_name_cache);
rbd_segment_name_cache = kmem_cache_create("rbd_segment_name",
CEPH_MAX_OID_NAME_LEN + 1, 1, 0, NULL);
if (rbd_segment_name_cache)
return 0;
-out_err:
+ destroy_cache:
kmem_cache_destroy(rbd_obj_request_cache);
rbd_obj_request_cache = NULL;
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 46/47] block-rbd: Rename jump labels in rbd_init()
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (45 preceding siblings ...)
2016-09-12 19:34 ` [PATCH 45/47] block-rbd: Rename a jump label in rbd_slab_init() SF Markus Elfring
@ 2016-09-12 19:35 ` SF Markus Elfring
2016-09-12 19:36 ` [PATCH 47/47] block-rbd: Delete unwanted spaces behind usages of the sizeof operator SF Markus Elfring
2017-08-13 19:10 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:35 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:06:54 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8802a06..8897815 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6506,20 +6506,20 @@ static int __init rbd_init(void)
rbd_wq = alloc_workqueue(RBD_DRV_NAME, WQ_MEM_RECLAIM, 0);
if (!rbd_wq) {
rc = -ENOMEM;
- goto err_out_slab;
+ goto exit_slab;
}
if (single_major) {
rbd_major = register_blkdev(0, RBD_DRV_NAME);
if (rbd_major < 0) {
rc = rbd_major;
- goto err_out_wq;
+ goto destroy_workqueue;
}
}
rc = rbd_sysfs_init();
if (rc)
- goto err_out_blkdev;
+ goto check_single;
if (single_major)
pr_info("loaded (major %d)\n", rbd_major);
@@ -6527,13 +6527,12 @@ static int __init rbd_init(void)
pr_info("loaded\n");
return 0;
-
-err_out_blkdev:
+ check_single:
if (single_major)
unregister_blkdev(rbd_major, RBD_DRV_NAME);
-err_out_wq:
+ destroy_workqueue:
destroy_workqueue(rbd_wq);
-err_out_slab:
+ exit_slab:
rbd_slab_exit();
return rc;
}
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* [PATCH 47/47] block-rbd: Delete unwanted spaces behind usages of the sizeof operator
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (46 preceding siblings ...)
2016-09-12 19:35 ` [PATCH 46/47] block-rbd: Rename jump labels in rbd_init() SF Markus Elfring
@ 2016-09-12 19:36 ` SF Markus Elfring
2017-08-13 19:10 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-12 19:36 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 12 Sep 2016 20:10:13 +0200
* Replace the source code "sizeof (" by "sizeof("
according to the Linux coding style convention.
* Improve indentation at some places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/block/rbd.c | 112 ++++++++++++++++++++++++++++++----------------------
1 file changed, 64 insertions(+), 48 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8897815..4ed6983 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -101,7 +101,7 @@ static int atomic_dec_return_safe(atomic_t *v)
#define RBD_SNAP_DEV_NAME_PREFIX "snap_"
#define RBD_MAX_SNAP_NAME_LEN \
- (NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1))
+ (NAME_MAX - (sizeof(RBD_SNAP_DEV_NAME_PREFIX) - 1))
#define RBD_MAX_SNAP_COUNT 510 /* allows max snapc to fit in 4KB */
@@ -110,7 +110,7 @@ static int atomic_dec_return_safe(atomic_t *v)
#define BAD_SNAP_INDEX U32_MAX /* invalid index into snap array */
/* This allows a single page to hold an image name sent by OSD */
-#define RBD_IMAGE_NAME_LEN_MAX (PAGE_SIZE - sizeof (__le32) - 1)
+#define RBD_IMAGE_NAME_LEN_MAX (PAGE_SIZE - sizeof(__le32) - 1)
#define RBD_IMAGE_ID_LEN_MAX 64
#define RBD_OBJ_PREFIX_LEN_MAX 64
@@ -931,7 +931,7 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
u32 snap_count;
/* The header has to start with the magic rbd header text */
- if (memcmp(&ondisk->text, RBD_HEADER_TEXT, sizeof (RBD_HEADER_TEXT)))
+ if (memcmp(&ondisk->text, RBD_HEADER_TEXT, sizeof(RBD_HEADER_TEXT)))
return false;
/* The bio layer requires at least sector-sized I/O */
@@ -941,7 +941,7 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
/* If we use u64 in a few spots we may be able to loosen this */
- if (ondisk->options.order > 8 * sizeof (int) - 1)
+ if (ondisk->options.order > 8 * sizeof(int) - 1)
return false;
/*
@@ -949,15 +949,15 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
* that limits the number of snapshots.
*/
snap_count = le32_to_cpu(ondisk->snap_count);
- size = SIZE_MAX - sizeof (struct ceph_snap_context);
- if (snap_count > size / sizeof (__le64))
+ size = SIZE_MAX - sizeof(struct ceph_snap_context);
+ if (snap_count > size / sizeof(__le64))
return false;
/*
* Not only that, but the size of the entire the snapshot
* header must also be representable in a size_t.
*/
- size -= snap_count * sizeof (__le64);
+ size -= snap_count * sizeof(__le64);
if ((u64) size < le64_to_cpu(ondisk->snap_names_len))
return false;
@@ -987,7 +987,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
size_t len;
len = strnlen(ondisk->object_prefix,
- sizeof (ondisk->object_prefix));
+ sizeof(ondisk->object_prefix));
object_prefix = kmalloc(len + 1, GFP_KERNEL);
if (!object_prefix)
return -ENOMEM;
@@ -1121,7 +1121,7 @@ static u32 rbd_dev_snap_index(struct rbd_device *rbd_dev, u64 snap_id)
u64 *found;
found = bsearch(&snap_id, &snapc->snaps, snapc->num_snaps,
- sizeof (snap_id), snapid_compare_reverse);
+ sizeof(snap_id), snapid_compare_reverse);
return found ? (u32)(found - &snapc->snaps[0]) : BAD_SNAP_INDEX;
}
@@ -2906,7 +2906,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
* le32 tv_nsec;
* } mtime;
*/
- size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32);
+ size = sizeof(__le64) + sizeof(__le32) + sizeof(__le32);
page_count = (u32)calc_pages_for(0, size);
pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
if (IS_ERR(pages))
@@ -4023,7 +4023,7 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev,
if (outbound_size) {
struct ceph_pagelist *pagelist;
- pagelist = kmalloc(sizeof (*pagelist), GFP_NOFS);
+ pagelist = kmalloc(sizeof(*pagelist), GFP_NOFS);
if (!pagelist)
goto out;
@@ -4332,8 +4332,8 @@ static int rbd_dev_v1_header_info(struct rbd_device *rbd_dev)
kfree(ondisk);
- size = sizeof (*ondisk);
- size += snap_count * sizeof (struct rbd_image_snap_ondisk);
+ size = sizeof(*ondisk);
+ size += snap_count * sizeof(struct rbd_image_snap_ondisk);
size += names_size;
ondisk = kmalloc(size, GFP_KERNEL);
if (!ondisk)
@@ -4797,7 +4797,7 @@ static struct rbd_spec *rbd_spec_alloc(void)
{
struct rbd_spec *spec;
- spec = kzalloc(sizeof (*spec), GFP_KERNEL);
+ spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec)
return NULL;
@@ -4961,14 +4961,18 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
__le64 size;
} __attribute__ ((packed)) size_buf = { 0 };
- ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_oid.name,
- "rbd", "get_size",
- &snapid, sizeof (snapid),
- &size_buf, sizeof (size_buf));
+ ret = rbd_obj_method_sync(rbd_dev,
+ rbd_dev->header_oid.name,
+ "rbd",
+ "get_size",
+ &snapid,
+ sizeof(snapid),
+ &size_buf,
+ sizeof(size_buf));
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
return ret;
- if (ret < sizeof (size_buf))
+ if (ret < sizeof(size_buf))
return -ERANGE;
if (order) {
@@ -5036,14 +5040,18 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
u64 unsup;
int ret;
- ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_oid.name,
- "rbd", "get_features",
- &snapid, sizeof (snapid),
- &features_buf, sizeof (features_buf));
+ ret = rbd_obj_method_sync(rbd_dev,
+ rbd_dev->header_oid.name,
+ "rbd",
+ "get_features",
+ &snapid,
+ sizeof(snapid),
+ &features_buf,
+ sizeof(features_buf));
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
return ret;
- if (ret < sizeof (features_buf))
+ if (ret < sizeof(features_buf))
return -ERANGE;
unsup = le64_to_cpu(features_buf.incompat) & ~RBD_FEATURES_SUPPORTED;
@@ -5087,10 +5095,10 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
if (!parent_spec)
return -ENOMEM;
- size = sizeof (__le64) + /* pool_id */
- sizeof (__le32) + RBD_IMAGE_ID_LEN_MAX + /* image_id */
- sizeof (__le64) + /* snap_id */
- sizeof (__le64); /* overlap */
+ size = sizeof(__le64) + /* pool_id */
+ sizeof(__le32) + RBD_IMAGE_ID_LEN_MAX + /* image_id */
+ sizeof(__le64) + /* snap_id */
+ sizeof(__le64); /* overlap */
reply_buf = kmalloc(size, GFP_KERNEL);
if (!reply_buf) {
ret = -ENOMEM;
@@ -5098,10 +5106,14 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
}
snapid = cpu_to_le64(rbd_dev->spec->snap_id);
- ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_oid.name,
- "rbd", "get_parent",
- &snapid, sizeof (snapid),
- reply_buf, size);
+ ret = rbd_obj_method_sync(rbd_dev,
+ rbd_dev->header_oid.name,
+ "rbd",
+ "get_parent",
+ &snapid,
+ sizeof(snapid),
+ reply_buf,
+ size);
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
goto free_buffer;
@@ -5194,7 +5206,7 @@ static int rbd_dev_v2_striping_info(struct rbd_device *rbd_dev)
__le64 stripe_unit;
__le64 stripe_count;
} __attribute__ ((packed)) striping_info_buf = { 0 };
- size_t size = sizeof (striping_info_buf);
+ size_t size = sizeof(striping_info_buf);
void *p;
u64 obj_size;
u64 stripe_unit;
@@ -5253,7 +5265,7 @@ static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
rbd_assert(!rbd_dev->spec->image_name);
len = strlen(rbd_dev->spec->image_id);
- image_id_size = sizeof (__le32) + len;
+ image_id_size = sizeof(__le32) + len;
image_id = kmalloc(image_id_size, GFP_KERNEL);
if (!image_id)
return NULL;
@@ -5262,7 +5274,7 @@ static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
end = image_id + image_id_size;
ceph_encode_string(&p, end, rbd_dev->spec->image_id, (u32)len);
- size = sizeof (__le32) + RBD_IMAGE_NAME_LEN_MAX;
+ size = sizeof(__le32) + RBD_IMAGE_NAME_LEN_MAX;
reply_buf = kmalloc(size, GFP_KERNEL);
if (!reply_buf)
goto free_id;
@@ -5443,8 +5455,8 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
* For now we have a fixed upper limit on the number we're
* prepared to receive.
*/
- size = sizeof (__le64) + sizeof (__le32) +
- RBD_MAX_SNAP_COUNT * sizeof (__le64);
+ size = sizeof(__le64) + sizeof(__le32) +
+ RBD_MAX_SNAP_COUNT * sizeof(__le64);
reply_buf = kzalloc(size, GFP_KERNEL);
if (!reply_buf)
return -ENOMEM;
@@ -5468,12 +5480,12 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
* make sure the computed size of the snapshot context we
* allocate is representable in a size_t.
*/
- if (snap_count > (SIZE_MAX - sizeof (struct ceph_snap_context))
- / sizeof (u64)) {
+ if (snap_count > (SIZE_MAX - sizeof(struct ceph_snap_context))
+ / sizeof(u64)) {
ret = -EINVAL;
goto free_buffer;
}
- if (!ceph_has_room(&p, end, snap_count * sizeof (__le64)))
+ if (!ceph_has_room(&p, end, snap_count * sizeof(__le64)))
goto free_buffer;
ret = 0;
@@ -5508,16 +5520,20 @@ static const char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev,
void *end;
char *snap_name;
- size = sizeof (__le32) + RBD_MAX_SNAP_NAME_LEN;
+ size = sizeof(__le32) + RBD_MAX_SNAP_NAME_LEN;
reply_buf = kmalloc(size, GFP_KERNEL);
if (!reply_buf)
return ERR_PTR(-ENOMEM);
snapid = cpu_to_le64(snap_id);
- ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_oid.name,
- "rbd", "get_snapshot_name",
- &snapid, sizeof (snapid),
- reply_buf, size);
+ ret = rbd_obj_method_sync(rbd_dev,
+ rbd_dev->header_oid.name,
+ "rbd",
+ "get_snapshot_name",
+ &snapid,
+ sizeof(snapid),
+ reply_buf,
+ size);
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0) {
snap_name = ERR_PTR(ret);
@@ -5728,7 +5744,7 @@ static int rbd_add_parse_args(const char *buf,
len = next_token(&buf);
if (!len) {
buf = RBD_SNAP_HEAD_NAME; /* No snapshot supplied */
- len = sizeof (RBD_SNAP_HEAD_NAME) - 1;
+ len = sizeof(RBD_SNAP_HEAD_NAME) - 1;
} else if (len > RBD_MAX_SNAP_NAME_LEN) {
ret = -ENAMETOOLONG;
goto free_options;
@@ -5741,7 +5757,7 @@ static int rbd_add_parse_args(const char *buf,
/* Initialize all rbd options to the defaults */
- rbd_opts = kzalloc(sizeof (*rbd_opts), GFP_KERNEL);
+ rbd_opts = kzalloc(sizeof(*rbd_opts), GFP_KERNEL);
if (!rbd_opts)
goto status_indication;
@@ -5906,7 +5922,7 @@ static void rbd_dev_unprobe(struct rbd_device *rbd_dev)
kfree(header->snap_sizes);
kfree(header->snap_names);
kfree(header->object_prefix);
- memset(header, 0, sizeof (*header));
+ memset(header, 0, sizeof(*header));
}
static int rbd_dev_v2_header_onetime(struct rbd_device *rbd_dev)
--
2.10.0
^ permalink raw reply related [flat|nested] 65+ messages in thread
* Re: [PATCH 02/47] block-rbd: Less function calls in rbd_header_from_disk() after error detection
2016-09-12 18:43 ` [PATCH 02/47] block-rbd: Less function calls in rbd_header_from_disk() after error detection SF Markus Elfring
@ 2016-09-13 7:58 ` Ilya Dryomov
0 siblings, 0 replies; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 7:58 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 8:43 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 11 Sep 2016 13:18:57 +0200
>
> The functions "ceph_put_snap_context" and "kfree" were called in a few
> cases by the function "rbd_header_from_disk" during error handling
> even if the passed variables contained a null pointer.
>
> Adjust jump targets according to the Linux coding style convention.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/block/rbd.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index e406c27..f4212e1 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1001,7 +1001,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
> snap_count = le32_to_cpu(ondisk->snap_count);
> snapc = ceph_create_snap_context(snap_count, GFP_KERNEL);
> if (!snapc)
> - goto out_err;
> + goto free_prefix;
> snapc->seq = le64_to_cpu(ondisk->snap_seq);
> if (snap_count) {
> struct rbd_image_snap_ondisk *snaps;
> @@ -1013,14 +1013,14 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
> goto out_2big;
> snap_names = kmalloc(snap_names_len, GFP_KERNEL);
> if (!snap_names)
> - goto out_err;
> + goto put_snap_context;
>
> /* ...as well as the array of their sizes. */
> snap_sizes = kmalloc_array(snap_count,
> sizeof(*header->snap_sizes),
> GFP_KERNEL);
> if (!snap_sizes)
> - goto out_err;
> + goto free_names;
>
> /*
> * Copy the names, and fill in each snapshot's id
> @@ -1066,10 +1066,12 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
> return 0;
> out_2big:
> ret = -EIO;
> -out_err:
> kfree(snap_sizes);
> + free_names:
> kfree(snap_names);
> + put_snap_context:
> ceph_put_snap_context(snapc);
> + free_prefix:
> kfree(object_prefix);
>
> return ret;
> --
> 2.10.0
>
Please don't send patches that restructure error handling gotos unless
you've spotted a bug. These patches are easy to get wrong, especially
when done in bulk, and require careful review.
Some people fancy a single sink label approach, others like separate
labels for each cleanup action - as long as the code is working, it's
a matter of taste.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-12 18:44 ` [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk() SF Markus Elfring
@ 2016-09-13 8:01 ` Ilya Dryomov
2016-09-13 8:12 ` SF Markus Elfring
0 siblings, 1 reply; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 8:01 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 8:44 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 11 Sep 2016 13:37:34 +0200
>
> Add a space character before a single jump label in this function
> according to the current Linux coding style convention.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/block/rbd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index f4212e1..d61a066 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1064,7 +1064,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
> header->snap_sizes = snap_sizes;
>
> return 0;
> -out_2big:
> + out_2big:
> ret = -EIO;
> kfree(snap_sizes);
> free_names:
> --
> 2.10.0
>
Can you point where this current convention is documented? Certainly
not in CodingStyle, AFAICT...
I know some people prefer a single space in there because it makes
"diff -p" work better, but nowadays with "git diff" this argument is
pretty moot.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id()
2016-09-12 18:45 ` [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id() SF Markus Elfring
@ 2016-09-13 8:03 ` Ilya Dryomov
2016-09-13 8:36 ` SF Markus Elfring
0 siblings, 1 reply; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 8:03 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 8:45 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 11 Sep 2016 14:48:41 +0200
>
> * Pass the sizes for memory allocations to the corresponding functions
> directly without storing the calculated values in an
> intermediate variable.
>
> * Delete the local variable "size" which became unnecessary with
> this refactoring.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/block/rbd.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index d61a066..c1da844 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -5833,7 +5833,6 @@ again:
> static int rbd_dev_image_id(struct rbd_device *rbd_dev)
> {
> int ret;
> - size_t size;
> char *object_name;
> void *response;
> char *image_id;
> @@ -5854,17 +5853,16 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
> * First, see if the format 2 image id file exists, and if
> * so, get the image's persistent id from it.
> */
> - size = sizeof (RBD_ID_PREFIX) + strlen(rbd_dev->spec->image_name);
> - object_name = kmalloc(size, GFP_NOIO);
> + object_name = kmalloc(sizeof(RBD_ID_PREFIX)
> + + strlen(rbd_dev->spec->image_name),
> + GFP_NOIO);
> if (!object_name)
> return -ENOMEM;
> sprintf(object_name, "%s%s", RBD_ID_PREFIX, rbd_dev->spec->image_name);
> dout("rbd id object name is %s\n", object_name);
>
> /* Response will be an encoded string, which includes a length */
> -
> - size = sizeof (__le32) + RBD_IMAGE_ID_LEN_MAX;
> - response = kzalloc(size, GFP_NOIO);
> + response = kzalloc(sizeof(__le32) + RBD_IMAGE_ID_LEN_MAX, GFP_NOIO);
> if (!response) {
> ret = -ENOMEM;
> goto out;
> --
> 2.10.0
>
How is this any better? If anything, it makes the first kmalloc() call
slightly less readable.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 06/47] block-rbd: Rename jump labels in rbd_add_parse_args()
2016-09-12 18:47 ` [PATCH 06/47] block-rbd: Rename jump labels in rbd_add_parse_args() SF Markus Elfring
@ 2016-09-13 8:05 ` Ilya Dryomov
0 siblings, 0 replies; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 8:05 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 8:47 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 11 Sep 2016 15:20:48 +0200
>
> Adjust jump labels according to the current Linux coding style convention.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/block/rbd.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index a6d9a06..dd4da1f 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -5709,27 +5709,27 @@ static int rbd_add_parse_args(const char *buf,
> return -ENOMEM;
> if (!*options) {
> rbd_warn(NULL, "no options provided");
> - goto out_err;
> + goto free_options;
> }
>
> spec = rbd_spec_alloc();
> if (!spec)
> - goto out_mem;
> + goto status_indication;
>
> spec->pool_name = dup_token(&buf, NULL);
> if (!spec->pool_name)
> - goto out_mem;
> + goto status_indication;
> if (!*spec->pool_name) {
> rbd_warn(NULL, "no pool name provided");
> - goto out_err;
> + goto free_options;
> }
>
> spec->image_name = dup_token(&buf, NULL);
> if (!spec->image_name)
> - goto out_mem;
> + goto status_indication;
> if (!*spec->image_name) {
> rbd_warn(NULL, "no image name provided");
> - goto out_err;
> + goto free_options;
> }
>
> /*
> @@ -5742,11 +5742,11 @@ static int rbd_add_parse_args(const char *buf,
> len = sizeof (RBD_SNAP_HEAD_NAME) - 1;
> } else if (len > RBD_MAX_SNAP_NAME_LEN) {
> ret = -ENAMETOOLONG;
> - goto out_err;
> + goto free_options;
> }
> snap_name = kmemdup(buf, len + 1, GFP_KERNEL);
> if (!snap_name)
> - goto out_mem;
> + goto status_indication;
> *(snap_name + len) = '\0';
> spec->snap_name = snap_name;
>
> @@ -5754,7 +5754,7 @@ static int rbd_add_parse_args(const char *buf,
>
> rbd_opts = kzalloc(sizeof (*rbd_opts), GFP_KERNEL);
> if (!rbd_opts)
> - goto out_mem;
> + goto status_indication;
>
> rbd_opts->read_only = RBD_READ_ONLY_DEFAULT;
> rbd_opts->queue_depth = RBD_QUEUE_DEPTH_DEFAULT;
> @@ -5764,7 +5764,7 @@ static int rbd_add_parse_args(const char *buf,
> parse_rbd_opts_token, rbd_opts);
> if (IS_ERR(copts)) {
> ret = PTR_ERR(copts);
> - goto out_err;
> + goto free_options;
> }
> kfree(options);
>
> @@ -5773,9 +5773,9 @@ static int rbd_add_parse_args(const char *buf,
> *rbd_spec = spec;
>
> return 0;
> -out_mem:
> + status_indication:
> ret = -ENOMEM;
> -out_err:
> + free_options:
> kfree(rbd_opts);
> rbd_spec_put(spec);
> kfree(options);
> --
> 2.10.0
For a ret = -ENOMEM; statement, your status_indication label actually
conveys less information than out_mem did. Don't waste everybody's
time by sending these pointless rename patches, please.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create()
2016-09-12 19:00 ` [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create() SF Markus Elfring
@ 2016-09-13 8:07 ` Ilya Dryomov
0 siblings, 0 replies; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 8:07 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 9:00 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 12 Sep 2016 18:12:39 +0200
>
> Adjust jump labels according to the current Linux coding style convention.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/block/rbd.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 6acddc53..262805a 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -4930,23 +4930,22 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,
> minor_to_rbd_dev_id(1 << MINORBITS),
> GFP_KERNEL);
> if (rbd_dev->dev_id < 0)
> - goto fail_rbd_dev;
> + goto free_device;
>
> sprintf(rbd_dev->name, RBD_DRV_NAME "%d", rbd_dev->dev_id);
> rbd_dev->task_wq = alloc_ordered_workqueue("%s-tasks", WQ_MEM_RECLAIM,
> rbd_dev->name);
> if (!rbd_dev->task_wq)
> - goto fail_dev_id;
> + goto remove_id;
>
> /* we have a ref from do_rbd_add() */
> __module_get(THIS_MODULE);
>
> dout("%s rbd_dev %p dev_id %d\n", __func__, rbd_dev, rbd_dev->dev_id);
> return rbd_dev;
> -
> -fail_dev_id:
> + remove_id:
> ida_simple_remove(&rbd_dev_id_ida, rbd_dev->dev_id);
> -fail_rbd_dev:
> + free_device:
> rbd_dev_free(rbd_dev);
> return NULL;
> }
> --
> 2.10.0
>
Really? I mean out_err -> free_device I can understand, but this?
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit()
2016-09-12 19:14 ` [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit() SF Markus Elfring
@ 2016-09-13 8:10 ` Ilya Dryomov
0 siblings, 0 replies; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 8:10 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 9:14 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 12 Sep 2016 19:44:30 +0200
>
> Adjust a jump target so that a duplicate check can then be avoided
> at the end.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/block/rbd.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 17bdc21..66801ec 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -2920,7 +2920,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
> stat_request = rbd_obj_request_create(obj_request->object_name, 0, 0,
> OBJ_REQUEST_PAGES);
> if (!stat_request)
> - goto out;
> + goto put_request;
>
> rbd_obj_request_get(obj_request);
> stat_request->obj_request = obj_request;
> @@ -2932,7 +2932,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
> stat_request->osd_req = rbd_osd_req_create(rbd_dev, OBJ_OP_READ, 1,
> stat_request);
> if (!stat_request->osd_req)
> - goto out;
> + goto put_request;
> stat_request->callback = rbd_img_obj_exists_callback;
>
> osd_req_op_init(stat_request->osd_req, 0, CEPH_OSD_OP_STAT, 0);
> @@ -2942,8 +2942,8 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
>
> osdc = &rbd_dev->rbd_client->client->osdc;
> ret = rbd_obj_request_submit(osdc, stat_request);
> -out:
> if (ret)
> + put_request:
> rbd_obj_request_put(obj_request);
>
> return ret;
> --
> 2.10.0
Don't do this. goto into an if block is rarely a good idea, more so
when you are attempting to micro-optimize a very cold error path.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 8:01 ` Ilya Dryomov
@ 2016-09-13 8:12 ` SF Markus Elfring
2016-09-13 9:16 ` Ilya Dryomov
0 siblings, 1 reply; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-13 8:12 UTC (permalink / raw)
To: Ilya Dryomov
Cc: ceph-devel, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
>> @@ -1064,7 +1064,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
>> header->snap_sizes = snap_sizes;
>>
>> return 0;
>> -out_2big:
>> + out_2big:
>> ret = -EIO;
>> kfree(snap_sizes);
>> free_names:
…
> Can you point where this current convention is documented?
Yes.
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/Documentation/CodingStyle?id=865a1caa4b6b886babdd9d67e7c3608be4567a51
Do you find the software update "CodingStyle: Clarify and complete chapter 7" interesting?
> Certainly not in CodingStyle, AFAICT...
I suggest to look at the current version once more.
> I know some people prefer a single space in there because it makes
> "diff -p" work better, but nowadays with "git diff" this argument is
> pretty moot.
Would you like to discuss the corresponding software evolution a bit more?
Regards,
Markus
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id()
2016-09-13 8:03 ` Ilya Dryomov
@ 2016-09-13 8:36 ` SF Markus Elfring
0 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2016-09-13 8:36 UTC (permalink / raw)
To: Ilya Dryomov
Cc: ceph-devel, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
>> @@ -5833,7 +5833,6 @@ again:
>> static int rbd_dev_image_id(struct rbd_device *rbd_dev)
>> {
>> int ret;
>> - size_t size;
>> char *object_name;
>> void *response;
>> char *image_id;
>> @@ -5854,17 +5853,16 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
>> * First, see if the format 2 image id file exists, and if
>> * so, get the image's persistent id from it.
>> */
>> - size = sizeof (RBD_ID_PREFIX) + strlen(rbd_dev->spec->image_name);
>> - object_name = kmalloc(size, GFP_NOIO);
>> + object_name = kmalloc(sizeof(RBD_ID_PREFIX)
>> + + strlen(rbd_dev->spec->image_name),
>> + GFP_NOIO);
>> if (!object_name)
>> return -ENOMEM;
>> sprintf(object_name, "%s%s", RBD_ID_PREFIX, rbd_dev->spec->image_name);
>> dout("rbd id object name is %s\n", object_name);
>>
>> /* Response will be an encoded string, which includes a length */
>> -
>> - size = sizeof (__le32) + RBD_IMAGE_ID_LEN_MAX;
>> - response = kzalloc(size, GFP_NOIO);
>> + response = kzalloc(sizeof(__le32) + RBD_IMAGE_ID_LEN_MAX, GFP_NOIO);
>> if (!response) {
>> ret = -ENOMEM;
>> goto out;
…
> How is this any better?
I find it useful to omit the local variable "size" here.
> If anything, it makes the first kmalloc() call slightly less readable.
I got an other impression. The refactored function call did not fit into a single line
because of a well-known length limitation.
Does the kzalloc() call look a bit nicer for you now?
Regards,
Markus
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 8:12 ` SF Markus Elfring
@ 2016-09-13 9:16 ` Ilya Dryomov
2016-09-13 14:36 ` Jean Delvare
0 siblings, 1 reply; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 9:16 UTC (permalink / raw)
To: SF Markus Elfring, Jonathan Corbet
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall, Jean Delvare
On Tue, Sep 13, 2016 at 10:12 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>>> @@ -1064,7 +1064,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
>>> header->snap_sizes = snap_sizes;
>>>
>>> return 0;
>>> -out_2big:
>>> + out_2big:
>>> ret = -EIO;
>>> kfree(snap_sizes);
>>> free_names:
> …
>> Can you point where this current convention is documented?
>
> Yes.
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/Documentation/CodingStyle?id=865a1caa4b6b886babdd9d67e7c3608be4567a51
Huh. That patch is not in Linus' tree.
>
> Do you find the software update "CodingStyle: Clarify and complete chapter 7" interesting?
>
>
>> Certainly not in CodingStyle, AFAICT...
>
> I suggest to look at the current version once more.
>
>
>> I know some people prefer a single space in there because it makes
>> "diff -p" work better, but nowadays with "git diff" this argument is
>> pretty moot.
>
> Would you like to discuss the corresponding software evolution a bit more?
Jon, could you please yank 865a1caa4b6b ("CodingStyle: Clarify and
complete chapter 7") from your linux-next branch or at least change "It
is advised to indent labels" to something less stronger? It hasn't
even hit mainline yet and we are already getting spammed.
Looks like 9 out of 10 labels are not indented
$ git grep '^[a-z0-9]\+:' -- *.c | wc -l
27945
$ git grep '^ [a-z0-9]\+:' -- *.c | wc -l
2925
so I'd say that's a bad advise as far as consistency goes, and the
"diff -p" argument is pretty moot nowadays.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 9:16 ` Ilya Dryomov
@ 2016-09-13 14:36 ` Jean Delvare
2016-09-13 15:30 ` Ilya Dryomov
0 siblings, 1 reply; 65+ messages in thread
From: Jean Delvare @ 2016-09-13 14:36 UTC (permalink / raw)
To: Ilya Dryomov
Cc: Jonathan Corbet, Ceph Development, Alex Elder, Sage Weil, LKML,
kernel-janitors, Julia Lawall, Andrew Morton
Hi Ilya,
Thanks for adding me.
On Tue, 13 Sep 2016 11:16:13 +0200, Ilya Dryomov wrote:
> On Tue, Sep 13, 2016 at 10:12 AM, SF Markus Elfring
> <elfring@users.sourceforge.net> wrote:
> >>> @@ -1064,7 +1064,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
> >>> header->snap_sizes = snap_sizes;
> >>>
> >>> return 0;
> >>> -out_2big:
> >>> + out_2big:
> >>> ret = -EIO;
> >>> kfree(snap_sizes);
> >>> free_names:
> > …
> >> Can you point where this current convention is documented?
> >
> > Yes.
> > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/Documentation/CodingStyle?id=865a1caa4b6b886babdd9d67e7c3608be4567a51
>
> Huh. That patch is not in Linus' tree.
>
> >
> > Do you find the software update "CodingStyle: Clarify and complete chapter 7" interesting?
> >
> >
> >> Certainly not in CodingStyle, AFAICT...
> >
> > I suggest to look at the current version once more.
> >
> >
> >> I know some people prefer a single space in there because it makes
> >> "diff -p" work better, but nowadays with "git diff" this argument is
> >> pretty moot.
> >
> > Would you like to discuss the corresponding software evolution a bit more?
>
> Jon, could you please yank 865a1caa4b6b ("CodingStyle: Clarify and
> complete chapter 7") from your linux-next branch or at least change "It
> is advised to indent labels" to something less stronger? It hasn't
> even hit mainline yet and we are already getting spammed.
The problem isn't the documentation update nor whether you or me like a
space before labels or not. The problem is Markus Elfring. The guy just
spend his time flooding maintainers with unneeded changes they never
asked for. Ignore him and you'll be much better. If he was not flooding
you with this, he would find something else :-(
When I wrote "It is advised to indent labels with one space", I never
meant that all the existing code should be converted that way. I
expressed a preference, and provided a rationale for this preference.
After that, an advice is just that: an advice.
> Looks like 9 out of 10 labels are not indented
>
> $ git grep '^[a-z0-9]\+:' -- *.c | wc -l
> 27945
> $ git grep '^ [a-z0-9]\+:' -- *.c | wc -l
> 2925
Your regexps are wrong ;-) but the ratio is correct.
> so I'd say that's a bad advise as far as consistency goes, and the
> "diff -p" argument is pretty moot nowadays.
It wasn't moot when I sent the documentation update patch. Or why would
you think it was? "git diff", by default, behaves exactly the same as
"diff -p" with regards to unindented labels (i.e. it doesn't handle
them properly.)
However, since then the issue was discussed somewhere else:
https://lkml.org/lkml/2016/9/5/214
As you can see, alternatives to indenting labels with one space were
found. Therefore you will soon be correct saying "the diff -p argument
is pretty moot." As soon as my patch hits mainline, actually. Which
shouldn't take too long as Andrew Morton picked it 4 days ago.
Once this happens, I'm fine with CodingStyle being updated again to
reflect the current situation.
Hope it clarifies,
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 14:36 ` Jean Delvare
@ 2016-09-13 15:30 ` Ilya Dryomov
2016-09-13 16:50 ` Jean Delvare
0 siblings, 1 reply; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 15:30 UTC (permalink / raw)
To: Jean Delvare
Cc: Jonathan Corbet, Ceph Development, Alex Elder, Sage Weil, LKML,
kernel-janitors, Julia Lawall, Andrew Morton
On Tue, Sep 13, 2016 at 4:36 PM, Jean Delvare <jdelvare@suse.de> wrote:
> Hi Ilya,
>
> Thanks for adding me.
>
> On Tue, 13 Sep 2016 11:16:13 +0200, Ilya Dryomov wrote:
>> On Tue, Sep 13, 2016 at 10:12 AM, SF Markus Elfring
>> <elfring@users.sourceforge.net> wrote:
>> >>> @@ -1064,7 +1064,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev,
>> >>> header->snap_sizes = snap_sizes;
>> >>>
>> >>> return 0;
>> >>> -out_2big:
>> >>> + out_2big:
>> >>> ret = -EIO;
>> >>> kfree(snap_sizes);
>> >>> free_names:
>> > …
>> >> Can you point where this current convention is documented?
>> >
>> > Yes.
>> > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/Documentation/CodingStyle?id=865a1caa4b6b886babdd9d67e7c3608be4567a51
>>
>> Huh. That patch is not in Linus' tree.
>>
>> >
>> > Do you find the software update "CodingStyle: Clarify and complete chapter 7" interesting?
>> >
>> >
>> >> Certainly not in CodingStyle, AFAICT...
>> >
>> > I suggest to look at the current version once more.
>> >
>> >
>> >> I know some people prefer a single space in there because it makes
>> >> "diff -p" work better, but nowadays with "git diff" this argument is
>> >> pretty moot.
>> >
>> > Would you like to discuss the corresponding software evolution a bit more?
>>
>> Jon, could you please yank 865a1caa4b6b ("CodingStyle: Clarify and
>> complete chapter 7") from your linux-next branch or at least change "It
>> is advised to indent labels" to something less stronger? It hasn't
>> even hit mainline yet and we are already getting spammed.
>
> The problem isn't the documentation update nor whether you or me like a
> space before labels or not. The problem is Markus Elfring. The guy just
> spend his time flooding maintainers with unneeded changes they never
> asked for. Ignore him and you'll be much better. If he was not flooding
> you with this, he would find something else :-(
>
> When I wrote "It is advised to indent labels with one space", I never
> meant that all the existing code should be converted that way. I
Hi Jean,
That much is clear, however ...
> expressed a preference, and provided a rationale for this preference.
> After that, an advice is just that: an advice.
>
>> Looks like 9 out of 10 labels are not indented
>>
>> $ git grep '^[a-z0-9]\+:' -- *.c | wc -l
>> 27945
>> $ git grep '^ [a-z0-9]\+:' -- *.c | wc -l
>> 2925
>
> Your regexps are wrong ;-) but the ratio is correct.
... one of the main points of any coding style is consistency. When
someone new wanting to submit say a new driver opens CodingStyle and
sees "It is advised to indent labels ...", they might start indenting
labels in their code and advise others to do the same. Given the 9/10
existing ratio, that advice is wrong. If I wanted to clarify the
situation, I'd have gone with "one space indented labels are also
acceptable" or so. The example you've re-indented dates back to 2.6.4
times...
>
>> so I'd say that's a bad advise as far as consistency goes, and the
>> "diff -p" argument is pretty moot nowadays.
>
> It wasn't moot when I sent the documentation update patch. Or why would
> you think it was? "git diff", by default, behaves exactly the same as
> "diff -p" with regards to unindented labels (i.e. it doesn't handle
> them properly.)
The git diff xfuncname incantation is a few years old now. git diff
also works on regular files, BTW.
>
> However, since then the issue was discussed somewhere else:
> https://lkml.org/lkml/2016/9/5/214
>
> As you can see, alternatives to indenting labels with one space were
> found. Therefore you will soon be correct saying "the diff -p argument
> is pretty moot." As soon as my patch hits mainline, actually. Which
> shouldn't take too long as Andrew Morton picked it 4 days ago.
>
> Once this happens, I'm fine with CodingStyle being updated again to
> reflect the current situation.
I'm not sure which patch you are talking about - the message you linked
is not a patch and it's impossible to follow large threads on lkml.org.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 15:30 ` Ilya Dryomov
@ 2016-09-13 16:50 ` Jean Delvare
2016-09-13 18:31 ` Ilya Dryomov
0 siblings, 1 reply; 65+ messages in thread
From: Jean Delvare @ 2016-09-13 16:50 UTC (permalink / raw)
To: Ilya Dryomov
Cc: Jonathan Corbet, Ceph Development, Alex Elder, Sage Weil, LKML,
kernel-janitors, Julia Lawall, Andrew Morton
On Tue, 13 Sep 2016 17:30:33 +0200, Ilya Dryomov wrote:
> On Tue, Sep 13, 2016 at 4:36 PM, Jean Delvare <jdelvare@suse.de> wrote:
> > On Tue, 13 Sep 2016 11:16:13 +0200, Ilya Dryomov wrote:
> >> Jon, could you please yank 865a1caa4b6b ("CodingStyle: Clarify and
> >> complete chapter 7") from your linux-next branch or at least change "It
> >> is advised to indent labels" to something less stronger? It hasn't
> >> even hit mainline yet and we are already getting spammed.
> >
> > The problem isn't the documentation update nor whether you or me like a
> > space before labels or not. The problem is Markus Elfring. The guy just
> > spend his time flooding maintainers with unneeded changes they never
> > asked for. Ignore him and you'll be much better. If he was not flooding
> > you with this, he would find something else :-(
> >
> > When I wrote "It is advised to indent labels with one space", I never
> > meant that all the existing code should be converted that way. I
>
> Hi Jean,
>
> That much is clear, however ...
>
> > expressed a preference, and provided a rationale for this preference.
> > After that, an advice is just that: an advice.
> >
> >> Looks like 9 out of 10 labels are not indented
> >>
> >> $ git grep '^[a-z0-9]\+:' -- *.c | wc -l
> >> 27945
> >> $ git grep '^ [a-z0-9]\+:' -- *.c | wc -l
> >> 2925
> >
> > Your regexps are wrong ;-) but the ratio is correct.
>
> ... one of the main points of any coding style is consistency. When
> someone new wanting to submit say a new driver opens CodingStyle and
> sees "It is advised to indent labels ...", they might start indenting
> labels in their code and advise others to do the same. Given the 9/10
> existing ratio, that advice is wrong.
Or you could read the thread I pointed you to, where I explain why this
reasoning is wrong.
> If I wanted to clarify the
> situation, I'd have gone with "one space indented labels are also
> acceptable" or so. The example you've re-indented dates back to 2.6.4
> times...
I can't see how this is relevant.
> >> so I'd say that's a bad advise as far as consistency goes, and the
> >> "diff -p" argument is pretty moot nowadays.
> >
> > It wasn't moot when I sent the documentation update patch. Or why would
> > you think it was? "git diff", by default, behaves exactly the same as
> > "diff -p" with regards to unindented labels (i.e. it doesn't handle
> > them properly.)
>
> The git diff xfuncname incantation is a few years old now.
It doesn't help if a majority of developers don't know about it (as was
my case until last week), and the project itself doesn't carry the
required configuration bits to make it work out of the box (which
hopefully will be the case soon, see below.)
> git diff also works on regular files, BTW.
I have no idea what you mean here, sorry.
> > However, since then the issue was discussed somewhere else:
> > https://lkml.org/lkml/2016/9/5/214
> >
> > As you can see, alternatives to indenting labels with one space were
> > found. Therefore you will soon be correct saying "the diff -p argument
> > is pretty moot." As soon as my patch hits mainline, actually. Which
> > shouldn't take too long as Andrew Morton picked it 4 days ago.
> >
> > Once this happens, I'm fine with CodingStyle being updated again to
> > reflect the current situation.
>
> I'm not sure which patch you are talking about - the message you linked
> is not a patch and it's impossible to follow large threads on lkml.org.
The solution was in this thread, which I expected you to read. The
patch proper was sent separately:
http://marc.info/?l=linux-kernel&m=147325166209844&w=2
It uses the git diff xfuncname feature you mentioned above. To be
honest I'm surprised it isn't the git default, it seems odd to have so
many diff drivers included in git and not enable them on obvious file
extensions. Oh well.
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 16:50 ` Jean Delvare
@ 2016-09-13 18:31 ` Ilya Dryomov
2016-09-19 9:37 ` Jean Delvare
0 siblings, 1 reply; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-13 18:31 UTC (permalink / raw)
To: Jean Delvare
Cc: Jonathan Corbet, Ceph Development, Alex Elder, Sage Weil, LKML,
kernel-janitors, Julia Lawall, Andrew Morton
On Tue, Sep 13, 2016 at 6:50 PM, Jean Delvare <jdelvare@suse.de> wrote:
> On Tue, 13 Sep 2016 17:30:33 +0200, Ilya Dryomov wrote:
>> On Tue, Sep 13, 2016 at 4:36 PM, Jean Delvare <jdelvare@suse.de> wrote:
>> > On Tue, 13 Sep 2016 11:16:13 +0200, Ilya Dryomov wrote:
>> >> Jon, could you please yank 865a1caa4b6b ("CodingStyle: Clarify and
>> >> complete chapter 7") from your linux-next branch or at least change "It
>> >> is advised to indent labels" to something less stronger? It hasn't
>> >> even hit mainline yet and we are already getting spammed.
>> >
>> > The problem isn't the documentation update nor whether you or me like a
>> > space before labels or not. The problem is Markus Elfring. The guy just
>> > spend his time flooding maintainers with unneeded changes they never
>> > asked for. Ignore him and you'll be much better. If he was not flooding
>> > you with this, he would find something else :-(
>> >
>> > When I wrote "It is advised to indent labels with one space", I never
>> > meant that all the existing code should be converted that way. I
>>
>> Hi Jean,
>>
>> That much is clear, however ...
>>
>> > expressed a preference, and provided a rationale for this preference.
>> > After that, an advice is just that: an advice.
>> >
>> >> Looks like 9 out of 10 labels are not indented
>> >>
>> >> $ git grep '^[a-z0-9]\+:' -- *.c | wc -l
>> >> 27945
>> >> $ git grep '^ [a-z0-9]\+:' -- *.c | wc -l
>> >> 2925
>> >
>> > Your regexps are wrong ;-) but the ratio is correct.
>>
>> ... one of the main points of any coding style is consistency. When
>> someone new wanting to submit say a new driver opens CodingStyle and
>> sees "It is advised to indent labels ...", they might start indenting
>> labels in their code and advise others to do the same. Given the 9/10
>> existing ratio, that advice is wrong.
>
> Or you could read the thread I pointed you to, where I explain why this
> reasoning is wrong.
Sorry, navigating lkml.org archive is a pain, and I was expecting to
see patch. Your points
"The acceptance of an optional single space before labels dates back to
at least June 2007, as supported by the very first incarnation of
checkpatch.pl. So nothing really new here, except for a preference
(my preference, admittedly, but I'm know I'm not alone) being expressed
in the coding style document."
"Recommendations are not meant to document what people are currently
doing but what we think they should be doing."
are valid, but note that there is a world of difference between an
acceptance and a preference. The *only* point of whitespace guidelines
is to keep the code base consistent. You don't go changing whitespace
preferences in such a huge project, not unless you have a *very* good
rationale and existing code base is swayed (which it isn't, given the
9/10 ratio).
>
>> If I wanted to clarify the
>> situation, I'd have gone with "one space indented labels are also
>> acceptable" or so. The example you've re-indented dates back to 2.6.4
>> times...
>
> I can't see how this is relevant.
That was a 12 year old example, codifying an existing style used in
~90% cases, serving as a guideline for new contributors.
>
>> >> so I'd say that's a bad advise as far as consistency goes, and the
>> >> "diff -p" argument is pretty moot nowadays.
>> >
>> > It wasn't moot when I sent the documentation update patch. Or why would
>> > you think it was? "git diff", by default, behaves exactly the same as
>> > "diff -p" with regards to unindented labels (i.e. it doesn't handle
>> > them properly.)
>>
>> The git diff xfuncname incantation is a few years old now.
>
> It doesn't help if a majority of developers don't know about it (as was
> my case until last week), and the project itself doesn't carry the
> required configuration bits to make it work out of the box (which
> hopefully will be the case soon, see below.)
>
>> git diff also works on regular files, BTW.
>
> I have no idea what you mean here, sorry.
Oh, just that it works outside of git repos too, so you aren't stuck
with diffutils if you want to diff two random .c files.
>
>> > However, since then the issue was discussed somewhere else:
>> > https://lkml.org/lkml/2016/9/5/214
>> >
>> > As you can see, alternatives to indenting labels with one space were
>> > found. Therefore you will soon be correct saying "the diff -p argument
>> > is pretty moot." As soon as my patch hits mainline, actually. Which
>> > shouldn't take too long as Andrew Morton picked it 4 days ago.
>> >
>> > Once this happens, I'm fine with CodingStyle being updated again to
>> > reflect the current situation.
>>
>> I'm not sure which patch you are talking about - the message you linked
>> is not a patch and it's impossible to follow large threads on lkml.org.
>
> The solution was in this thread, which I expected you to read. The
> patch proper was sent separately:
>
> http://marc.info/?l=linux-kernel&m=147325166209844&w=2
>
> It uses the git diff xfuncname feature you mentioned above. To be
> honest I'm surprised it isn't the git default, it seems odd to have so
> many diff drivers included in git and not enable them on obvious file
> extensions. Oh well.
This came up before: http://www.spinics.net/lists/git/msg164216.html,
Linus didn't like it. I suggest you add him to the CC on this patch to
see if he changed his mind.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk()
2016-09-12 18:42 ` [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk() SF Markus Elfring
@ 2016-09-14 15:25 ` Ilya Dryomov
0 siblings, 0 replies; 65+ messages in thread
From: Ilya Dryomov @ 2016-09-14 15:25 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Ceph Development, Alex Elder, Sage Weil, LKML, kernel-janitors,
Julia Lawall
On Mon, Sep 12, 2016 at 8:42 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 11 Sep 2016 12:21:25 +0200
>
> * A multiplication for the size determination of a memory allocation
> indicated that an array data structure should be processed.
> Thus use the corresponding function "kmalloc_array".
>
> This issue was detected by using the Coccinelle software.
>
> * Delete the local variable "size" which became unnecessary with
> this refactoring.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Now applied.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk()
2016-09-13 18:31 ` Ilya Dryomov
@ 2016-09-19 9:37 ` Jean Delvare
0 siblings, 0 replies; 65+ messages in thread
From: Jean Delvare @ 2016-09-19 9:37 UTC (permalink / raw)
To: Ilya Dryomov
Cc: Jonathan Corbet, Ceph Development, Alex Elder, Sage Weil, LKML,
kernel-janitors, Julia Lawall, Andrew Morton
Hi Ilya,
Sorry for the late answer.
On Tue, 13 Sep 2016 20:31:57 +0200, Ilya Dryomov wrote:
> Sorry, navigating lkml.org archive is a pain, and I was expecting to
> see patch. Your points
>
> "The acceptance of an optional single space before labels dates back to
> at least June 2007, as supported by the very first incarnation of
> checkpatch.pl. So nothing really new here, except for a preference
> (my preference, admittedly, but I'm know I'm not alone) being expressed
> in the coding style document."
>
> "Recommendations are not meant to document what people are currently
> doing but what we think they should be doing."
>
> are valid, but note that there is a world of difference between an
> acceptance and a preference. The *only* point of whitespace guidelines
> is to keep the code base consistent.
Consistency is half of the reason, the other half is readability. This
is why the CodingStyle document has a number of rationales explained.
This is also why we put whitespace in the first place, while the C
language doesn't require any ;-)
The sense of my proposal was to address a readability (or usability)
issue.
> You don't go changing whitespace
> preferences in such a huge project, not unless you have a *very* good
> rationale and existing code base is swayed (which it isn't, given the
> 9/10 ratio).
I did consider the reason to be good enough to warrant a "change",
actually. Or more exactly from "one space is allowed" to "one space is
recommended." Which is quite different from changing all the code
actively. I can understand how you don't like it, but again, this
"inconsistency" has been accepted for almost a decade now, so I find it
strange to see so much resistance when someone finally tries to sort it
out.
> >> If I wanted to clarify the
> >> situation, I'd have gone with "one space indented labels are also
> >> acceptable" or so. The example you've re-indented dates back to 2.6.4
> >> times...
> >
> > I can't see how this is relevant.
>
> That was a 12 year old example, codifying an existing style used in
> ~90% cases, serving as a guideline for new contributors.
OK, I get your point now. But the CodingStyle document isn't carved
into stone. I see 43 changes to that file in recent history (since
April 2005), some of which are actual changes or clarifications of our
coding style. This very section of the document was updated in December
2014, so not so long ago.
In the end I suppose it boils down to how problematic you consider the
current situation to be. Apparently you and several other maintainers
think it's just fine, while me (and a few others apparently) think it
is not.
> >> git diff also works on regular files, BTW.
> >
> > I have no idea what you mean here, sorry.
>
> Oh, just that it works outside of git repos too, so you aren't stuck
> with diffutils if you want to diff two random .c files.
Oh, I had never thought of that. Thanks for the hint :-)
> > (...)
> > http://marc.info/?l=linux-kernel&m=147325166209844&w=2
> >
> > It uses the git diff xfuncname feature you mentioned above. To be
> > honest I'm surprised it isn't the git default, it seems odd to have so
> > many diff drivers included in git and not enable them on obvious file
> > extensions. Oh well.
>
> This came up before: http://www.spinics.net/lists/git/msg164216.html,
> Linus didn't like it. I suggest you add him to the CC on this patch to
> see if he changed his mind.
Thanks for the pointer. It is interesting to see many people had been
bothered by the same problem for many years and even proposed solution
for it. But also sad to see that nothing happened :-(
Well Linus suggested to improve the default, he was not opposed to the
change per se I think. But it was 5 years ago and nothing happened
since then, so I'd rather go with what is available today. Which means
either one space before labels, or drivers in .gitattributes. Choose
your poison ;-)
Thanks,
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 65+ messages in thread
* Re: [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
` (47 preceding siblings ...)
2016-09-12 19:36 ` [PATCH 47/47] block-rbd: Delete unwanted spaces behind usages of the sizeof operator SF Markus Elfring
@ 2017-08-13 19:10 ` SF Markus Elfring
48 siblings, 0 replies; 65+ messages in thread
From: SF Markus Elfring @ 2017-08-13 19:10 UTC (permalink / raw)
To: ceph-devel, Alex Elder, Ilya Dryomov, Sage Weil
> Date: Mon, 12 Sep 2016 20:35:20 +0200
>
> Several update suggestions were taken into account
> from static source code analysis.
>
> Markus Elfring (47):
> Use kmalloc_array() in rbd_header_from_disk()
> Less function calls in rbd_header_from_disk() after error detection
> Adjust the position of a jump label in rbd_header_from_disk()
> Refactor two calls for memory allocations in rbd_dev_image_id()
> One function call less in rbd_dev_image_id() after error detection
> Rename jump labels in rbd_add_parse_args()
> Rename a jump label in rbd_dev_v2_snap_name()
> Rename jump labels in rbd_dev_v2_snap_context()
> Rename a jump label in rbd_spec_fill_names()
> One function call less in rbd_dev_image_name() after error detection
> Delete three unnecessary initialisations in rbd_dev_image_name()
> One function call less in rbd_dev_v2_parent_info() after error detection
> Delete an unnecessary initialisation in rbd_dev_v2_parent_info()
> Rename a jump label in rbd_dev_v2_object_prefix()
> Rename jump labels in rbd_dev_create()
> Rename jump labels in rbd_dev_v1_header_info()
> Rename jump labels in rbd_init_disk()
> Fix jump targets in rbd_queue_workfn()
> Rename a jump label in rbd_reregister_watch()
> Rename a jump label in rbd_register_watch()
> Rename jump labels in rbd_try_lock()
> Rename a jump label in find_watcher()
> Rename jump labels in get_lock_owner_info()
> Rename jump labels in rbd_request_lock()
> Fix jump targets in rbd_img_parent_read()
> Rename a jump label in rbd_img_parent_read_callback()
> Rename a jump label in rbd_img_request_submit()
> Refactor a jump target in rbd_img_obj_exists_submit()
> Delete an unnecessary initialisation in rbd_img_obj_exists_submit()
> Refactor a jump target in rbd_img_obj_exists_callback()
> Fix three jump targets in rbd_img_obj_parent_read_full()
> Rename a jump label in rbd_img_obj_parent_read_full_callback()
> Adjust the position of a jump label in rbd_img_request_fill()
> Rename a jump label in rbd_img_obj_callback()
> Rename jump labels in rbd_osd_req_create_copyup()
> Rename jump labels in rbd_osd_req_create()
> Rename a jump label in bio_chain_clone_range()
> Rename jump labels in rbd_client_create()
> Rename a jump label in rbd_ioctl_set_ro()
> One function call less in rbd_dev_probe_parent() after error detection
> Rename jump labels in rbd_dev_device_setup()
> Rename jump labels in rbd_dev_image_probe()
> Rename jump labels in do_rbd_add()
> Delete an unnecessary initialisation in do_rbd_add()
> Rename a jump label in rbd_slab_init()
> Rename jump labels in rbd_init()
> Delete unwanted spaces behind usages of the sizeof operator
>
> drivers/block/rbd.c | 544 ++++++++++++++++++++++++++--------------------------
> 1 file changed, 272 insertions(+), 272 deletions(-)
How can the clarification be continued for the shown change possibilities?
(Can a bit more development discussion become helpful?)
https://lkml.org/lkml/2016/9/12/932
https://lkml.kernel.org/r/<57806eb1-10ed-582e-72d0-2975e1ee967a@users.sourceforge.net>
https://patchwork.kernel.org/patch/9327545/
Regards,
Markus
^ permalink raw reply [flat|nested] 65+ messages in thread
end of thread, other threads:[~2017-08-13 19:10 UTC | newest]
Thread overview: 65+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <566ABCD9.1060404@users.sourceforge.net>
2016-09-12 18:40 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
2016-09-12 18:42 ` [PATCH 01/47] block-rbd: Use kmalloc_array() in rbd_header_from_disk() SF Markus Elfring
2016-09-14 15:25 ` Ilya Dryomov
2016-09-12 18:43 ` [PATCH 02/47] block-rbd: Less function calls in rbd_header_from_disk() after error detection SF Markus Elfring
2016-09-13 7:58 ` Ilya Dryomov
2016-09-12 18:44 ` [PATCH 03/47] block-rbd: Adjust the position of a jump label in rbd_header_from_disk() SF Markus Elfring
2016-09-13 8:01 ` Ilya Dryomov
2016-09-13 8:12 ` SF Markus Elfring
2016-09-13 9:16 ` Ilya Dryomov
2016-09-13 14:36 ` Jean Delvare
2016-09-13 15:30 ` Ilya Dryomov
2016-09-13 16:50 ` Jean Delvare
2016-09-13 18:31 ` Ilya Dryomov
2016-09-19 9:37 ` Jean Delvare
2016-09-12 18:45 ` [PATCH 04/47] block-rbd: Refactor two calls for memory allocations in rbd_dev_image_id() SF Markus Elfring
2016-09-13 8:03 ` Ilya Dryomov
2016-09-13 8:36 ` SF Markus Elfring
2016-09-12 18:46 ` [PATCH 05/47] block-rbd: One function call less in rbd_dev_image_id() after error detection SF Markus Elfring
2016-09-12 18:46 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations Joe Perches
2016-09-12 18:47 ` [PATCH 06/47] block-rbd: Rename jump labels in rbd_add_parse_args() SF Markus Elfring
2016-09-13 8:05 ` Ilya Dryomov
2016-09-12 18:48 ` [PATCH 07/47] block-rbd: Rename a jump label in rbd_dev_v2_snap_name() SF Markus Elfring
2016-09-12 18:49 ` [PATCH 08/47] block-rbd: Rename jump labels in rbd_dev_v2_snap_context() SF Markus Elfring
2016-09-12 18:50 ` [PATCH 09/47] block-rbd: Rename a jump label in rbd_spec_fill_names() SF Markus Elfring
2016-09-12 18:51 ` [PATCH 10/47] block-rbd: One function call less in rbd_dev_image_name() after error detection SF Markus Elfring
2016-09-12 18:54 ` [PATCH 11/47] block-rbd: Delete three unnecessary initialisations in rbd_dev_image_name() SF Markus Elfring
2016-09-12 18:57 ` [PATCH 12/47] block-rbd: One function call less in rbd_dev_v2_parent_info() after error detection SF Markus Elfring
2016-09-12 18:58 ` [PATCH 13/47] block-rbd: Delete an unnecessary initialisation in rbd_dev_v2_parent_info() SF Markus Elfring
2016-09-12 18:59 ` [PATCH 14/47] block-rbd: Rename a jump label in rbd_dev_v2_object_prefix() SF Markus Elfring
2016-09-12 19:00 ` [PATCH 15/47] block-rbd: Rename jump labels in rbd_dev_create() SF Markus Elfring
2016-09-13 8:07 ` Ilya Dryomov
2016-09-12 19:01 ` [PATCH 16/47] block-rbd: Rename jump labels in rbd_dev_v1_header_info() SF Markus Elfring
2016-09-12 19:03 ` [PATCH 17/47] block-rbd: Rename jump labels in rbd_init_disk() SF Markus Elfring
2016-09-12 19:04 ` [PATCH 18/47] block-rbd: Fix jump targets in rbd_queue_workfn() SF Markus Elfring
2016-09-12 19:05 ` [PATCH 19/47] block-rbd: Rename a jump label in rbd_reregister_watch() SF Markus Elfring
2016-09-12 19:06 ` [PATCH 20/47] block-rbd: Rename a jump label in rbd_register_watch() SF Markus Elfring
2016-09-12 19:07 ` [PATCH 21/47] block-rbd: Rename jump labels in rbd_try_lock() SF Markus Elfring
2016-09-12 19:08 ` [PATCH 22/47] block-rbd: Rename a jump label in find_watcher() SF Markus Elfring
2016-09-12 19:09 ` [PATCH 23/47] block-rbd: Rename jump labels in get_lock_owner_info() SF Markus Elfring
2016-09-12 19:10 ` [PATCH 24/47] block-rbd: Rename jump labels in rbd_request_lock() SF Markus Elfring
2016-09-12 19:11 ` [PATCH 25/47] block-rbd: Fix jump targets in rbd_img_parent_read() SF Markus Elfring
2016-09-12 19:12 ` [PATCH 26/47] block-rbd: Rename a jump label in rbd_img_parent_read_callback() SF Markus Elfring
2016-09-12 19:13 ` [PATCH 27/47] block-rbd: Rename a jump label in rbd_img_request_submit() SF Markus Elfring
2016-09-12 19:14 ` [PATCH 28/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_submit() SF Markus Elfring
2016-09-13 8:10 ` Ilya Dryomov
2016-09-12 19:15 ` [PATCH 29/47] block-rbd: Delete an unnecessary initialisation " SF Markus Elfring
2016-09-12 19:16 ` [PATCH 30/47] block-rbd: Refactor a jump target in rbd_img_obj_exists_callback() SF Markus Elfring
2016-09-12 19:18 ` [PATCH 31/47] block-rbd: Fix three jump targets in rbd_img_obj_parent_read_full() SF Markus Elfring
2016-09-12 19:20 ` [PATCH 32/47] block-rbd: Rename a jump label in rbd_img_obj_parent_read_full_callback() SF Markus Elfring
2016-09-12 19:22 ` [PATCH 33/47] block-rbd: Adjust the position of a jump label in rbd_img_request_fill() SF Markus Elfring
2016-09-12 19:23 ` [PATCH 34/47] block-rbd: Rename a jump label in rbd_img_obj_callback() SF Markus Elfring
2016-09-12 19:24 ` [PATCH 35/47] block-rbd: Rename jump labels in rbd_osd_req_create_copyup() SF Markus Elfring
2016-09-12 19:25 ` [PATCH 36/47] block-rbd: Rename jump labels in rbd_osd_req_create() SF Markus Elfring
2016-09-12 19:26 ` [PATCH 37/47] block-rbd: Rename a jump label in bio_chain_clone_range() SF Markus Elfring
2016-09-12 19:27 ` [PATCH 38/47] block-rbd: Rename jump labels in rbd_client_create() SF Markus Elfring
2016-09-12 19:28 ` [PATCH 39/47] block-rbd: Rename a jump label in rbd_ioctl_set_ro() SF Markus Elfring
2016-09-12 19:29 ` [PATCH 40/47] block-rbd: One function call less in rbd_dev_probe_parent() after error detection SF Markus Elfring
2016-09-12 19:30 ` [PATCH 41/47] block-rbd: Rename jump labels in rbd_dev_device_setup() SF Markus Elfring
2016-09-12 19:31 ` [PATCH 42/47] block-rbd: Rename jump labels in rbd_dev_image_probe() SF Markus Elfring
2016-09-12 19:32 ` [PATCH 43/47] block-rbd: Rename jump labels in do_rbd_add() SF Markus Elfring
2016-09-12 19:33 ` [PATCH 44/47] block-rbd: Delete an unnecessary initialisation " SF Markus Elfring
2016-09-12 19:34 ` [PATCH 45/47] block-rbd: Rename a jump label in rbd_slab_init() SF Markus Elfring
2016-09-12 19:35 ` [PATCH 46/47] block-rbd: Rename jump labels in rbd_init() SF Markus Elfring
2016-09-12 19:36 ` [PATCH 47/47] block-rbd: Delete unwanted spaces behind usages of the sizeof operator SF Markus Elfring
2017-08-13 19:10 ` [PATCH 00/47] RADOS Block Device: Fine-tuning for several function implementations SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox