mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
writeback: use RCU to protect bdi_list
Now that bdi_writeback_all() no longer handles integrity writeback, it doesn't have to block anymore. This means that we can switch bdi_list reader side protection to RCU. Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
f11fcae840
commit
cfc4ba5365
4 changed files with 63 additions and 28 deletions
|
|
@ -315,7 +315,7 @@ int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio)
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
spin_lock(&bdi_lock);
|
||||
spin_lock_bh(&bdi_lock);
|
||||
if (min_ratio > bdi->max_ratio) {
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
|
|
@ -327,7 +327,7 @@ int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio)
|
|||
ret = -EINVAL;
|
||||
}
|
||||
}
|
||||
spin_unlock(&bdi_lock);
|
||||
spin_unlock_bh(&bdi_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -339,14 +339,14 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned max_ratio)
|
|||
if (max_ratio > 100)
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock(&bdi_lock);
|
||||
spin_lock_bh(&bdi_lock);
|
||||
if (bdi->min_ratio > max_ratio) {
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
bdi->max_ratio = max_ratio;
|
||||
bdi->max_prop_frac = (PROP_FRAC_BASE * max_ratio) / 100;
|
||||
}
|
||||
spin_unlock(&bdi_lock);
|
||||
spin_unlock_bh(&bdi_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue