return 0;
}
-static int tcmu_netlink_event(enum tcmu_genl_cmd cmd, const char *name, int minor)
+static int tcmu_netlink_event(enum tcmu_genl_cmd cmd, const char *name,
+ int minor, int type)
{
struct sk_buff *skb;
void *msg_header;
if (ret < 0)
goto free_skb;
+ ret = nla_put_u32(skb, TCMU_ATTR_TYPE, type);
+ if (ret < 0)
+ goto free_skb;
+
genlmsg_end(skb, msg_header);
ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
kref_get(&udev->kref);
ret = tcmu_netlink_event(TCMU_CMD_ADDED_DEVICE, udev->uio_info.name,
- udev->uio_info.uio_dev->minor);
+ udev->uio_info.uio_dev->minor, NO_RECONFIG);
if (ret)
goto err_netlink;
if (tcmu_dev_configured(udev)) {
tcmu_netlink_event(TCMU_CMD_REMOVED_DEVICE, udev->uio_info.name,
- udev->uio_info.uio_dev->minor);
+ udev->uio_info.uio_dev->minor, NO_RECONFIG);
uio_unregister_device(&udev->uio_info);
}
if (tcmu_dev_configured(udev)) {
ret = tcmu_netlink_event(TCMU_CMD_RECONFIG_DEVICE,
udev->uio_info.name,
- udev->uio_info.uio_dev->minor);
+ udev->uio_info.uio_dev->minor,
+ CONFIG_PATH);
if (ret) {
pr_err("Unable to reconfigure device\n");
return ret;
if (tcmu_dev_configured(udev)) {
ret = tcmu_netlink_event(TCMU_CMD_RECONFIG_DEVICE,
udev->uio_info.name,
- udev->uio_info.uio_dev->minor);
+ udev->uio_info.uio_dev->minor,
+ CONFIG_SIZE);
if (ret) {
pr_err("Unable to reconfigure device\n");
return ret;
if (tcmu_dev_configured(udev)) {
ret = tcmu_netlink_event(TCMU_CMD_RECONFIG_DEVICE,
udev->uio_info.name,
- udev->uio_info.uio_dev->minor);
+ udev->uio_info.uio_dev->minor,
+ CONFIG_WRITECACHE);
if (ret) {
pr_err("Unable to reconfigure device\n");
return ret;