summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_iblock.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-06-21 11:33:12 -0700
commit9b594ae2882a7127aaa80509688c5dc9a46f826f (patch)
tree85c9324d60e7bdcf64946f46a85b011442ef6399 /drivers/target/target_core_iblock.c
parentb02c2cf1a1975100963905b9d731656e9a05bd48 (diff)
downloadlinux-9b594ae2882a7127aaa80509688c5dc9a46f826f.tar.gz
linux-9b594ae2882a7127aaa80509688c5dc9a46f826f.tar.xz
linux-9b594ae2882a7127aaa80509688c5dc9a46f826f.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_iblock.c')
-rw-r--r--drivers/target/target_core_iblock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index eb94367380c1..863c962e5021 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -296,7 +296,7 @@ static void iblock_end_io_flush(struct bio *bio, int err)
* Implement SYCHRONIZE CACHE. Note that we can't handle lba ranges and must
* always flush the whole cache.
*/
-static void iblock_emulate_sync_cache(struct se_cmd *cmd)
+static int iblock_execute_sync_cache(struct se_cmd *cmd)
{
struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr;
int immed = (cmd->t_task_cdb[1] & 0x2);
@@ -315,6 +315,7 @@ static void iblock_emulate_sync_cache(struct se_cmd *cmd)
if (!immed)
bio->bi_private = cmd;
submit_bio(WRITE_FLUSH, bio);
+ return 0;
}
static int iblock_do_discard(struct se_device *dev, sector_t lba, u32 range)
@@ -667,6 +668,7 @@ static void iblock_bio_done(struct bio *bio, int err)
static struct spc_ops iblock_spc_ops = {
.execute_rw = iblock_execute_rw,
+ .execute_sync_cache = iblock_execute_sync_cache,
};
static int iblock_parse_cdb(struct se_cmd *cmd)
@@ -687,7 +689,6 @@ static struct se_subsystem_api iblock_template = {
.free_device = iblock_free_device,
.parse_cdb = iblock_parse_cdb,
.do_discard = iblock_do_discard,
- .do_sync_cache = iblock_emulate_sync_cache,
.check_configfs_dev_params = iblock_check_configfs_dev_params,
.set_configfs_dev_params = iblock_set_configfs_dev_params,
.show_configfs_dev_params = iblock_show_configfs_dev_params,