if: adapt to renamed congestion handling (kernel 4.2)

This commit is contained in:
Thomas Schoebel-Theuer 2015-08-19 12:50:59 +02:00
parent 275cc2a195
commit d04e8e23c4
1 changed files with 12 additions and 0 deletions

View File

@ -771,6 +771,17 @@ int mars_congested(void *data, int bdi_bits)
{
struct if_input *input = data;
int ret = 0;
#ifdef WB_STAT_BATCH /* changed by 4452226ea276e74fc3e252c88d9bb7e8f8e44bf0 */
if (bdi_bits & (1 << WB_sync_congested) &&
atomic_read(&input->read_flying_count) > 0) {
ret |= (1 << WB_sync_congested);
}
if (bdi_bits & (1 << WB_async_congested) &&
atomic_read(&input->write_flying_count) > 0) {
ret |= (1 << WB_async_congested);
}
#else /* old code */
if (bdi_bits & (1 << BDI_sync_congested) &&
atomic_read(&input->read_flying_count) > 0) {
ret |= (1 << BDI_sync_congested);
@ -779,6 +790,7 @@ int mars_congested(void *data, int bdi_bits)
atomic_read(&input->write_flying_count) > 0) {
ret |= (1 << BDI_async_congested);
}
#endif
return ret;
}