Skip to content

Commit eb7ae5e

Browse files
Christoph Hellwigaxboe
authored andcommitted
bdi: move bdi_dev_name out of line
bdi_dev_name is not a fast path function, move it out of line. This prepares for using it from modular callers without having to export an implementation detail like bdi_unknown_name. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 156c757 commit eb7ae5e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

include/linux/backing-dev.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
505505
(1 << WB_async_congested));
506506
}
507507

508-
extern const char *bdi_unknown_name;
509-
510-
static inline const char *bdi_dev_name(struct backing_dev_info *bdi)
511-
{
512-
if (!bdi || !bdi->dev)
513-
return bdi_unknown_name;
514-
return dev_name(bdi->dev);
515-
}
508+
const char *bdi_dev_name(struct backing_dev_info *bdi);
516509

517510
#endif /* _LINUX_BACKING_DEV_H */

mm/backing-dev.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct backing_dev_info noop_backing_dev_info = {
2121
EXPORT_SYMBOL_GPL(noop_backing_dev_info);
2222

2323
static struct class *bdi_class;
24-
const char *bdi_unknown_name = "(unknown)";
24+
static const char *bdi_unknown_name = "(unknown)";
2525

2626
/*
2727
* bdi_lock protects bdi_tree and updates to bdi_list. bdi_list has RCU
@@ -1043,6 +1043,14 @@ void bdi_put(struct backing_dev_info *bdi)
10431043
}
10441044
EXPORT_SYMBOL(bdi_put);
10451045

1046+
const char *bdi_dev_name(struct backing_dev_info *bdi)
1047+
{
1048+
if (!bdi || !bdi->dev)
1049+
return bdi_unknown_name;
1050+
return dev_name(bdi->dev);
1051+
}
1052+
EXPORT_SYMBOL_GPL(bdi_dev_name);
1053+
10461054
static wait_queue_head_t congestion_wqh[2] = {
10471055
__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
10481056
__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])

0 commit comments

Comments
 (0)