16 Jun, 2009
1 commit
-
kset_create should check the kobject_set_name return value.
Add the return value checking code.
Signed-off-by: Dave Young
Signed-off-by: Greg Kroah-Hartman
20 Apr, 2009
1 commit
-
notice one system /proc/iomem some entries missed the name for pci_devices
it turns that dev->dev.kobj name is changed after device_add.
for pci code: via acpi_pci_root_driver.ops.add (aka acpi_pci_root_add)
==> pci_acpi_scan_root is used to scan pci bus/device, and at the same
time we read the resource for pci_dev in the pci_read_bases, we have
res->name = pci_name(pci_dev); pci_name is calling dev_name.later via acpi_pci_root_driver.ops.start (aka acpi_pci_root_start) ==>
pci_bus_add_device to add all pci_dev in kobj tree. pci_bus_add_device
will call device_add.actually in device_add
/* first, register with generic layer. */
error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev));
if (error)
goto Error;will get one new name for that kobj, old name is freed.
[Impact: fix corrupted names in /proc/iomem ]
Signed-off-by: Yinghai Lu
Signed-off-by: Linus Torvalds
25 Mar, 2009
1 commit
-
Now that all users of bus_id is gone, we can remove it from struct
device.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
17 Oct, 2008
2 commits
-
It finally dawned on me what the clean fix to sysfs_rename_dir
calling kobject_set_name is. Move the work into kobject_rename
where it belongs. The callers serialize us anyway so this is
safe.Signed-off-by: Eric W. Biederman
Acked-by: Tejun Heo
Signed-off-by: Greg Kroah-Hartman -
When looking at kobject_rename I found two bugs with
that exist when sysfs support is disabled in the kernel.kobject_rename does not change the name on the kobject when
sysfs support is not compiled in.kobject_rename without locking attempts to check the
validity of a rename operation, which the kobject layer
simply does not have the infrastructure to do.This patch documents the previously unstated requirement of
kobject_rename that is the responsibility of the caller to
provide mutual exclusion and to be certain that the new_name
for the kobject is valid.This patch modifies sysfs_rename_dir in !CONFIG_SYSFS case
to call kobject_set_name to actually change the kobject_name.This patch removes the bogus and misleading check in kobject_rename
that attempts to see if a rename is valid. The check is bogus
because we do not have the proper locking. The check is misleading
because it looks like we can and do perform checking at the kobject
level that we don't.Signed-off-by: Eric W. Biederman
Signed-off-by: Greg Kroah-Hartman
22 Aug, 2008
1 commit
-
A recent patch from Kay Sievers
replaced the first occurrence of '/' with '!' as needed for block devices.Now do some cheap defensive coding and replace all of them to avoid future
issues in this area.Signed-off-by: Ingo Oeser
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
26 Jul, 2008
1 commit
-
Now that WARN() exists, we can fold some of the printk's into it.
Signed-off-by: Arjan van de Ven
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Jul, 2008
1 commit
-
Some (block) devices have a '/' in the name, and need special
handling. Let's have that rule to the core, so we can remove it
from the block class.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
11 Jun, 2008
1 commit
-
Detect all physical PCI slots as described by ACPI, and create entries in
/sys/bus/pci/slots/.Not all physical slots are hotpluggable, and the acpiphp module does not
detect them. Now we know the physical PCI geography of our system, without
caring about hotplug.[kaneshige.kenji@jp.fujitsu.com: export-kobject_rename-for-pci_hotplug_core]
Signed-off-by: Kenji Kaneshige
Acked-by: Greg KH
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix build with CONFIG_DMI=n]
Signed-off-by: Alex Chiang
Cc: Greg KH
Cc: Kristen Carlson Accardi
Cc: Len Brown
Acked-by: Len Brown
Acked-by: Kenji Kaneshige
Signed-off-by: Andrew Morton
Signed-off-by: Andrew Morton
Signed-off-by: Jesse Barnes
01 May, 2008
1 commit
-
This prevents a few unneeded copies.
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
30 Apr, 2008
1 commit
-
__FUNCTION__ is gcc specific, use __func__
Signed-off-by: Harvey Harrison
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Apr, 2008
2 commits
-
Use the more concise list_for_each_entry(), which allows for the
deletion of the to_kobj() routine at the same time.Signed-off-by: Robert P. J. Day
Signed-off-by: Greg Kroah-Hartman -
Add warnings to kobject_put() to catch kobjects that are cleaned up but
were never initialized to begin with.Cc: Kay Sievers
Cc: Hannes Reinecke
Signed-off-by: Greg Kroah-Hartman
05 Mar, 2008
1 commit
-
kset_initialize was calling kobject_init_internal() which didn't
initialize the kobject as well as kobject_init() was. So have
kobject_init() call kobject_init_internal() and move the logic to
initalize the kobject there.Cc: Kay Sievers
Cc: Hannes Reinecke
Signed-off-by: Greg Kroah-Hartman
03 Feb, 2008
1 commit
-
Fix kerneldoc comment of kobject_create.
Signed-off-by: Dave Young
Signed-off-by: Greg Kroah-Hartman
25 Jan, 2008
25 commits
-
Clean up the kobject.c and kobject_uevent.c files to follow the
proper coding style rules.Signed-off-by: Greg Kroah-Hartman
-
All kobjects require a dynamically allocated name now. We no longer
need to keep track if the name is statically assigned, we can just
unconditionally free() all kobject names on cleanup.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
There are no in-kernel users of kobject_unregister() so it should be
removed.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
We save the current state in the object itself, so we can do proper
cleanup when the last reference is dropped.If the initial reference is dropped, the object will be removed from
sysfs if needed, if an "add" event was sent, "remove" will be send, and
the allocated resources are released.This allows us to clean up some driver core usage as well as allowing us
to do other such changes to the rest of the kernel.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
No one is calling this anymore, so just remove it and hard-code the one
internal-use of it.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The function is no longer used by anyone in the kernel, and it prevents
the proper sending of the kobject uevent after the needed files are set
up by the caller. kobject_init_and_add() can be used in its place.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Now that the old kobject_init() function is gone, rename
kobject_init_ng() to kobject_init() to clean up the namespace.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The old kobject_init() function is on longer in use, so let us remove it
from the public scope (kset mess in the kobject.c file still uses it,
but that can be cleaned up later very simply.)Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Now that the old kobject_add() function is gone, rename kobject_add_ng()
to kobject_add() to clean up the namespace.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The old kobject_add() function is on longer in use, so let us remove it
from the public scope (kset mess in the kobject.c file still uses it,
but that can be cleaned up later very simply.)Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This patch (as1015) reverts changes that were made to the driver core
about four years ago. The intent back then was to avoid certain kinds
of invalid memory accesses by leaving kernel objects allocated as long
as any of their children were still allocated. The original and
correct approach was to wait only as long as any children were still
_registered_; that's what this patch reinstates.This fixes a problem in the SCSI core made visible by the class_device
to regular device conversion: A reference loop (scsi_device holds
reference to request_queue, which is the child of a gendisk, which is
the child of the scsi_device) prevents the data structures from being
released, even though they are deregistered okay.It's possible that this change will cause a few bugs to surface,
things that have been hidden for several years. They can be fixed
easily enough by having the child device take an explicit reference to
the parent whenever needed.Signed-off-by: Alan Stern
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The kobject debugging messages are a mess. This provides a unified
message that makes them actually useful.The format for new kobject debug messages should be:
kobject: 'KOBJECT_NAME' (ADDRESS): FUNCTION_NAME: message.\nCc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
kobject_init should not be grabing any references, but only initializing
the object. This patch fixes this, and makes the lock hold-time shorter
for when a kset is present in the kobject.The current kernel tree has been audited to verify that this change
should be safe.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
These functions are no longer used and are the last remants of the old
subsystem crap. So delete them for good.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Remove the no longer needed subsys_attributes, they are all converted to
the more sensical kobj_attributes.There is no longer a magic fallback in sysfs attribute operations, all
kobjects which create simple attributes need explicitely a ktype
assigned, which tells the core what was intended here.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Switch all dynamically created ksets, that export simple attributes,
to kobj_attribute from subsys_attribute. Struct subsys_attribute will
be removed.Signed-off-by: Kay Sievers
Cc: Mike Halcrow
Cc: Phillip Hellewell
Signed-off-by: Greg Kroah-Hartman -
Add kobj_sysfs_ops to replace subsys_sysfs_ops. There is no
need for special kset operations, we want to be able to use
simple attribute operations at any kobject, not only ksets.The whole concept of any default sysfs attribute operations
will go away with the upcoming removal of subsys_sysfs_ops.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
kobject_kset_add_dir is only called in one place so remove it and use
kobject_create() instead.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
kobject_create_and_add is the same as kobject_add_dir, so drop
kobject_add_dir.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This lets users create dynamic kobjects much easier.
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Now ksets can be dynamically created on the fly, no static definitions
are required. Thanks to Miklos for hints on how to make this work
better for the callers.And thanks to Kay for finding some stupid bugs in my original version
and pointing out that we need to handle the fact that kobject's can have
a kset as a parent and to handle that properly in kobject_add().Cc: Kay Sievers
Cc: Miklos Szeredi
Signed-off-by: Greg Kroah-Hartman -
Also add a kobject_init_and_add function which bundles up what a lot of
the current callers want to do all at once, and it properly handles the
memory usages, unlike kobject_register();Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This is what the kobject_add function is going to become.
Add this to the kernel and then we can convert the tree over to use it.
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This is what the kobject_init function is going to become.
Add this to the kernel and then we can convert the tree over to use it.
Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman