summaryrefslogtreecommitdiff
path: root/fs/quota
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-23 13:38:40 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 14:53:39 -0700
commit4e7b5671c6a883d94b5428e1a9c141bbd56cb2a6 (patch)
tree862980514dedf92e87aa3ec651f5be306f207390 /fs/quota
parent7918f0f6fdafa1e52c2d77c537cb55ef25fb69a3 (diff)
block: remove i_bdev
Switch the block device lookup interfaces to directly work with a dev_t so that struct block_device references are only acquired by the blkdev_get variants (and the blk-cgroup special case). This means that we now don't need an extra reference in the inode and can generally simplify handling of struct block_device to keep the lookups contained in the core block layer code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Coly Li <colyli@suse.de> [bcache] Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/quota.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index f3d32b0d9008..6d16b2be5ac4 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -866,17 +866,18 @@ static bool quotactl_cmd_onoff(int cmd)
static struct super_block *quotactl_block(const char __user *special, int cmd)
{
#ifdef CONFIG_BLOCK
- struct block_device *bdev;
struct super_block *sb;
struct filename *tmp = getname(special);
bool excl = false, thawed = false;
+ int error;
+ dev_t dev;
if (IS_ERR(tmp))
return ERR_CAST(tmp);
- bdev = lookup_bdev(tmp->name);
+ error = lookup_bdev(tmp->name, &dev);
putname(tmp);
- if (IS_ERR(bdev))
- return ERR_CAST(bdev);
+ if (error)
+ return ERR_PTR(error);
if (quotactl_cmd_onoff(cmd)) {
excl = true;
@@ -886,8 +887,10 @@ static struct super_block *quotactl_block(const char __user *special, int cmd)
}
retry:
- sb = __get_super(bdev, excl);
- if (thawed && sb && sb->s_writers.frozen != SB_UNFROZEN) {
+ sb = user_get_super(dev, excl);
+ if (!sb)
+ return ERR_PTR(-ENODEV);
+ if (thawed && sb->s_writers.frozen != SB_UNFROZEN) {
if (excl)
up_write(&sb->s_umount);
else
@@ -897,10 +900,6 @@ retry:
put_super(sb);
goto retry;
}
-
- bdput(bdev);
- if (!sb)
- return ERR_PTR(-ENODEV);
return sb;
#else