Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59141
b: refs/heads/master
c: 380e6fb
h: refs/heads/master
i:
  59139: 125857b
v: v3
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Jul 11, 2007
1 parent cea3d98 commit 242c35b
Show file tree
Hide file tree
Showing 4 changed files with 6 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: b402d72cf7b338a074e3c12b305ec79284e18845
refs/heads/master: 380e6fbb729a55b73d5d8409551474884e0d93fc
4 changes: 3 additions & 1 deletion trunk/fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void sysfs_deactivate(struct sysfs_dirent *sd)
DECLARE_COMPLETION_ONSTACK(wait);
int v;

BUG_ON(sd->s_sibling);
BUG_ON(sd->s_sibling || !(sd->s_flags & SYSFS_FLAG_REMOVED));
sd->s_sibling = (void *)&wait;

/* atomic_add_return() is a mb(), put_active() will always see
Expand Down Expand Up @@ -506,6 +506,7 @@ static void remove_dir(struct dentry * d)
mutex_lock(&parent->d_inode->i_mutex);

sysfs_unlink_sibling(sd);
sd->s_flags |= SYSFS_FLAG_REMOVED;

pr_debug(" o %s removing done (%d)\n",d->d_name.name,
atomic_read(&d->d_count));
Expand Down Expand Up @@ -540,6 +541,7 @@ static void __sysfs_remove_dir(struct dentry *dentry)
struct sysfs_dirent *sd = *pos;

if (sysfs_type(sd) && (sysfs_type(sd) & SYSFS_NOT_PINNED)) {
sd->s_flags |= SYSFS_FLAG_REMOVED;
*pos = sd->s_sibling;
sd->s_sibling = removed;
removed = sd;
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/sysfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name)
if (!sysfs_type(sd))
continue;
if (!strcmp(sd->s_name, name)) {
sd->s_flags |= SYSFS_FLAG_REMOVED;
*pos = sd->s_sibling;
sd->s_sibling = NULL;
found = 1;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct sysfs_ops {
#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)

#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
#define SYSFS_FLAG_REMOVED 0x0100

#ifdef CONFIG_SYSFS

Expand Down

0 comments on commit 242c35b

Please sign in to comment.