Skip to content
  • Shaohua Li's avatar
    nullb: add configfs interface · 3bf2bd20
    Shaohua Li authored
    
    
    Add configfs interface for nullb. configfs interface is more flexible
    and easy to configure in a per-disk basis.
    
    Configuration is something like this:
    mount -t configfs none /mnt
    
    Checking which features the driver supports:
    cat /mnt/nullb/features
    
    The 'features' attribute is for future extension. We probably will add
    new features into the driver, userspace can check this attribute to find
    the supported features.
    
    Create/remove a device:
    mkdir/rmdir /mnt/nullb/a
    
    Then configure the device by setting attributes under /mnt/nullb/a, most
    of nullb supported module parameters are converted to attributes:
    size; /* device size in MB */
    completion_nsec; /* time in ns to complete a request */
    submit_queues; /* number of submission queues */
    home_node; /* home node for the device */
    queue_mode; /* block interface */
    blocksize; /* block size */
    irqmode; /* IRQ completion handler */
    hw_queue_depth; /* queue depth */
    use_lightnvm; /* register as a LightNVM device */
    blocking; /* blocking blk-mq device */
    use_per_node_hctx; /* use per-node allocation for hardware context */
    
    Note, creating a device doesn't create a disk immediately. Creating a
    disk is done in two phases: create a device and then power on the
    device. Next patch will introduce device power on.
    
    Based on original patch from Kyungchan Koh
    
    Signed-off-by: default avatarKyungchan Koh <kkc6196@fb.com>
    Signed-off-by: default avatarShaohua Li <shli@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    3bf2bd20