diff options
author | 2023-05-31 14:55:30 +0200 | |
---|---|---|
committer | 2023-06-05 10:57:40 -0600 | |
commit | d4a28d7defe79006e59293a4b43d518ba8483fb0 (patch) | |
tree | febeabd7b852358564e9a33e2fe5a271142b43ad /drivers/md/dm-table.c | |
parent | dm: open code dm_get_dev_t in dm_init_init (diff) | |
download | linux-d4a28d7defe79006e59293a4b43d518ba8483fb0.tar.gz linux-d4a28d7defe79006e59293a4b43d518ba8483fb0.tar.bz2 linux-d4a28d7defe79006e59293a4b43d518ba8483fb0.zip |
dm: remove dm_get_dev_t
Open code dm_get_dev_t in the only remaining caller, and propagate the
exact error code from lookup_bdev and early_lookup_bdev.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230531125535.676098-20-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 05aa16da43b0..1576b408768d 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -324,20 +324,6 @@ static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode, } /* - * Convert the path to a device - */ -dev_t dm_get_dev_t(const char *path) -{ - dev_t dev; - - if (lookup_bdev(path, &dev) && - early_lookup_bdev(path, &dev)) - return 0; - return dev; -} -EXPORT_SYMBOL_GPL(dm_get_dev_t); - -/* * Add a device to the list, or just increment the usage count if * it's already present. */ @@ -359,9 +345,11 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, if (MAJOR(dev) != major || MINOR(dev) != minor) return -EOVERFLOW; } else { - dev = dm_get_dev_t(path); - if (!dev) - return -ENODEV; + r = lookup_bdev(path, &dev); + if (r) + r = early_lookup_bdev(path, &dev); + if (r) + return r; } if (dev == disk_devt(t->md->disk)) return -EINVAL; |