Skip to content

Commit

Permalink
writeback: remove {set,clear}_wb_congested
Browse files Browse the repository at this point in the history
Just merge them into their only callers.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Jul 8, 2020
1 parent d5c6983 commit 492d76b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
14 changes: 2 additions & 12 deletions include/linux/backing-dev-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,8 @@ enum {
BLK_RW_SYNC = 1,
};

void clear_wb_congested(struct bdi_writeback_congested *congested, int sync);
void set_wb_congested(struct bdi_writeback_congested *congested, int sync);

static inline void clear_bdi_congested(struct backing_dev_info *bdi, int sync)
{
clear_wb_congested(bdi->wb.congested, sync);
}

static inline void set_bdi_congested(struct backing_dev_info *bdi, int sync)
{
set_wb_congested(bdi->wb.congested, sync);
}
void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
void set_bdi_congested(struct backing_dev_info *bdi, int sync);

struct wb_lock_cookie {
bool locked;
Expand Down
12 changes: 6 additions & 6 deletions mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,29 +1047,29 @@ static wait_queue_head_t congestion_wqh[2] = {
};
static atomic_t nr_wb_congested[2];

void clear_wb_congested(struct bdi_writeback_congested *congested, int sync)
void clear_bdi_congested(struct backing_dev_info *bdi, int sync)
{
wait_queue_head_t *wqh = &congestion_wqh[sync];
enum wb_congested_state bit;

bit = sync ? WB_sync_congested : WB_async_congested;
if (test_and_clear_bit(bit, &congested->state))
if (test_and_clear_bit(bit, &bdi->wb.congested->state))
atomic_dec(&nr_wb_congested[sync]);
smp_mb__after_atomic();
if (waitqueue_active(wqh))
wake_up(wqh);
}
EXPORT_SYMBOL(clear_wb_congested);
EXPORT_SYMBOL(clear_bdi_congested);

void set_wb_congested(struct bdi_writeback_congested *congested, int sync)
void set_bdi_congested(struct backing_dev_info *bdi, int sync)
{
enum wb_congested_state bit;

bit = sync ? WB_sync_congested : WB_async_congested;
if (!test_and_set_bit(bit, &congested->state))
if (!test_and_set_bit(bit, &bdi->wb.congested->state))
atomic_inc(&nr_wb_congested[sync]);
}
EXPORT_SYMBOL(set_wb_congested);
EXPORT_SYMBOL(set_bdi_congested);

/**
* congestion_wait - wait for a backing_dev to become uncongested
Expand Down

0 comments on commit 492d76b

Please sign in to comment.