From 79c2cfb85fd83474e12f95ad85624eb421f4b6ea Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Wed, 24 Apr 2002 23:50:28 -0700 Subject: [PATCH] (9/15) big struct block_device * push (first series) - this one is interesting and will play in the next series as well; affected place is fs/block_dev.c::do_open(). We check if bdev is a partition (same way it is done in generic_make_request()) and if it is - open entire disk and put pointer to its bdev into a new field bdev->bd_contains. Otherwise (non-partition) we set bdev->bd_contains to bdev. Corresponding cleanup done in blkdev_put() (and failure path in do_open()) - when the last opener goes away we close bdev->bd_contains if bdev is a partition (i.e. not equal to its ->bd_contains) and set it to NULL. Immediate effect is that we can get from bdev of partition to bdev of disk when submitting a bio, but it also opens a way to handle partition-parsing in a sane way. That will be done in the next series. --- include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/fs.h') diff --git a/include/linux/fs.h b/include/linux/fs.h index a97a764dcc53..7a05fbe4b64c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -420,6 +420,7 @@ struct block_device { struct list_head bd_inodes; void * bd_holder; int bd_holders; + struct block_device * bd_contains; }; struct inode { -- cgit v1.2.3