Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bdi: simplify bdi_alloc

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
aef33c2f 3c5d202b

+7 -12
+1 -1
block/blk-core.c
··· 501 501 if (ret) 502 502 goto fail_id; 503 503 504 - q->backing_dev_info = bdi_alloc_node(GFP_KERNEL, node_id); 504 + q->backing_dev_info = bdi_alloc(node_id); 505 505 if (!q->backing_dev_info) 506 506 goto fail_split; 507 507
+1 -1
drivers/mtd/mtdcore.c
··· 2036 2036 struct backing_dev_info *bdi; 2037 2037 int ret; 2038 2038 2039 - bdi = bdi_alloc(GFP_KERNEL); 2039 + bdi = bdi_alloc(NUMA_NO_NODE); 2040 2040 if (!bdi) 2041 2041 return ERR_PTR(-ENOMEM); 2042 2042
+1 -1
fs/super.c
··· 1598 1598 int err; 1599 1599 va_list args; 1600 1600 1601 - bdi = bdi_alloc(GFP_KERNEL); 1601 + bdi = bdi_alloc(NUMA_NO_NODE); 1602 1602 if (!bdi) 1603 1603 return -ENOMEM; 1604 1604
+1 -5
include/linux/backing-dev.h
··· 36 36 void bdi_set_owner(struct backing_dev_info *bdi, struct device *owner); 37 37 void bdi_unregister(struct backing_dev_info *bdi); 38 38 39 - struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id); 40 - static inline struct backing_dev_info *bdi_alloc(gfp_t gfp_mask) 41 - { 42 - return bdi_alloc_node(gfp_mask, NUMA_NO_NODE); 43 - } 39 + struct backing_dev_info *bdi_alloc(int node_id); 44 40 45 41 void wb_start_background_writeback(struct bdi_writeback *wb); 46 42 void wb_workfn(struct work_struct *work);
+3 -4
mm/backing-dev.c
··· 865 865 return ret; 866 866 } 867 867 868 - struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id) 868 + struct backing_dev_info *bdi_alloc(int node_id) 869 869 { 870 870 struct backing_dev_info *bdi; 871 871 872 - bdi = kmalloc_node(sizeof(struct backing_dev_info), 873 - gfp_mask | __GFP_ZERO, node_id); 872 + bdi = kzalloc_node(sizeof(*bdi), GFP_KERNEL, node_id); 874 873 if (!bdi) 875 874 return NULL; 876 875 ··· 879 880 } 880 881 return bdi; 881 882 } 882 - EXPORT_SYMBOL(bdi_alloc_node); 883 + EXPORT_SYMBOL(bdi_alloc); 883 884 884 885 static struct rb_node **bdi_lookup_rb_node(u64 id, struct rb_node **parentp) 885 886 {