lkml.org 
[lkml]   [2006]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] sysfs representation of stacked devices (common) (rev.2)
    On Wed, Feb 22, 2006 at 11:13:00AM -0500, Jun'ichi Nomura wrote:
    > +/* This is a mere directory in sysfs. No methods are needed. */
    > +static struct kobj_type bd_holder_ktype = {
    > + .release = NULL,
    > + .sysfs_ops = NULL,
    > + .default_attrs = NULL,
    > +};

    That doesn't look right. You always need a release function.

    > +static inline void add_holder_dir(struct block_device *bdev)
    > +{
    > + struct kobject *kobj = &bdev->bd_holder_dir;
    > +
    > + kobj->ktype = &bd_holder_ktype;
    > + kobject_set_name(kobj, "holders");
    > + kobj->parent = bdev_get_kobj(bdev);
    > + kobject_init(kobj);
    > + kobject_add(kobj);
    > + kobject_put(kobj->parent);
    > +}
    > +
    > +static inline void del_holder_dir(struct block_device *bdev)
    > +{
    > + /*
    > + * Don't kobject_unregister to avoid memory allocation
    > + * in kobject_hotplug.
    > + */
    > + kobject_del(&bdev->bd_holder_dir);
    > + kobject_put(&bdev->bd_holder_dir);
    > +}

    No, do it correctly please.

    thanks,

    greg k-h
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-02-22 19:51    [W:0.026 / U:93.592 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site