Skip to content

Commit efc3e6a

Browse files
Stefan Roeschakpm00
Stefan Roesch
authored andcommitted
mm: split off __bdi_set_max_ratio() function
This splits off __bdi_set_max_ratio() from bdi_set_max_ratio(). __bdi_set_max_ratio() will also be called from bdi_set_max_bytes(), which will be introduced in the next patch. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stefan Roesch <[email protected]> Cc: Chris Mason <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 00df7d5 commit efc3e6a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

mm/page-writeback.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -692,14 +692,10 @@ int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio)
692692
return ret;
693693
}
694694

695-
int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned max_ratio)
695+
static int __bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio)
696696
{
697697
int ret = 0;
698698

699-
if (max_ratio > 100)
700-
return -EINVAL;
701-
max_ratio *= BDI_RATIO_SCALE;
702-
703699
spin_lock_bh(&bdi_lock);
704700
if (bdi->min_ratio > max_ratio) {
705701
ret = -EINVAL;
@@ -711,6 +707,14 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned max_ratio)
711707

712708
return ret;
713709
}
710+
711+
int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio)
712+
{
713+
if (max_ratio > 100)
714+
return -EINVAL;
715+
716+
return __bdi_set_max_ratio(bdi, max_ratio * BDI_RATIO_SCALE);
717+
}
714718
EXPORT_SYMBOL(bdi_set_max_ratio);
715719

716720
u64 bdi_get_max_bytes(struct backing_dev_info *bdi)

0 commit comments

Comments
 (0)