• S
    nullb: add interface to power on disk · cedcafad
    Shaohua Li 提交于
    The device created in nullb configfs interface isn't power on by
    default. After user configures the device, user can do 'echo 1 >
    xxx/nullb/device_name/power' to power on the device, which will create a
    disk. the xxx/nullb/device_name/index is the disk index, so if the index
    is 2, the new created disk should be named as /dev/nullb2. Note, the
    'index' is only valid after disk is power on.
    
    'echo 0 > xxx/nullb/device_name/power' will remove the disk. Note, this
    doesn't remove the device. To remove the device, user should do 'rmdir
    xxx/nullb/device_name'. Removing the device will remove the disk too.
    Signed-off-by: NShaohua Li <shli@fb.com>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    cedcafad
null_blk.c 29.4 KB