lkml.org 
[lkml]   [2006]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 4/6] bd_claim_by_disk
    This patch is part of dm/md sysfs dependency tree.

    This adds variants of bd_claim_by_kobject which takes gendisk instead
    of kobject and do kobject_{get,put}(&gendisk->slave_dir).

    Thanks,
    --
    Jun'ichi Nomura, NEC Solutions (America), Inc.
    Variants of bd_claim_by_kobject which takes gendisk instead
    of kobject and do kobject_{get,put}(&gendisk->slave_dir).

    Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

    include/linux/genhd.h | 13 +++++++++++++
    1 files changed, 13 insertions(+)

    --- linux-2.6.16-rc5.orig/include/linux/genhd.h 2006-02-27 00:09:35.000000000 -0500
    +++ linux-2.6.16-rc5/include/linux/genhd.h 2006-03-02 10:29:55.000000000 -0500
    @@ -421,6 +424,19 @@ static inline struct block_device *bdget
    return bdget(MKDEV(disk->major, disk->first_minor) + index);
    }

    +static inline int bd_claim_by_disk(struct block_device *bdev,
    + void *holder, struct gendisk *disk)
    +{
    + return bd_claim_by_kobject(bdev, holder, kobject_get(disk->slave_dir));
    +}
    +
    +static inline void bd_release_from_disk(struct block_device *bdev,
    + struct gendisk *disk)
    +{
    + bd_release_from_kobject(bdev, disk->slave_dir);
    + kobject_put(disk->slave_dir);
    +}
    +
    #endif

    #endif
    \
     
     \ /
      Last update: 2006-03-04 02:00    [W:0.026 / U:91.300 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site