提交 eb7ae5e0 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NJan Kara <jack@suse.cz>
Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: NBart Van Assche <bvanassche@acm.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 156c7573
...@@ -505,13 +505,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) ...@@ -505,13 +505,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
(1 << WB_async_congested)); (1 << WB_async_congested));
} }
extern const char *bdi_unknown_name; const char *bdi_dev_name(struct backing_dev_info *bdi);
static inline const char *bdi_dev_name(struct backing_dev_info *bdi)
{
if (!bdi || !bdi->dev)
return bdi_unknown_name;
return dev_name(bdi->dev);
}
#endif /* _LINUX_BACKING_DEV_H */ #endif /* _LINUX_BACKING_DEV_H */
...@@ -21,7 +21,7 @@ struct backing_dev_info noop_backing_dev_info = { ...@@ -21,7 +21,7 @@ struct backing_dev_info noop_backing_dev_info = {
EXPORT_SYMBOL_GPL(noop_backing_dev_info); EXPORT_SYMBOL_GPL(noop_backing_dev_info);
static struct class *bdi_class; static struct class *bdi_class;
const char *bdi_unknown_name = "(unknown)"; static const char *bdi_unknown_name = "(unknown)";
/* /*
* bdi_lock protects bdi_tree and updates to bdi_list. bdi_list has RCU * 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) ...@@ -1043,6 +1043,14 @@ void bdi_put(struct backing_dev_info *bdi)
} }
EXPORT_SYMBOL(bdi_put); EXPORT_SYMBOL(bdi_put);
const char *bdi_dev_name(struct backing_dev_info *bdi)
{
if (!bdi || !bdi->dev)
return bdi_unknown_name;
return dev_name(bdi->dev);
}
EXPORT_SYMBOL_GPL(bdi_dev_name);
static wait_queue_head_t congestion_wqh[2] = { static wait_queue_head_t congestion_wqh[2] = {
__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]), __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1]) __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册