block: always set bdev->bd_part

Till now, bdev->bd_part is set only if the bdev was for parts other
than part0.  This patch makes bdev->bd_part always set so that code
paths don't have to differenciate common handling.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
Tejun Heo
2008-08-25 19:56:12 +09:00
committed by Jens Axboe
parent 4c46501d16
commit 0762b8bde9
5 changed files with 35 additions and 48 deletions

View File

@@ -412,7 +412,7 @@ extern void rand_initialize_disk(struct gendisk *disk);
static inline sector_t get_start_sect(struct block_device *bdev)
{
return bdev->bd_contains == bdev ? 0 : bdev->bd_part->start_sect;
return bdev->bd_part->start_sect;
}
static inline sector_t get_capacity(struct gendisk *disk)
{