From 7f89e59b1ad226a147d6e59d1684b83c8239556e Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 19 May 2021 23:34:13 +0200 Subject: [PATCH] Remove CAS_FLUSH_SUPPORTED It's defined on every single supported kernel, so there is actually no need for this define at all. Signed-off-by: Robert Baldyga --- modules/cas_cache/volume/vol_atomic_dev_bottom.c | 13 ------------- modules/cas_cache/volume/vol_block_dev_bottom.c | 13 ------------- modules/cas_cache/volume/vol_block_dev_top.c | 2 -- 3 files changed, 28 deletions(-) diff --git a/modules/cas_cache/volume/vol_atomic_dev_bottom.c b/modules/cas_cache/volume/vol_atomic_dev_bottom.c index 82046a5..ef956e4 100644 --- a/modules/cas_cache/volume/vol_atomic_dev_bottom.c +++ b/modules/cas_cache/volume/vol_atomic_dev_bottom.c @@ -832,7 +832,6 @@ out: void cas_atomic_submit_flush(struct ocf_io *io) { -#ifdef CAS_FLUSH_SUPPORTED struct bd_object *bdobj = bd_object(ocf_io_get_volume(io)); struct block_device *bdev = bdobj->btm_bd; struct request_queue *q = bdev_get_queue(bdev); @@ -885,18 +884,6 @@ void cas_atomic_submit_flush(struct ocf_io *io) out: cas_atomic_end_atom(atom, blkio->error); -#else - /* Running operating system without support for REQ_FLUSH - * (i.e. SLES 11 SP 1) CAS cannot use flushing requests to handle - * power-fail safe Write-Back - */ - struct blkio *bdio = cas_io_to_blkio(io); - - io->end(io, -EINVAL); - /* on SLES 11 SP 1 powerfail safety can only be achieved through - * disabling volatile write cache of disk itself. - */ -#endif } void cas_atomic_submit_io(struct ocf_io *io) diff --git a/modules/cas_cache/volume/vol_block_dev_bottom.c b/modules/cas_cache/volume/vol_block_dev_bottom.c index dae8728..949b66e 100644 --- a/modules/cas_cache/volume/vol_block_dev_bottom.c +++ b/modules/cas_cache/volume/vol_block_dev_bottom.c @@ -229,7 +229,6 @@ CAS_DECLARE_BLOCK_CALLBACK(cas_bd_io_end, struct bio *bio, static void block_dev_submit_flush(struct ocf_io *io) { -#ifdef CAS_FLUSH_SUPPORTED struct blkio *blkio = cas_io_to_blkio(io); struct bd_object *bdobj = bd_object(ocf_io_get_volume(io)); struct block_device *bdev = bdobj->btm_bd; @@ -271,18 +270,6 @@ static void block_dev_submit_flush(struct ocf_io *io) out: cas_bd_io_end(io, blkio->error); - -#else - /* Running operating system without support for REQ_FLUSH - * (i.e. SLES 11 SP 1) CAS cannot use flushing requests to - * handle power-fail safe Write-Back - */ - io->end(io, -ENOTSUPP); - - /* on SLES 11 SP 1 powerfail safety can only be achieved - * through disabling volatile write cache of disk itself. - */ -#endif } void block_dev_submit_discard(struct ocf_io *io) diff --git a/modules/cas_cache/volume/vol_block_dev_top.c b/modules/cas_cache/volume/vol_block_dev_top.c index 4dae980..18e5cea 100644 --- a/modules/cas_cache/volume/vol_block_dev_top.c +++ b/modules/cas_cache/volume/vol_block_dev_top.c @@ -66,7 +66,6 @@ static inline int _blkdev_can_hndl_bio(struct bio *bio) void _blockdev_set_exported_object_flush_fua(ocf_core_t core) { -#ifdef CAS_FLUSH_SUPPORTED ocf_cache_t cache = ocf_core_get_cache(core); ocf_volume_t core_vol = ocf_core_get_volume(core); ocf_volume_t cache_vol = ocf_cache_get_volume(cache); @@ -87,7 +86,6 @@ void _blockdev_set_exported_object_flush_fua(ocf_core_t core) fua = (CAS_CHECK_QUEUE_FUA(core_q) || CAS_CHECK_QUEUE_FUA(cache_q)); cas_set_queue_flush_fua(exp_q, flush, fua); -#endif } static void _blockdev_set_discard_properties(ocf_cache_t cache,