Skip to content

Commit 712c00d

Browse files
Stefan Roeschakpm00
authored andcommitted
mm: add bdi_get_min_bytes() function
This adds a function to return the specified value for min_bytes. It converts the stored min_ratio of the bdi to the corresponding bytes value. This is an approximation as it is based on the value that is returned by global_dirty_limits(), which can change. The returned value can be different than the value when the min_bytes value was set. 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 c354d92 commit 712c00d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/linux/backing-dev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ static inline unsigned long wb_stat_error(void)
105105
/* BDI ratio is expressed as part per 1000000 for finer granularity. */
106106
#define BDI_RATIO_SCALE 10000
107107

108+
u64 bdi_get_min_bytes(struct backing_dev_info *bdi);
108109
u64 bdi_get_max_bytes(struct backing_dev_info *bdi);
109110
int bdi_set_min_ratio(struct backing_dev_info *bdi, unsigned int min_ratio);
110111
int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);

mm/page-writeback.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,11 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio)
740740
}
741741
EXPORT_SYMBOL(bdi_set_max_ratio);
742742

743+
u64 bdi_get_min_bytes(struct backing_dev_info *bdi)
744+
{
745+
return bdi_get_bytes(bdi->min_ratio);
746+
}
747+
743748
u64 bdi_get_max_bytes(struct backing_dev_info *bdi)
744749
{
745750
return bdi_get_bytes(bdi->max_ratio);

0 commit comments

Comments
 (0)