Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59121
b: refs/heads/master
c: aecdced
h: refs/heads/master
i:
  59119: 320d9b3
v: v3
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Jul 11, 2007
1 parent b3fdcdf commit 1341bfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e5190380ebef77f2b015c9e7a4ca225a3d75021
refs/heads/master: aecdcedaab49ca40620dc7dd70f67ee7269a66c9
8 changes: 7 additions & 1 deletion trunk/fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

DECLARE_RWSEM(sysfs_rename_sem);
spinlock_t sysfs_lock = SPIN_LOCK_UNLOCKED;
spinlock_t kobj_sysfs_assoc_lock = SPIN_LOCK_UNLOCKED;

static spinlock_t sysfs_ino_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_IDA(sysfs_ino_ida);
Expand Down Expand Up @@ -426,8 +427,13 @@ static void __sysfs_remove_dir(struct dentry *dentry)

void sysfs_remove_dir(struct kobject * kobj)
{
__sysfs_remove_dir(kobj->dentry);
struct dentry *d = kobj->dentry;

spin_lock(&kobj_sysfs_assoc_lock);
kobj->dentry = NULL;
spin_unlock(&kobj_sysfs_assoc_lock);

__sysfs_remove_dir(d);
}

int sysfs_rename_dir(struct kobject * kobj, struct dentry *new_parent,
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/sysfs/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extern void sysfs_drop_dentry(struct sysfs_dirent *sd, struct dentry *parent);
extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr);

extern spinlock_t sysfs_lock;
extern spinlock_t kobj_sysfs_assoc_lock;
extern struct rw_semaphore sysfs_rename_sem;
extern struct super_block * sysfs_sb;
extern const struct file_operations sysfs_dir_operations;
Expand Down

0 comments on commit 1341bfb

Please sign in to comment.