summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2003-08-30 22:51:54 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-30 22:51:54 -0700
commitfdf6f5efe399c351d85620ceb82ce2d15c6cf907 (patch)
treedca103e0cbcf6fbdd5f32b79756e9713a76c824a /include/linux
parentf2820f23b7adb742047f9d38191b9bb8cf0cb6a5 (diff)
[PATCH] dev_t handling cleanups (12/12)
added the exclusion between ADD_PARTITION/DELETE_PARTITION/open() (BLKPG ioctls didn't grab ->bd_sem when they should have). added bdev->bd_part; it is set at open() to point to the hd_struct of partition in question, reset on final close. blk_partition_remap() uses ->bd_part instead of the current mess ->bd_offset is gone, we use ->bd_part->start_sect instead added missing ->release() to hd_struct kobject, moved kfree() into it ->bd_part cotributes to refcount of hd_struct - we bump it when ->bd_part is set and drop when it's reset.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/genhd.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 090bc3ab5c6b..108e53f176c9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -345,7 +345,7 @@ struct block_device {
int bd_holders;
struct block_device * bd_contains;
unsigned bd_block_size;
- sector_t bd_offset;
+ struct hd_struct * bd_part;
unsigned bd_part_count;
int bd_invalidated;
struct gendisk * bd_disk;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 3e4ef6b13683..623baf2fd239 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -197,7 +197,7 @@ extern void rand_initialize_disk(struct gendisk *disk);
static inline sector_t get_start_sect(struct block_device *bdev)
{
- return bdev->bd_offset;
+ return bdev->bd_part->start_sect;
}
static inline sector_t get_capacity(struct gendisk *disk)
{