[lkml]   [2007]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFD driver-core] Lifetime problems of the current driver model
    On Sat, 31 Mar 2007 12:12:48 +0900,
    Tejun Heo <> wrote:

    > > Hm, but as long as dk0 is registered, it can be looked up and someone
    > > could get a reference on it.
    > Yeah, exactly. That's why any getting any kobject reference backed by a
    > module must be accompanied by try_module_get().
    > int mydrv_get_dk(struct dk *dk)
    > {
    > rc = try_module_get(mydrv);
    > if (rc)
    > return rc;
    > kobject_get(&dk->kobj);
    > return 0;
    > }

    This works if the caller always knows which module to grab (I was
    thinking about some tree-walking code).

    > Exactly, in that case, module reference count must not be zero. You and
    > I are saying the same thing. Why are we running in circle?

    I hope we're not, it just makes one dizzy :)

    I'll think some more about it...
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-03-31 18:09    [W:0.021 / U:6.828 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site