• Alexander Viro's avatar
    [PATCH] (9/15) big struct block_device * push (first series) · 79c2cfb8
    Alexander Viro authored
     - 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.
    79c2cfb8
block_dev.c 17.5 KB