why do both kobjects and ksets have a "kobj_type" member?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  what is the rationale for both the kobject structs and the kset
structs having a kobj_type?  can those values possibly be different?
from kobject.h:

 ...
 *      kset - a set of kobjects of a specific type, belonging
 *      to a specific subsystem.
 *
 *      All kobjects of a kset should be embedded in an identical
 *      type.
 ...

so that suggests that the types can't be *different* within a single
kset.  furthermore, we have:

...
static inline struct kobj_type * get_ktype(struct kobject * k)
{
        if (k->kset && k->kset->ktype)
                return k->kset->ktype;
        else
                return k->ktype;
}
...

which seem to clearly show that the ktype of the kset overrides that
of the kobject, unless the kset *has* no ktype, or the kobject is not
even a member of a kset.  are either of those situations possible?
just being inordinately curious.

rday

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux