summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/target_core_file.c')
-rw-r--r--drivers/target/target_core_file.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 238e3a256d04..ced8c4fdc23d 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -475,9 +475,9 @@ fd_do_prot_unmap(struct se_cmd *cmd, sector_t lba, sector_t nolb)
}
static sense_reason_t
-fd_do_unmap(struct se_cmd *cmd, void *priv, sector_t lba, sector_t nolb)
+fd_execute_unmap(struct se_cmd *cmd, sector_t lba, sector_t nolb)
{
- struct file *file = priv;
+ struct file *file = FD_DEV(cmd->se_dev)->fd_file;
struct inode *inode = file->f_mapping->host;
int ret;
@@ -521,9 +521,6 @@ fd_do_unmap(struct se_cmd *cmd, void *priv, sector_t lba, sector_t nolb)
static sense_reason_t
fd_execute_write_same_unmap(struct se_cmd *cmd)
{
- struct se_device *se_dev = cmd->se_dev;
- struct fd_dev *fd_dev = FD_DEV(se_dev);
- struct file *file = fd_dev->fd_file;
sector_t lba = cmd->t_task_lba;
sector_t nolb = sbc_get_write_same_sectors(cmd);
sense_reason_t ret;
@@ -533,7 +530,7 @@ fd_execute_write_same_unmap(struct se_cmd *cmd)
return 0;
}
- ret = fd_do_unmap(cmd, file, lba, nolb);
+ ret = fd_execute_unmap(cmd, lba, nolb);
if (ret)
return ret;
@@ -542,14 +539,6 @@ fd_execute_write_same_unmap(struct se_cmd *cmd)
}
static sense_reason_t
-fd_execute_unmap(struct se_cmd *cmd)
-{
- struct file *file = FD_DEV(cmd->se_dev)->fd_file;
-
- return sbc_execute_unmap(cmd, fd_do_unmap, file);
-}
-
-static sense_reason_t
fd_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
enum dma_data_direction data_direction)
{