Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
[sfrench/cifs-2.6.git] / drivers / target / target_core_file.c
index e921948415c72bdcd7bde1c3b255c120d225f784..24cf11d9e50a5b457aae518e5e2c045705786a69 100644 (file)
@@ -236,6 +236,11 @@ static void fd_dev_call_rcu(struct rcu_head *p)
 }
 
 static void fd_free_device(struct se_device *dev)
+{
+       call_rcu(&dev->rcu_head, fd_dev_call_rcu);
+}
+
+static void fd_destroy_device(struct se_device *dev)
 {
        struct fd_dev *fd_dev = FD_DEV(dev);
 
@@ -243,7 +248,6 @@ static void fd_free_device(struct se_device *dev)
                filp_close(fd_dev->fd_file, NULL);
                fd_dev->fd_file = NULL;
        }
-       call_rcu(&dev->rcu_head, fd_dev_call_rcu);
 }
 
 static int fd_do_rw(struct se_cmd *cmd, struct file *fd,
@@ -826,6 +830,7 @@ static const struct target_backend_ops fileio_ops = {
        .detach_hba             = fd_detach_hba,
        .alloc_device           = fd_alloc_device,
        .configure_device       = fd_configure_device,
+       .destroy_device         = fd_destroy_device,
        .free_device            = fd_free_device,
        .parse_cdb              = fd_parse_cdb,
        .set_configfs_dev_params = fd_set_configfs_dev_params,