• Alexander Viro's avatar
    [PATCH] preparation to use of driverfs refcounts, part 2 - disk · b288f6ad
    Alexander Viro authored
    	* disk->disk_dev is initialized in alloc_disk(), device_add()'d in
    	  add_disk(), device_del()'d in unregister_disk() and device_put() in
    	  put_disk().
    	* devices of partitions are made its children.
    	* attributes of disk one: dev (dev_t of the thing), range (number of
    	  minors) and size (in sectors).
    	* attributes of partition ones: dev (ditto), start (in sectors) and
    	  size (in sectors).
    	* disk devices are put on a new bus - "block"
    	* if caller of add_disk() had set disk->driverfs_dev, we set symlinks:
    	  "device" from disk to underlying device and "block" from underlying
    	  device to disk.
    	* ->release() of disk_dev frees disk and disk->part.
    	At that point we have sane driverfs subtree for each gendisk and
    refcount of its root (disk->disk_dev) can act as gendisk refcount.
    b288f6ad
ide-floppy.c 65 KB