diff --git a/configure b/configure index 1a9a661..92642c6 100755 --- a/configure +++ b/configure @@ -66,3 +66,41 @@ kernel_not_supp_fail() { } rm -f $DEFINE_FILE + +compile_module "part_round_stats(1, 1)" "linux/genhd.h" +if [ $? -eq 0 ]; then + add_define "CAS_PART_ROUND_STATS(q, cpu, part) part_round_stats(cpu, part)" +else + compile_module "part_round_stats(NULL, 1, 1)" "linux/genhd.h" + if [ $? -eq 0 ]; then + add_define "CAS_PART_ROUND_STATS(q, cpu, part)\\"\ + "\tpart_round_stats(q, cpu, part)" + fi +fi + + +compile_module "part_inc_in_flight(1, 1)" "linux/genhd.h" +if [ $? -eq 0 ]; then + add_define "CAS_PART_INC_IN_FLIGHT(q, cpu, part)\\"\ + "\tpart_inc_in_flight(cpu, part)" +else + compile_module "part_inc_in_flight(NULL, 1, 1)" "linux/genhd.h" + if [ $? -eq 0 ]; then + add_define "CAS_PART_INC_IN_FLIGHT(q, cpu, part)\\"\ + "\tpart_inc_in_flight(q, cpu, part)" + fi +fi + + +compile_module "part_dec_in_flight(1, 1)" "linux/genhd.h" +if [ $? -eq 0 ]; then + add_define "CAS_PART_DEC_IN_FLIGHT(q, cpu, part)\\"\ + "\tpart_dec_in_flight(cpu, part)" +else + compile_module "part_dec_in_flight(NULL, 1, 1)" "linux/genhd.h" + if [ $? -eq 0 ]; then + add_define "CAS_PART_DEC_IN_FLIGHT(q, cpu, part)\\"\ + "\tpart_dec_in_flight(q, cpu, part)" + fi +fi + diff --git a/modules/cas_cache/linux_kernel_version.h b/modules/cas_cache/linux_kernel_version.h index 57fd6cb..aecbc87 100644 --- a/modules/cas_cache/linux_kernel_version.h +++ b/modules/cas_cache/linux_kernel_version.h @@ -505,10 +505,10 @@ static inline void cas_generic_start_io_acct(struct request_queue *q, { int cpu = part_stat_lock(); - part_round_stats(cpu, part); + CAS_PART_ROUND_STATS(q, cpu, part); part_stat_inc(cpu, part, ios[rw]); part_stat_add(cpu, part, sectors[rw], sectors); - part_inc_in_flight(part, rw); + CAS_PART_INC_IN_FLIGHT(q, part, rw); part_stat_unlock(); } @@ -520,8 +520,8 @@ static inline void cas_generic_end_io_acct(struct request_queue *q, int cpu = part_stat_lock(); part_stat_add(cpu, part, ticks[rw], duration); - part_round_stats(cpu, part); - part_dec_in_flight(part, rw); + CAS_PART_ROUND_STATS(q, cpu, part); + CAS_PART_DEC_IN_FLIGHT(q, part, rw); part_stat_unlock(); }