]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
bdi: simplify bdi_alloc
authorChristoph Hellwig <hch@lst.de>
Mon, 4 May 2020 12:48:00 +0000 (14:48 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2020 22:15:13 +0000 (16:15 -0600)
Merge the _node vs normal version and drop the superflous gfp_t argument.

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>
block/blk-core.c
drivers/mtd/mtdcore.c
fs/super.c
include/linux/backing-dev.h
mm/backing-dev.c

index 7f11560bfddbb2f74711a73ac926ae9882035119..285a2f8ee8d3ac82fd76c7aa841f94349bfc0f8f 100644 (file)
@@ -501,7 +501,7 @@ struct request_queue *__blk_alloc_queue(int node_id)
        if (ret)
                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)
                goto fail_split;
 
index 2916674208b32643950bae373e7380be4d66ab7a..39ec563d9a14becc3b7e4e4bf272c7cd7a39b9a6 100644 (file)
@@ -2036,7 +2036,7 @@ static struct backing_dev_info * __init mtd_bdi_init(char *name)
        struct backing_dev_info *bdi;
        int ret;
 
-       bdi = bdi_alloc(GFP_KERNEL);
+       bdi = bdi_alloc(NUMA_NO_NODE);
        if (!bdi)
                return ERR_PTR(-ENOMEM);
 
index cd352530eca906eb64d722592c85e2fa3ef02886..dd28fcd706ff516332088aaeddc931f414dc1427 100644 (file)
@@ -1598,7 +1598,7 @@ int super_setup_bdi_name(struct super_block *sb, char *fmt, ...)
        int err;
        va_list args;
 
-       bdi = bdi_alloc(GFP_KERNEL);
+       bdi = bdi_alloc(NUMA_NO_NODE);
        if (!bdi)
                return -ENOMEM;
 
index 4098ed6ba6b432d58c493928d35ab94e0c2dd13c..6b3504bf7a42b38ce7f584e58ef75ad8da5efabb 100644 (file)
@@ -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_unregister(struct backing_dev_info *bdi);
 
-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)
-{
-       return bdi_alloc_node(gfp_mask, NUMA_NO_NODE);
-}
+struct backing_dev_info *bdi_alloc(int node_id);
 
 void wb_start_background_writeback(struct bdi_writeback *wb);
 void wb_workfn(struct work_struct *work);
index bb993f99d4244cc6854a03537e091a61dd5f8298..1f55d5b8269ff6f9e95f069b75a6de6f8e425639 100644 (file)
@@ -865,12 +865,11 @@ static int bdi_init(struct backing_dev_info *bdi)
        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;
 
-       bdi = kmalloc_node(sizeof(struct backing_dev_info),
-                          gfp_mask | __GFP_ZERO, node_id);
+       bdi = kzalloc_node(sizeof(*bdi), GFP_KERNEL, node_id);
        if (!bdi)
                return NULL;
 
@@ -880,7 +879,7 @@ struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id)
        }
        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)
 {