summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-06-17 18:40:53 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-07-16 17:29:12 -0700
commitad67f0d9e63ca94661e06a145f05a9302368a826 (patch)
tree2ada5604a0f61fa1f933f29cd4674f0cb95595c6 /drivers/target/target_core_file.c
parent0c2ad7d1132d8b089b1d37875917858e03610019 (diff)
downloadblackbird-obmc-linux-ad67f0d9e63ca94661e06a145f05a9302368a826.tar.gz
blackbird-obmc-linux-ad67f0d9e63ca94661e06a145f05a9302368a826.zip
target: move sync_cache to struct spc_ops
Add spc_ops->execute_sync_cache() caller for ->execute_cmd() setup, and update IBLOCK + FILEIO backends to use it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_file.c')
-rw-r--r--drivers/target/target_core_file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 720ed59834fc..9e2100551c78 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -331,7 +331,7 @@ static int fd_do_writev(struct se_cmd *cmd, struct scatterlist *sgl,
return 1;
}
-static void fd_emulate_sync_cache(struct se_cmd *cmd)
+static int fd_execute_sync_cache(struct se_cmd *cmd)
{
struct se_device *dev = cmd->se_dev;
struct fd_dev *fd_dev = dev->dev_ptr;
@@ -365,7 +365,7 @@ static void fd_emulate_sync_cache(struct se_cmd *cmd)
pr_err("FILEIO: vfs_fsync_range() failed: %d\n", ret);
if (immed)
- return;
+ return 0;
if (ret) {
cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
@@ -373,6 +373,8 @@ static void fd_emulate_sync_cache(struct se_cmd *cmd)
} else {
target_complete_cmd(cmd, SAM_STAT_GOOD);
}
+
+ return 0;
}
static int fd_execute_rw(struct se_cmd *cmd)
@@ -554,6 +556,7 @@ static sector_t fd_get_blocks(struct se_device *dev)
static struct spc_ops fd_spc_ops = {
.execute_rw = fd_execute_rw,
+ .execute_sync_cache = fd_execute_sync_cache,
};
static int fd_parse_cdb(struct se_cmd *cmd)
@@ -573,7 +576,6 @@ static struct se_subsystem_api fileio_template = {
.create_virtdevice = fd_create_virtdevice,
.free_device = fd_free_device,
.parse_cdb = fd_parse_cdb,
- .do_sync_cache = fd_emulate_sync_cache,
.check_configfs_dev_params = fd_check_configfs_dev_params,
.set_configfs_dev_params = fd_set_configfs_dev_params,
.show_configfs_dev_params = fd_show_configfs_dev_params,
OpenPOWER on IntegriCloud