• Alexander Viro's avatar
    [PATCH] dev_t handling cleanups (12/12) · fdf6f5ef
    Alexander Viro authored
    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.
    fdf6f5ef
ll_rw_blk.c 72.3 KB