Set NOMERGES flag for cache volume
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com> Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
This commit is contained in:

committed by
Rafal Stefanowski

parent
20276bd9c1
commit
33721e7c92
@@ -2202,6 +2202,24 @@ out_bdev:
|
||||
return result;
|
||||
}
|
||||
|
||||
static void volume_set_no_merges_flag_helper(ocf_cache_t cache)
|
||||
{
|
||||
struct request_queue *cache_q;
|
||||
struct bd_object *bvol;
|
||||
struct block_device *bd;
|
||||
ocf_volume_t volume;
|
||||
|
||||
volume = ocf_cache_get_volume(cache);
|
||||
if (!volume)
|
||||
return;
|
||||
|
||||
bvol = bd_object(volume);
|
||||
bd = cas_disk_get_blkdev(bvol->dsk);
|
||||
cache_q = bd->bd_disk->queue;
|
||||
|
||||
cas_cache_set_no_merges_flag(cache_q);
|
||||
}
|
||||
|
||||
static int _cache_start_finalize(ocf_cache_t cache, int init_mode,
|
||||
bool activate)
|
||||
{
|
||||
@@ -2219,6 +2237,8 @@ static int _cache_start_finalize(ocf_cache_t cache, int init_mode,
|
||||
return result;
|
||||
}
|
||||
ctx->cls_inited = true;
|
||||
|
||||
volume_set_no_merges_flag_helper(cache);
|
||||
}
|
||||
|
||||
if (activate)
|
||||
|
@@ -470,6 +470,7 @@ static int blkdev_cache_set_geometry(struct cas_disk *dsk, void *private)
|
||||
set_capacity(cas_exp_obj_get_gendisk(dsk), sectors);
|
||||
|
||||
cas_copy_queue_limits(exp_q, cache_q, cache_q);
|
||||
cas_cache_set_no_merges_flag(cache_q);
|
||||
|
||||
blk_stack_limits(&exp_q->limits, &cache_q->limits, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user