diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-04 14:47:59 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-05-09 16:15:13 -0600 |
commit | 3c5d202b55d3fa9106607f99cdd5044b02b5929b (patch) | |
tree | d87bffecd91741f528a5a3b7905662b0c79ff748 /block | |
parent | a5a6c66df6bf951007f434fad04d777289f00aa6 (diff) | |
download | linux-stable-3c5d202b55d3fa9106607f99cdd5044b02b5929b.tar.gz linux-stable-3c5d202b55d3fa9106607f99cdd5044b02b5929b.tar.bz2 linux-stable-3c5d202b55d3fa9106607f99cdd5044b02b5929b.zip |
bdi: remove bdi_register_owner
Split out a new bdi_set_owner helper to set the owner, and move the policy
for creating the bdi name back into genhd.c, where it belongs.
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/genhd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c index c05d509877fa..27511b3d164d 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -840,13 +840,15 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk, disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO; disk->flags |= GENHD_FL_NO_PART_SCAN; } else { + struct backing_dev_info *bdi = disk->queue->backing_dev_info; + struct device *dev = disk_to_dev(disk); int ret; /* Register BDI before referencing it from bdev */ - disk_to_dev(disk)->devt = devt; - ret = bdi_register_owner(disk->queue->backing_dev_info, - disk_to_dev(disk)); + dev->devt = devt; + ret = bdi_register(bdi, "%u:%u", MAJOR(devt), MINOR(devt)); WARN_ON(ret); + bdi_set_owner(bdi, dev); blk_register_region(disk_devt(disk), disk->minors, NULL, exact_match, exact_lock, disk); } |