summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sysfs: fix comments of sysfs_add/remove_one()Tejun Heo2007-10-121-7/+3
| | | | | | | | | | sysfs_add/remove_one() now link and unlink the target dirent into and from the children list. Update comments accordingly. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: spit a warning to users when they try to create a duplicate sysfs fileGreg Kroah-Hartman2007-10-121-1/+5
| | | | | | | | | We want to let people know when we create a duplicate sysfs file, as they need to fix up their code. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PTY: add kernel parameter to overwrite legacy pty countKay Sievers2007-10-123-3/+11
| | | | | | Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Rewrite sysfs_move_dir in terms of sysfs direntsEric W. Biederman2007-10-121-16/+18
| | | | | | | | | | | | | | This patch rewrites sysfs_move_dir to perform it's checks as much as possible on the underlying sysfs_dirents instead of the contents of the dcache, making sysfs_move_dir more like the rest of the sysfs directory modification code. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Rewrite rename in terms of sysfs direntsEric W. Biederman2007-10-121-22/+16
| | | | | | | | | | | | | | | | This patch rewrites sysfs_rename_dir to perform it's checks as much as possible on the underlying sysfs_dirents instead of the contents of the dcache. It turns out that this version is a little simpler, and a little more like the rest of the sysfs directory modification code. tj: fixed double locking of sysfs_mutex Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Remove s_dentryEric W. Biederman2007-10-123-30/+4
| | | | | | | | | | | | | The only uses of s_dentry left are the code that maintains s_dentry and trivial users that don't actually need it. So this patch removes the s_dentry maintenance code and restructures the trivial uses to use something else. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: simply sysfs_get_dentryTejun Heo2007-10-121-75/+16
| | | | | | | | | | | | | Now that we know the sysfs tree structure cannot change under us and sysfs shadow support is dropped, sysfs_get_dentry() can be simplified greatly. It can just look up from the root and there's no need to retry on failure. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Introduce sysfs_rename_mutexEric W. Biederman2007-10-123-1/+12
| | | | | | | | | | | | | | | | | | | | | Looking carefully at the rename code we have a subtle dependency that the structure of sysfs not change while we are performing a rename. If the parent directory of the object we are renaming changes while the rename is being performed nasty things could happen when we go to release our locks. So introduce a sysfs_rename_mutex to prevent this highly unlikely theoretical issue. In addition hold sysfs_rename_mutex over all calls to sysfs_get_dentry. Allowing sysfs_get_dentry to be simplified in the future. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Rewrite sysfs_drop_dentry.Eric W. Biederman2007-10-121-27/+26
| | | | | | | | | | | | | Currently we find the dentry to drop by looking at sd->s_dentry. We can just as easily accomplish the same task by looking up the sysfs inode and finding all of the dentries from there, with the added bonus that we don't need to play with the sysfs_assoc_lock. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Simplify readdir.Eric W. Biederman2007-10-121-131/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | At some point someone wrote sysfs_readdir to insert a cursor into the list of sysfs_dirents to ensure that sysfs_readdir would restart properly. That works but it is complex code and tends to be expensive. The same effect can be achieved by keeping the sysfs_dirents in inode order and using the inode number as the f_pos. Then when we restart we just have to find the first dirent whose inode number is equal or greater then the last sysfs_dirent we attempted to return. Removing the sysfs directory cursor also allows the remove of all of the mysterious checks for sysfs_type(sd) != 0. Which were nonbovious checks to see if a cursor was in a directory list. tj: offset marker for EOF is changed from UINT_MAX to INT_MAX to avoid overflow in case offset is 32bit. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: In sysfs_lookup don't open code sysfs_find_direntEric W. Biederman2007-10-121-3/+1
| | | | | | | | | | | This is a small cleanup patch that makes the code just a little bit cleaner. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Make sysfs_mount staticEric W. Biederman2007-10-124-9/+5
| | | | | | | | | | | | | | | This patch modifies the users of sysfs_mount to use sysfs_root instead (which is what they are looking for). It then makes sysfs_mount static to keep people from using it by accident. The net result is slightly faster and cleaner code. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Use kill_anon_superEric W. Biederman2007-10-121-1/+1
| | | | | | | | | | | | | | | Since sysfs no longer stores fs directory information in the dcache on a permanent basis kill_litter_super it is inappropriate and actively wrong. It will decrement the count on all dentries left in the dcache before trying to free them. At the moment this is not biting us only because we never unmount sysfs. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Remove sysfs_instantiateEric W. Biederman2007-10-123-19/+1
| | | | | | | | | | | Now that sysfs_get_inode is dropping the inode lock we no longer have a need from sysfs_instantiate. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Move all of inode initialization into sysfs_init_inodeEric W. Biederman2007-10-123-45/+45
| | | | | | | | Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: fix i_mutex locking in sysfs_get_dentry()Tejun Heo2007-10-121-0/+2
| | | | | | | | | | | | | lookup_one_len_kern() should be called with the parent's i_mutex locked. Fix it. Spotted by Eric W. Biederman. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: Make platform_device.id an intJean Delvare2007-10-122-6/+8
| | | | | | | | | | | While platform_device.id is a u32, platform_device_add() handles "-1" as a special id value. This has potential for confusion and bugs. Making it an int instead should prevent problems from happening in the future. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysdev: remove global sysdev drivers listAkinobu Mita2007-10-121-57/+14
| | | | | | | | | | | | | | | | | | | No one uses sysdev_drivers. Because no one calls sysdev_driver_register with NULL class. And it is difficult to imagine that someone want to implement a global sysdev driver which is called with all sys_device on any kind of sysdev_class. So this patch removes global sysdev_drivers list and update comments for this change. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Fix typos in fs/sysfs/file.cRolf Eike Beer2007-10-121-1/+1
| | | | | | | Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* drivers/base/power/: make 2 functions staticAdrian Bunk2007-10-123-8/+2
| | | | | | | | | suspend_device() and resume_device() can now become static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Fix Firmware class name collisionMarkus Rechberger2007-10-121-2/+1
| | | | | | | | | | | | | | | following patch fixes the i2c name collision with i2c-dev. http://mcentral.de/wiki/index.php/Bugtracker#i2c_core_problem This issue has been experienced with em28xx and saa7133 based devices. I discussed that problem with Jean Delvare a while ago and he proposed to add a prefix to the class name. Signed-off-by: Markus Rechberger <markus.rechberger@amd.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: kerneldoc - kobject_uevent_env is not "usually KOBJ_MOVE"Kay Sievers2007-10-121-4/+4
| | | | | | Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add uevent file for bus and driverKay Sievers2007-10-121-0/+35
| | | | | | | | This has been in the SuSE kernels for some time now. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: exclude kobject_uevent.c for !CONFIG_HOTPLUGKay Sievers2007-10-124-31/+57
| | | | | | | | | | Move uevent specific logic from the core into kobject_uevent.c, which does no longer require to link the unused string array if hotplug is not compiled in. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Convert from class_device to device in drivers/chartonyj@suse.de2007-10-1211-39/+32
| | | | | | | | | | Convert from class_device to device in drivers/char. Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Convert from class_device to device for drivers/videotonyj@suse.de2007-10-123-17/+20
| | | | | | | | | | Convert from class_device to device for drivers/video. Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* dmi-id: Possible cleanupJean Delvare2007-10-121-5/+2
| | | | | | | | | | The DEFINE_DMI_ATTR macro has a single user left so we can expand it for slightly shorter/simpler code. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Lennart Poettering <mzxreary@0pointer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* dmi-id: Use dynamic sysfs attributesJean Delvare2007-10-121-12/+26
| | | | | | | | | | | | We can use sysfs attributes with an extra parameter for dmi id attributes. This makes it possible to use the same callback function for all attributes, reducing the binary size significantly (-18% on x86_64.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Lennart Poettering <mzxreary@0pointer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: make sysfs_addrm_finish() return voidTejun Heo2007-10-123-9/+7
| | | | | | | | | | | | | | | With the previous sysfs_add_one() update, there is only one user of the return value of sysfs_addrm_finish() and the user can switch to testing @sd easily. Make sysfs_addrm_finish() return void for cleaner semantics as suggested by Satyam Sharma. This patch doesn't introduce any noticeable behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Satyam Sharma <satyam.sharma@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: make sysfs_add_one() automatically check for duplicate entryTejun Heo2007-10-124-23/+26
| | | | | | | | | | | | Make sysfs_add_one() check for duplicate entry and return -EEXIST if such entry exists. This simplifies node addition code a bit. This patch doesn't introduce any noticeable behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: make sysfs_add/remove_one() call link/unlink_sibling() implictlyTejun Heo2007-10-125-32/+16
| | | | | | | | | | | | | | | | | When adding or removing a sysfs_dirent, the user used to be required to call link/unlink separately. It was for two reasons - code looked like that before sysfs_addrm_cxt conversion and to avoid looping through parent_sd->children list twice during removal. Performance optimization during removal just isn't worth it. Make sysfs_add/remove_one() call sysfs_link/unlink_sibing() implicitly. This makes code simpler albeit slightly less efficient. This change doesn't introduce any noticeable behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: simplify sysfs_rename_dir()Tejun Heo2007-10-121-22/+4
| | | | | | | | | | | | | | | | | With the shadow directories gone, sysfs_rename_dir() can be simplified. * parent doesn't need to be grabbed separately. Just access old_dentry->d_parent. * parent sd can never change. Remove code to move under the new parent. * Massage comments a bit. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: cosmetic changes in sysfs_lookup()Tejun Heo2007-10-121-10/+5
| | | | | | | | | | | | | * remove space between * and symbol name in variable declaration. * kill unnecessary new line. * kill 'found' and test 'sd' instead. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Remove first pass at shadow directory supportEric W. Biederman2007-10-128-229/+33
| | | | | | | | | | | | | | | | | | | While shadow directories appear to be a good idea, the current scheme of controlling their creation and destruction outside of sysfs appears to be a locking and maintenance nightmare in the face of sysfs directories dynamically coming and going. Which can now occur for directories containing network devices when CONFIG_SYSFS_DEPRECATED is not set. This patch removes everything from the initial shadow directory support that allowed the shadow directory creation to be controlled at a higher level. So except for a few bits of sysfs_rename_dir everything from commit b592fcfe7f06c15ec11774b5be7ce0de3aa86e73 is now gone. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: cleanup semaphore.hDave Young2007-10-126-6/+3
| | | | | | | | | Cleanup semaphore.h Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs/file.c - use mutex instead of semaphoreDave Young2007-10-121-7/+7
| | | | | | | | Use mutex instead of semaphore in sysfs/file.c : sys_buffer. Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* debugfs: helper for decimal challengedRobin Getz2007-10-122-0/+63
| | | | | | | | Allows debugfs helper functions to have a hex output, rather than just decimal Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: clean up removed functions from the documentationCornelia Huck2007-10-121-19/+2
| | | | | | Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* kobject: remove the static array for the nameGreg Kroah-Hartman2007-10-122-44/+42
| | | | | | | | | | | | | | | | Due to historical reasons, struct kobject contained a static array for the name, and a dynamic pointer in case the name got bigger than the array. That's just dumb, as people didn't always know which variable to reference, even with the accessor for the kobject name. This patch removes the static array, potentially saving a lot of memory as the majority of kobjects do not have a very long name. Thanks to Kay for the idea to do this. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Drivers: clean up direct setting of the name of a ksetGreg Kroah-Hartman2007-10-126-8/+10
| | | | | | | | | | | | A kset should not have its name set directly, so dynamically set the name at runtime. This is needed to remove the static array in the kobject structure which will be changed in a future patch. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* cdev: remove unneeded setting of cdev namesGreg Kroah-Hartman2007-10-124-16/+5
| | | | | | | | | | struct cdev does not need the kobject name to be set, as it is never used. This patch fixes up the few places it is set. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* kobjects: fix up improper use of the kobject name fieldGreg Kroah-Hartman2007-10-1210-15/+16
| | | | | | | A number of different drivers incorrect access the kobject name field directly. This is not correct as the name might not be in the array. Use the proper accessor function instead.
* Driver core: remove get_bus()Greg Kroah-Hartman2007-10-122-13/+12
| | | | | | | | | | get_bus() should not be globally visable as it is not used by anything other than drivers/base/bus.c. This patch removes the visability of it, and renames it to match all of the other *_get() functions in the kernel. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: remove put_bus()Greg Kroah-Hartman2007-10-122-16/+14
| | | | | | | | | | put_bus() should not be globally visable as it is not used by anything other than drivers/base/bus.c. This patch removes the visability of it, and renames it to match all of the other *_put() functions in the kernel. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: remove subsys_get()Greg Kroah-Hartman2007-10-124-10/+3
| | | | | | | | There are no more subsystems, it's a kset now so remove the function and the only two users, which are in the driver core. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: remove subsys_put()Greg Kroah-Hartman2007-10-124-8/+3
| | | | | | | | There are no more subsystems, it's a kset now so remove the function and the only two users, which are in the driver core. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: remove kset_set_kset_sGreg Kroah-Hartman2007-10-122-15/+1
| | | | | | | | | This macro is only used by the driver core and is held over from when we had subsystems. It is not needed anymore. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: remove subsys_set_ksetGreg Kroah-Hartman2007-10-123-15/+3
| | | | | | | | | This macro is only used by the driver core and is held over from when we had subsystems. It is not needed anymore. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add CONFIG_UEVENT_HELPER_PATHKay Sievers2007-10-122-1/+9
| | | | | | | | | | | | | The kernel creates a process for every event that is send, even when there is no binary it could execute. We are needlessly creating around 200-300 failing processes during early bootup, until we have the chance to disable it from userspace. This change allows us to disable /sbin/hotplug entirely, if you want to, by setting UEVENT_HELPER_PATH="" in the kernel config. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: change add_uevent_var to use a structKay Sievers2007-10-1247-636/+300
| | | | | | | | | | | | | | | | | | This changes the uevent buffer functions to use a struct instead of a long list of parameters. It does no longer require the caller to do the proper buffer termination and size accounting, which is currently wrong in some places. It fixes a known bug where parts of the uevent environment are overwritten because of wrong index calculations. Many thanks to Mathieu Desnoyers for finding bugs and improving the error handling. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud