mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
block: add a bdget_part helper
All remaining callers of bdget() outside of fs/block_dev.c want to get a reference to the struct block_device for a given struct hd_struct. Add a helper just for that and then mark bdget static. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
155bd9d1ab
commit
10ed16662d
@@ -891,7 +891,7 @@ static int bdev_set(struct inode *inode, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct block_device *bdget(dev_t dev)
|
||||
static struct block_device *bdget(dev_t dev)
|
||||
{
|
||||
struct block_device *bdev;
|
||||
struct inode *inode;
|
||||
@@ -920,8 +920,6 @@ struct block_device *bdget(dev_t dev)
|
||||
return bdev;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(bdget);
|
||||
|
||||
/**
|
||||
* bdgrab -- Grab a reference to an already referenced block device
|
||||
* @bdev: Block device to grab a reference to.
|
||||
@@ -933,6 +931,11 @@ struct block_device *bdgrab(struct block_device *bdev)
|
||||
}
|
||||
EXPORT_SYMBOL(bdgrab);
|
||||
|
||||
struct block_device *bdget_part(struct hd_struct *part)
|
||||
{
|
||||
return bdget(part_devt(part));
|
||||
}
|
||||
|
||||
long nr_blockdev_pages(void)
|
||||
{
|
||||
struct inode *inode;
|
||||
|
Reference in New Issue
Block a user