Commit 2e82b84c authored by Jan Kara's avatar Jan Kara Committed by Jens Axboe

block: Remove unused functions

Now that all backing_dev_info structure are allocated separately, we can
drop some unused functions.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent c1844d53
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <linux/backing-dev-defs.h> #include <linux/backing-dev-defs.h>
#include <linux/slab.h> #include <linux/slab.h>
int __must_check bdi_init(struct backing_dev_info *bdi);
static inline struct backing_dev_info *bdi_get(struct backing_dev_info *bdi) static inline struct backing_dev_info *bdi_get(struct backing_dev_info *bdi)
{ {
kref_get(&bdi->refcnt); kref_get(&bdi->refcnt);
...@@ -32,12 +30,9 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, ...@@ -32,12 +30,9 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
const char *fmt, ...); const char *fmt, ...);
int bdi_register_va(struct backing_dev_info *bdi, struct device *parent, int bdi_register_va(struct backing_dev_info *bdi, struct device *parent,
const char *fmt, va_list args); const char *fmt, va_list args);
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner); int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner);
void bdi_unregister(struct backing_dev_info *bdi); void bdi_unregister(struct backing_dev_info *bdi);
int __must_check bdi_setup_and_register(struct backing_dev_info *, char *);
void bdi_destroy(struct backing_dev_info *bdi);
struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id); struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id);
static inline struct backing_dev_info *bdi_alloc(gfp_t gfp_mask) static inline struct backing_dev_info *bdi_alloc(gfp_t gfp_mask)
{ {
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include <linux/device.h> #include <linux/device.h>
#include <trace/events/writeback.h> #include <trace/events/writeback.h>
static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0);
struct backing_dev_info noop_backing_dev_info = { struct backing_dev_info noop_backing_dev_info = {
.name = "noop", .name = "noop",
.capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK,
...@@ -242,6 +240,8 @@ static __init int bdi_class_init(void) ...@@ -242,6 +240,8 @@ static __init int bdi_class_init(void)
} }
postcore_initcall(bdi_class_init); postcore_initcall(bdi_class_init);
static int bdi_init(struct backing_dev_info *bdi);
static int __init default_bdi_init(void) static int __init default_bdi_init(void)
{ {
int err; int err;
...@@ -820,7 +820,7 @@ static void cgwb_remove_from_bdi_list(struct bdi_writeback *wb) ...@@ -820,7 +820,7 @@ static void cgwb_remove_from_bdi_list(struct bdi_writeback *wb)
#endif /* CONFIG_CGROUP_WRITEBACK */ #endif /* CONFIG_CGROUP_WRITEBACK */
int bdi_init(struct backing_dev_info *bdi) static int bdi_init(struct backing_dev_info *bdi)
{ {
int ret; int ret;
...@@ -838,7 +838,6 @@ int bdi_init(struct backing_dev_info *bdi) ...@@ -838,7 +838,6 @@ int bdi_init(struct backing_dev_info *bdi)
return ret; return ret;
} }
EXPORT_SYMBOL(bdi_init);
struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id) struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id)
{ {
...@@ -897,12 +896,6 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, ...@@ -897,12 +896,6 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
} }
EXPORT_SYMBOL(bdi_register); EXPORT_SYMBOL(bdi_register);
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev)
{
return bdi_register(bdi, NULL, "%u:%u", MAJOR(dev), MINOR(dev));
}
EXPORT_SYMBOL(bdi_register_dev);
int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner) int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner)
{ {
int rc; int rc;
...@@ -950,13 +943,6 @@ void bdi_unregister(struct backing_dev_info *bdi) ...@@ -950,13 +943,6 @@ void bdi_unregister(struct backing_dev_info *bdi)
} }
} }
static void bdi_exit(struct backing_dev_info *bdi)
{
WARN_ON_ONCE(bdi->dev);
wb_exit(&bdi->wb);
cgwb_bdi_exit(bdi);
}
static void release_bdi(struct kref *ref) static void release_bdi(struct kref *ref)
{ {
struct backing_dev_info *bdi = struct backing_dev_info *bdi =
...@@ -964,7 +950,9 @@ static void release_bdi(struct kref *ref) ...@@ -964,7 +950,9 @@ static void release_bdi(struct kref *ref)
if (test_bit(WB_registered, &bdi->wb.state)) if (test_bit(WB_registered, &bdi->wb.state))
bdi_unregister(bdi); bdi_unregister(bdi);
bdi_exit(bdi); WARN_ON_ONCE(bdi->dev);
wb_exit(&bdi->wb);
cgwb_bdi_exit(bdi);
kfree(bdi); kfree(bdi);
} }
...@@ -974,38 +962,6 @@ void bdi_put(struct backing_dev_info *bdi) ...@@ -974,38 +962,6 @@ void bdi_put(struct backing_dev_info *bdi)
} }
EXPORT_SYMBOL(bdi_put); EXPORT_SYMBOL(bdi_put);
void bdi_destroy(struct backing_dev_info *bdi)
{
bdi_unregister(bdi);
bdi_exit(bdi);
}
EXPORT_SYMBOL(bdi_destroy);
/*
* For use from filesystems to quickly init and register a bdi associated
* with dirty writeback
*/
int bdi_setup_and_register(struct backing_dev_info *bdi, char *name)
{
int err;
bdi->name = name;
bdi->capabilities = 0;
err = bdi_init(bdi);
if (err)
return err;
err = bdi_register(bdi, NULL, "%.28s-%ld", name,
atomic_long_inc_return(&bdi_seq));
if (err) {
bdi_destroy(bdi);
return err;
}
return 0;
}
EXPORT_SYMBOL(bdi_setup_and_register);
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment