mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-15 02:57:49 +00:00
tcmu: add helper to check if dev was configured
This adds a helper to check if the dev was configured. It will be used in the next patch to prevent updates to some config settings after the device has been setup. Signed-off-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
760bf578ed
commit
972c7f1679
1 changed files with 6 additions and 2 deletions
|
@ -998,6 +998,11 @@ static void tcmu_dev_call_rcu(struct rcu_head *p)
|
||||||
kfree(udev);
|
kfree(udev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool tcmu_dev_configured(struct tcmu_dev *udev)
|
||||||
|
{
|
||||||
|
return udev->uio_info.uio_dev ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
static void tcmu_free_device(struct se_device *dev)
|
static void tcmu_free_device(struct se_device *dev)
|
||||||
{
|
{
|
||||||
struct tcmu_dev *udev = TCMU_DEV(dev);
|
struct tcmu_dev *udev = TCMU_DEV(dev);
|
||||||
|
@ -1019,8 +1024,7 @@ static void tcmu_free_device(struct se_device *dev)
|
||||||
spin_unlock_irq(&udev->commands_lock);
|
spin_unlock_irq(&udev->commands_lock);
|
||||||
WARN_ON(!all_expired);
|
WARN_ON(!all_expired);
|
||||||
|
|
||||||
/* Device was configured */
|
if (tcmu_dev_configured(udev)) {
|
||||||
if (udev->uio_info.uio_dev) {
|
|
||||||
tcmu_netlink_event(TCMU_CMD_REMOVED_DEVICE, udev->uio_info.name,
|
tcmu_netlink_event(TCMU_CMD_REMOVED_DEVICE, udev->uio_info.name,
|
||||||
udev->uio_info.uio_dev->minor);
|
udev->uio_info.uio_dev->minor);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue