From: Mike Christie <mchristi@redhat.com>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH 5/6] tcmu: refactor nl dev_size attr with new helpers
Date: Thu, 19 Apr 2018 00:15:06 +0000 [thread overview]
Message-ID: <5AD7DF8A.2070309@redhat.com> (raw)
In-Reply-To: <20180416110428.5273-5-lszhu@suse.com>
On 04/16/2018 06:04 AM, Zhu Lingshan wrote:
> use new netlink events helpers tcmu_netlink_init() and
> tcmu_netlink_send() to refactor netlink event attribute
> TCMU_ATTR_DEV_SIZE(belongs to TCMU_CMD_RECONFIG_DEVICE)
> which is also dev_size in configFS.
>
> Signed-off-by: Zhu Lingshan <lszhu@suse.com>
> ---
> drivers/target/target_core_user.c | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index f98b986e6d50..d913fb15f1b4 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -2300,6 +2300,27 @@ static ssize_t tcmu_dev_size_show(struct config_item *item, char *page)
> return snprintf(page, PAGE_SIZE, "%zu\n", udev->dev_size);
> }
>
> +static int tcmu_send_dev_size_event(struct tcmu_dev *udev, u64 size)
> +{
> + struct sk_buff *skb = NULL;
> + void *msg_header = NULL;
> + int ret = 0;
> +
> + ret = tcmu_netlink_event_init(udev, TCMU_CMD_RECONFIG_DEVICE,
> + &skb, &msg_header);
> + if (ret < 0)
> + return ret;
> + ret = nla_put_u64_64bit(skb, TCMU_ATTR_DEV_SIZE,
> + size, TCMU_ATTR_PAD);
> + if (ret < 0) {
> + nlmsg_free(skb);
> + return ret;
> + }
> + ret = tcmu_netlink_event_send(udev, TCMU_CMD_RECONFIG_DEVICE,
> + &skb, &msg_header);
You need to tab/space this over to match the other style.
next prev parent reply other threads:[~2018-04-19 0:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 11:04 [PATCH 5/6] tcmu: refactor nl dev_size attr with new helpers Zhu Lingshan
2018-04-19 0:15 ` Mike Christie [this message]
2018-04-19 9:47 ` Zhu Lingshan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5AD7DF8A.2070309@redhat.com \
--to=mchristi@redhat.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.