aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:40:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:40:20 -0400
commitdc690d8ef842b464f1c429a376ca16cb8dbee6ae (patch)
tree77955849af5a15755f5e55e24ae4b9c520583a72 /lib/kobject.c
parent57399ec9077a4b962b81037aaa279fab52f5e989 (diff)
parent91a6902958f052358899f58683d44e36228d85c2 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (61 commits) sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes sysfs: make directory dentries and inodes reclaimable sysfs: implement sysfs_get_dentry() sysfs: move sysfs_drop_dentry() to dir.c and make it static sysfs: restructure add/remove paths and fix inode update sysfs: use sysfs_mutex to protect the sysfs_dirent tree sysfs: consolidate sysfs spinlocks sysfs: make kobj point to sysfs_dirent instead of dentry sysfs: implement sysfs_find_dirent() and sysfs_get_dirent() sysfs: implement SYSFS_FLAG_REMOVED flag sysfs: rename sysfs_dirent->s_type to s_flags and make room for flags sysfs: make sysfs_drop_dentry() access inodes using ilookup() sysfs: Fix oops in sysfs_drop_dentry on x86_64 sysfs: use singly-linked list for sysfs_dirent tree sysfs: slim down sysfs_dirent->s_active sysfs: move s_active functions to fs/sysfs/dir.c sysfs: fix root sysfs_dirent -> root dentry association sysfs: use iget_locked() instead of new_inode() sysfs: reorganize sysfs_new_indoe() and sysfs_create() sysfs: fix parent refcounting during rename and move ...
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index ac1520651b9b..4b08e0ff95c8 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -44,7 +44,7 @@ static int populate_dir(struct kobject * kobj)
44 return error; 44 return error;
45} 45}
46 46
47static int create_dir(struct kobject * kobj, struct dentry *shadow_parent) 47static int create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent)
48{ 48{
49 int error = 0; 49 int error = 0;
50 if (kobject_name(kobj)) { 50 if (kobject_name(kobj)) {
@@ -162,7 +162,7 @@ static void unlink(struct kobject * kobj)
162 * @shadow_parent: sysfs directory to add to. 162 * @shadow_parent: sysfs directory to add to.
163 */ 163 */
164 164
165int kobject_shadow_add(struct kobject * kobj, struct dentry *shadow_parent) 165int kobject_shadow_add(struct kobject *kobj, struct sysfs_dirent *shadow_parent)
166{ 166{
167 int error = 0; 167 int error = 0;
168 struct kobject * parent; 168 struct kobject * parent;
@@ -338,7 +338,7 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
338 /* Note : if we want to send the new name alone, not the full path, 338 /* Note : if we want to send the new name alone, not the full path,
339 * we could probably use kobject_name(kobj); */ 339 * we could probably use kobject_name(kobj); */
340 340
341 error = sysfs_rename_dir(kobj, kobj->parent->dentry, new_name); 341 error = sysfs_rename_dir(kobj, kobj->parent->sd, new_name);
342 342
343 /* This function is mostly/only used for network interface. 343 /* This function is mostly/only used for network interface.
344 * Some hotplug package track interfaces by their name and 344 * Some hotplug package track interfaces by their name and
@@ -361,8 +361,8 @@ out:
361 * @new_name: object's new name 361 * @new_name: object's new name
362 */ 362 */
363 363
364int kobject_shadow_rename(struct kobject * kobj, struct dentry *new_parent, 364int kobject_shadow_rename(struct kobject *kobj,
365 const char *new_name) 365 struct sysfs_dirent *new_parent, const char *new_name)
366{ 366{
367 int error = 0; 367 int error = 0;
368 368
@@ -597,10 +597,17 @@ int kset_add(struct kset * k)
597 597
598int kset_register(struct kset * k) 598int kset_register(struct kset * k)
599{ 599{
600 int err;
601
600 if (!k) 602 if (!k)
601 return -EINVAL; 603 return -EINVAL;
604
602 kset_init(k); 605 kset_init(k);
603 return kset_add(k); 606 err = kset_add(k);
607 if (err)
608 return err;
609 kobject_uevent(&k->kobj, KOBJ_ADD);
610 return 0;
604} 611}
605 612
606 613