• Tejun Heo's avatar
    block: use class_dev_iterator instead of class_for_each_device() · def4e38d
    Tejun Heo authored
    Recent block_class iteration updates 5c6f35c5..27f30251 converted all
    class device iteration to class_for_each_device() and
    class_find_device(), which are correct but pain in the ass to use.
    This pach converts them to newly introduced class_dev_iterator so that
    they can use more natural control structures instead of separate
    callbacks and struct to pass parameters to them.
    
    This results in smaller and easier code.
    
    This patch also restores the original behavior of not printing header
    in /proc/partitions if there's no partition to print.  This is trivial
    but still user-visible behavior.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    def4e38d
genhd.c 18.4 KB