Re: [PATCH] RFC: Attributes in /sys/cdev

From: Patrick Mochel
Date: Mon Sep 22 2003 - 11:34:05 EST



> BTW, I suspect that we need a way to say "this kobject and its children
> will *never* have any attributes and will never be seen in sysfs". There
> are quite a few uses when we keep kobject as a refcounting vehicle, etc.,
> but have nothing meaningful to show in sysfs tree. Keep in mind that
> sysfs nodes (including attributes) are not free - it's struct inode +
> struct dentry at the very least. Both pinned down and permanently mapped...

There is already - use kobject_init() to initialize the refcount to 1, and
kobject_put() to clean it up. (kobject_add() and kobject_del() can be used
to later add/remove it from the sysfs hierarchy).

Or, since those objects will probably never get added to sysfs, and since
few objects are ever promoted, we may just want to create a new, smaller
object purely for the refcounting vehicle..


Pat

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