Commit aef33c2f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

bdi: simplify bdi_alloc

Merge the _node vs normal version and drop the superflous gfp_t argument.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3c5d202b
...@@ -501,7 +501,7 @@ struct request_queue *__blk_alloc_queue(int node_id) ...@@ -501,7 +501,7 @@ struct request_queue *__blk_alloc_queue(int node_id)
if (ret) if (ret)
goto fail_id; goto fail_id;
q->backing_dev_info = bdi_alloc_node(GFP_KERNEL, node_id); q->backing_dev_info = bdi_alloc(node_id);
if (!q->backing_dev_info) if (!q->backing_dev_info)
goto fail_split; goto fail_split;
......
...@@ -2036,7 +2036,7 @@ static struct backing_dev_info * __init mtd_bdi_init(char *name) ...@@ -2036,7 +2036,7 @@ static struct backing_dev_info * __init mtd_bdi_init(char *name)
struct backing_dev_info *bdi; struct backing_dev_info *bdi;
int ret; int ret;
bdi = bdi_alloc(GFP_KERNEL); bdi = bdi_alloc(NUMA_NO_NODE);
if (!bdi) if (!bdi)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
...@@ -1598,7 +1598,7 @@ int super_setup_bdi_name(struct super_block *sb, char *fmt, ...) ...@@ -1598,7 +1598,7 @@ int super_setup_bdi_name(struct super_block *sb, char *fmt, ...)
int err; int err;
va_list args; va_list args;
bdi = bdi_alloc(GFP_KERNEL); bdi = bdi_alloc(NUMA_NO_NODE);
if (!bdi) if (!bdi)
return -ENOMEM; return -ENOMEM;
......
...@@ -36,11 +36,7 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, ...@@ -36,11 +36,7 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt,
void bdi_set_owner(struct backing_dev_info *bdi, struct device *owner); void bdi_set_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);
struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id); struct backing_dev_info *bdi_alloc(int node_id);
static inline struct backing_dev_info *bdi_alloc(gfp_t gfp_mask)
{
return bdi_alloc_node(gfp_mask, NUMA_NO_NODE);
}
void wb_start_background_writeback(struct bdi_writeback *wb); void wb_start_background_writeback(struct bdi_writeback *wb);
void wb_workfn(struct work_struct *work); void wb_workfn(struct work_struct *work);
......
...@@ -865,12 +865,11 @@ static int bdi_init(struct backing_dev_info *bdi) ...@@ -865,12 +865,11 @@ static int bdi_init(struct backing_dev_info *bdi)
return ret; return ret;
} }
struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id) struct backing_dev_info *bdi_alloc(int node_id)
{ {
struct backing_dev_info *bdi; struct backing_dev_info *bdi;
bdi = kmalloc_node(sizeof(struct backing_dev_info), bdi = kzalloc_node(sizeof(*bdi), GFP_KERNEL, node_id);
gfp_mask | __GFP_ZERO, node_id);
if (!bdi) if (!bdi)
return NULL; return NULL;
...@@ -880,7 +879,7 @@ struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id) ...@@ -880,7 +879,7 @@ struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id)
} }
return bdi; return bdi;
} }
EXPORT_SYMBOL(bdi_alloc_node); EXPORT_SYMBOL(bdi_alloc);
static struct rb_node **bdi_lookup_rb_node(u64 id, struct rb_node **parentp) static struct rb_node **bdi_lookup_rb_node(u64 id, struct rb_node **parentp)
{ {
......
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