diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2014-11-10 11:21:10 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-11-10 11:27:33 -0500 |
commit | f221f4bcc5f40e2967e4596ef167bdbc987c8e9d (patch) | |
tree | f84f73ca4d3d4b3b4e1139107808078fff311fde /drivers/block/drbd | |
parent | 179e20b8df97e0c7541a1bae30cad53ecc7a5e86 (diff) |
drbd: Only use drbd_msg_put_info() in drbd_nl.c
Avoid generic netlink calls in other parts of the code base.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 1 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 17 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 2 |
3 files changed, 4 insertions, 16 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index c14b718c2fab..d2a7589c4bca 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -1454,7 +1454,6 @@ extern int is_valid_ar_handle(struct drbd_request *, sector_t); | |||
1454 | 1454 | ||
1455 | 1455 | ||
1456 | /* drbd_nl.c */ | 1456 | /* drbd_nl.c */ |
1457 | extern int drbd_msg_put_info(struct sk_buff *skb, const char *info); | ||
1458 | extern void drbd_suspend_io(struct drbd_device *device); | 1457 | extern void drbd_suspend_io(struct drbd_device *device); |
1459 | extern void drbd_resume_io(struct drbd_device *device); | 1458 | extern void drbd_resume_io(struct drbd_device *device); |
1460 | extern char *ppsize(char *buf, unsigned long long size); | 1459 | extern char *ppsize(char *buf, unsigned long long size); |
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index cce25a5eb157..1fc83427199c 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2532,10 +2532,6 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op | |||
2532 | 2532 | ||
2533 | if (!zalloc_cpumask_var(&new_cpu_mask, GFP_KERNEL)) | 2533 | if (!zalloc_cpumask_var(&new_cpu_mask, GFP_KERNEL)) |
2534 | return -ENOMEM; | 2534 | return -ENOMEM; |
2535 | /* | ||
2536 | retcode = ERR_NOMEM; | ||
2537 | drbd_msg_put_info("unable to allocate cpumask"); | ||
2538 | */ | ||
2539 | 2535 | ||
2540 | /* silently ignore cpu mask on UP kernel */ | 2536 | /* silently ignore cpu mask on UP kernel */ |
2541 | if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) { | 2537 | if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) { |
@@ -2793,20 +2789,16 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig | |||
2793 | 2789 | ||
2794 | id = idr_alloc(&drbd_devices, device, minor, minor + 1, GFP_KERNEL); | 2790 | id = idr_alloc(&drbd_devices, device, minor, minor + 1, GFP_KERNEL); |
2795 | if (id < 0) { | 2791 | if (id < 0) { |
2796 | if (id == -ENOSPC) { | 2792 | if (id == -ENOSPC) |
2797 | err = ERR_MINOR_OR_VOLUME_EXISTS; | 2793 | err = ERR_MINOR_OR_VOLUME_EXISTS; |
2798 | drbd_msg_put_info(adm_ctx->reply_skb, "requested minor exists already"); | ||
2799 | } | ||
2800 | goto out_no_minor_idr; | 2794 | goto out_no_minor_idr; |
2801 | } | 2795 | } |
2802 | kref_get(&device->kref); | 2796 | kref_get(&device->kref); |
2803 | 2797 | ||
2804 | id = idr_alloc(&resource->devices, device, vnr, vnr + 1, GFP_KERNEL); | 2798 | id = idr_alloc(&resource->devices, device, vnr, vnr + 1, GFP_KERNEL); |
2805 | if (id < 0) { | 2799 | if (id < 0) { |
2806 | if (id == -ENOSPC) { | 2800 | if (id == -ENOSPC) |
2807 | err = ERR_MINOR_OR_VOLUME_EXISTS; | 2801 | err = ERR_MINOR_OR_VOLUME_EXISTS; |
2808 | drbd_msg_put_info(adm_ctx->reply_skb, "requested minor exists already"); | ||
2809 | } | ||
2810 | goto out_idr_remove_minor; | 2802 | goto out_idr_remove_minor; |
2811 | } | 2803 | } |
2812 | kref_get(&device->kref); | 2804 | kref_get(&device->kref); |
@@ -2825,10 +2817,8 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig | |||
2825 | 2817 | ||
2826 | id = idr_alloc(&connection->peer_devices, peer_device, vnr, vnr + 1, GFP_KERNEL); | 2818 | id = idr_alloc(&connection->peer_devices, peer_device, vnr, vnr + 1, GFP_KERNEL); |
2827 | if (id < 0) { | 2819 | if (id < 0) { |
2828 | if (id == -ENOSPC) { | 2820 | if (id == -ENOSPC) |
2829 | err = ERR_INVALID_REQUEST; | 2821 | err = ERR_INVALID_REQUEST; |
2830 | drbd_msg_put_info(adm_ctx->reply_skb, "requested volume exists already"); | ||
2831 | } | ||
2832 | goto out_idr_remove_from_resource; | 2822 | goto out_idr_remove_from_resource; |
2833 | } | 2823 | } |
2834 | kref_get(&connection->kref); | 2824 | kref_get(&connection->kref); |
@@ -2836,7 +2826,6 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig | |||
2836 | 2826 | ||
2837 | if (init_submitter(device)) { | 2827 | if (init_submitter(device)) { |
2838 | err = ERR_NOMEM; | 2828 | err = ERR_NOMEM; |
2839 | drbd_msg_put_info(adm_ctx->reply_skb, "unable to create submit workqueue"); | ||
2840 | goto out_idr_remove_vol; | 2829 | goto out_idr_remove_vol; |
2841 | } | 2830 | } |
2842 | 2831 | ||
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index c145619f1ccb..4782d074c8cd 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -92,7 +92,7 @@ static void drbd_adm_send_reply(struct sk_buff *skb, struct genl_info *info) | |||
92 | 92 | ||
93 | /* Used on a fresh "drbd_adm_prepare"d reply_skb, this cannot fail: The only | 93 | /* Used on a fresh "drbd_adm_prepare"d reply_skb, this cannot fail: The only |
94 | * reason it could fail was no space in skb, and there are 4k available. */ | 94 | * reason it could fail was no space in skb, and there are 4k available. */ |
95 | int drbd_msg_put_info(struct sk_buff *skb, const char *info) | 95 | static int drbd_msg_put_info(struct sk_buff *skb, const char *info) |
96 | { | 96 | { |
97 | struct nlattr *nla; | 97 | struct nlattr *nla; |
98 | int err = -EMSGSIZE; | 98 | int err = -EMSGSIZE; |