configure: refactor cas_copy_queue_limits()
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
33721e7c92
commit
853e8f9357
@ -11,6 +11,7 @@
|
||||
check() {
|
||||
cur_name=$(basename $2)
|
||||
config_file_path=$1
|
||||
|
||||
if compile_module $cur_name "struct queue_limits q; q.limits_aux;" "linux/blkdev.h"
|
||||
then
|
||||
echo $cur_name "1" >> $config_file_path
|
||||
@ -35,13 +36,13 @@ apply() {
|
||||
"1")
|
||||
add_function "
|
||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||
struct request_queue *cache_q, struct request_queue *core_q)
|
||||
struct queue_limits *cache_q_limits, struct request_queue *core_q)
|
||||
{
|
||||
struct queue_limits_aux *l_aux = exp_q->limits.limits_aux;
|
||||
exp_q->limits = cache_q->limits;
|
||||
exp_q->limits = *cache_q_limits;
|
||||
exp_q->limits.limits_aux = l_aux;
|
||||
if (exp_q->limits.limits_aux && cache_q->limits.limits_aux)
|
||||
*exp_q->limits.limits_aux = *cache_q->limits.limits_aux;
|
||||
if (exp_q->limits.limits_aux && cache_q_limits->limits_aux)
|
||||
*exp_q->limits.limits_aux = *cache_q_limits->limits_aux;
|
||||
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
||||
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
||||
exp_q->limits.max_segments = core_q->limits.max_segments;
|
||||
@ -57,9 +58,9 @@ apply() {
|
||||
"2")
|
||||
add_function "
|
||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||
struct request_queue *cache_q, struct request_queue *core_q)
|
||||
struct queue_limits *cache_q_limits, struct request_queue *core_q)
|
||||
{
|
||||
exp_q->limits = cache_q->limits;
|
||||
exp_q->limits = *cache_q_limits;
|
||||
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
||||
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
||||
exp_q->limits.max_segments = core_q->limits.max_segments;
|
||||
@ -74,9 +75,9 @@ apply() {
|
||||
"3")
|
||||
add_function "
|
||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||
struct request_queue *cache_q, struct request_queue *core_q)
|
||||
struct queue_limits *cache_q_limits, struct request_queue *core_q)
|
||||
{
|
||||
exp_q->limits = cache_q->limits;
|
||||
exp_q->limits = *cache_q_limits;
|
||||
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
||||
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
||||
exp_q->limits.max_segments = core_q->limits.max_segments;
|
||||
@ -90,9 +91,9 @@ apply() {
|
||||
"4")
|
||||
add_function "
|
||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||
struct request_queue *cache_q, struct request_queue *core_q)
|
||||
struct queue_limits *cache_q_limits, struct request_queue *core_q)
|
||||
{
|
||||
exp_q->limits = cache_q->limits;
|
||||
exp_q->limits = *cache_q_limits;
|
||||
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
||||
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
||||
exp_q->limits.max_segments = core_q->limits.max_segments;
|
||||
|
@ -122,7 +122,7 @@ static int blkdev_core_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, core_q);
|
||||
cas_copy_queue_limits(exp_q, &cache_q->limits, core_q);
|
||||
|
||||
if (exp_q->limits.logical_block_size >
|
||||
core_q->limits.logical_block_size) {
|
||||
@ -469,7 +469,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_copy_queue_limits(exp_q, &cache_q->limits, cache_q);
|
||||
cas_cache_set_no_merges_flag(cache_q);
|
||||
|
||||
blk_stack_limits(&exp_q->limits, &cache_q->limits, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user