diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-04 14:47:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-14 07:58:30 +0200 |
commit | 25390a31983ce1b303f20ceed22b324a13996750 (patch) | |
tree | b13007ae3783666cf49809baab63e90413d0aeff /mm | |
parent | c1af2c13a4ac1dd29937bb54e9d8410f11e8465a (diff) | |
download | linux-stable-25390a31983ce1b303f20ceed22b324a13996750.tar.gz linux-stable-25390a31983ce1b303f20ceed22b324a13996750.tar.bz2 linux-stable-25390a31983ce1b303f20ceed22b324a13996750.zip |
bdi: move bdi_dev_name out of line
[ Upstream commit eb7ae5e06bb6e6ac6bb86872d27c43ebab92f6b2 ]
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 <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/backing-dev.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 62f05f605fb5..680e5028d0fc 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -21,7 +21,7 @@ struct backing_dev_info noop_backing_dev_info = { EXPORT_SYMBOL_GPL(noop_backing_dev_info); 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 @@ -1043,6 +1043,14 @@ void bdi_put(struct backing_dev_info *bdi) } 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] = { __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]), __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1]) |