fs: configfs: don't return anything from drop_link

Documentation/filesystems/configfs/configfs.txt says:

"When unlink(2) is called on the symbolic link, the source item is
notified via the ->drop_link() method.  Like the ->drop_item() method,
this is a void function and cannot return failure."

The ->drop_item() is indeed a void function, the ->drop_link() is
actually not. This, together with the fact that the value of ->drop_link()
is silently ignored suggests, that it is the ->drop_link() return
type that should be corrected and changed to void.

This patch changes drop_link() signature and all its users.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
[hch: reverted reformatting of some code]
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Andrzej Pietrasiewicz
2016-11-28 13:22:42 +01:00
committed by Christoph Hellwig
parent e5517c2a5a
commit e16769d4bc
6 changed files with 17 additions and 37 deletions

View File

@@ -466,7 +466,7 @@ out_free_link:
return ret;
}
static int nvmet_port_subsys_drop_link(struct config_item *parent,
static void nvmet_port_subsys_drop_link(struct config_item *parent,
struct config_item *target)
{
struct nvmet_port *port = to_nvmet_port(parent->ci_parent);
@@ -479,7 +479,7 @@ static int nvmet_port_subsys_drop_link(struct config_item *parent,
goto found;
}
up_write(&nvmet_config_sem);
return -EINVAL;
return;
found:
list_del(&p->entry);
@@ -488,7 +488,6 @@ found:
nvmet_disable_port(port);
up_write(&nvmet_config_sem);
kfree(p);
return 0;
}
static struct configfs_item_operations nvmet_port_subsys_item_ops = {
@@ -542,7 +541,7 @@ out_free_link:
return ret;
}
static int nvmet_allowed_hosts_drop_link(struct config_item *parent,
static void nvmet_allowed_hosts_drop_link(struct config_item *parent,
struct config_item *target)
{
struct nvmet_subsys *subsys = to_subsys(parent->ci_parent);
@@ -555,14 +554,13 @@ static int nvmet_allowed_hosts_drop_link(struct config_item *parent,
goto found;
}
up_write(&nvmet_config_sem);
return -EINVAL;
return;
found:
list_del(&p->entry);
nvmet_genctr++;
up_write(&nvmet_config_sem);
kfree(p);
return 0;
}
static struct configfs_item_operations nvmet_allowed_hosts_item_ops = {