Skip to content

Commit

Permalink
bdi: use bdi_dev_name() to get device name
Browse files Browse the repository at this point in the history
[ Upstream commit d51cfc53ade3189455a1b88ec7a2ff0c24597cf8 ]

Use the common interface bdi_dev_name() to get device name.

Signed-off-by: Yufen Yu <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>

Add missing <linux/backing-dev.h> include BFQ

Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Yufen Yu authored and gregkh committed Aug 8, 2021
1 parent 0129d76 commit 19a845e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
#include <linux/ioprio.h>
#include <linux/sbitmap.h>
#include <linux/delay.h>
#include <linux/backing-dev.h>

#include "blk.h"
#include "blk-mq.h"
Expand Down Expand Up @@ -4212,8 +4213,9 @@ bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic)
ioprio_class = IOPRIO_PRIO_CLASS(bic->ioprio);
switch (ioprio_class) {
default:
dev_err(bfqq->bfqd->queue->backing_dev_info->dev,
"bfq: bad prio class %d\n", ioprio_class);
pr_err("bdi %s: bfq: bad prio class %d\n",
bdi_dev_name(bfqq->bfqd->queue->backing_dev_info),
ioprio_class);
/* fall through */
case IOPRIO_CLASS_NONE:
/*
Expand Down
2 changes: 1 addition & 1 deletion block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ const char *blkg_dev_name(struct blkcg_gq *blkg)
{
/* some drivers (floppy) instantiate a queue w/o disk registered */
if (blkg->q->backing_dev_info->dev)
return dev_name(blkg->q->backing_dev_info->dev);
return bdi_dev_name(blkg->q->backing_dev_info);
return NULL;
}
EXPORT_SYMBOL_GPL(blkg_dev_name);
Expand Down
2 changes: 1 addition & 1 deletion fs/ceph/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
goto out;

snprintf(name, sizeof(name), "../../bdi/%s",
dev_name(fsc->sb->s_bdi->dev));
bdi_dev_name(fsc->sb->s_bdi));
fsc->debugfs_bdi =
debugfs_create_symlink("bdi",
fsc->client->debugfs_dir,
Expand Down
8 changes: 4 additions & 4 deletions include/trace/events/wbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TRACE_EVENT(wbt_stat,
),

TP_fast_assign(
strlcpy(__entry->name, dev_name(bdi->dev),
strlcpy(__entry->name, bdi_dev_name(bdi),
ARRAY_SIZE(__entry->name));
__entry->rmean = stat[0].mean;
__entry->rmin = stat[0].min;
Expand Down Expand Up @@ -68,7 +68,7 @@ TRACE_EVENT(wbt_lat,
),

TP_fast_assign(
strlcpy(__entry->name, dev_name(bdi->dev),
strlcpy(__entry->name, bdi_dev_name(bdi),
ARRAY_SIZE(__entry->name));
__entry->lat = div_u64(lat, 1000);
),
Expand Down Expand Up @@ -105,7 +105,7 @@ TRACE_EVENT(wbt_step,
),

TP_fast_assign(
strlcpy(__entry->name, dev_name(bdi->dev),
strlcpy(__entry->name, bdi_dev_name(bdi),
ARRAY_SIZE(__entry->name));
__entry->msg = msg;
__entry->step = step;
Expand Down Expand Up @@ -141,7 +141,7 @@ TRACE_EVENT(wbt_timer,
),

TP_fast_assign(
strlcpy(__entry->name, dev_name(bdi->dev),
strlcpy(__entry->name, bdi_dev_name(bdi),
ARRAY_SIZE(__entry->name));
__entry->status = status;
__entry->step = step;
Expand Down

0 comments on commit 19a845e

Please sign in to comment.