diff options
| author | David Woodhouse <dwmw2@infradead.org> | 2007-04-26 04:31:28 -0400 |
|---|---|---|
| committer | David Woodhouse <dwmw2@infradead.org> | 2007-04-26 04:31:28 -0400 |
| commit | ef2e58ea6b9931c3a4816c66593da49bb20e3b24 (patch) | |
| tree | ce7432add3becbe78de4ea06425cd2d9e91f4ada /fs/sysfs/inode.c | |
| parent | 06d63cc51d47f572009138a7f3ac34d95773405d (diff) | |
| parent | de46c33745f5e2ad594c72f2cf5f490861b16ce1 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/sysfs/inode.c')
| -rw-r--r-- | fs/sysfs/inode.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index ccb7d722c558..4de5c6b89918 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
| @@ -222,13 +222,17 @@ const unsigned char * sysfs_get_name(struct sysfs_dirent *sd) | |||
| 222 | 222 | ||
| 223 | static inline void orphan_all_buffers(struct inode *node) | 223 | static inline void orphan_all_buffers(struct inode *node) |
| 224 | { | 224 | { |
| 225 | struct sysfs_buffer_collection *set = node->i_private; | 225 | struct sysfs_buffer_collection *set; |
| 226 | struct sysfs_buffer *buf; | 226 | struct sysfs_buffer *buf; |
| 227 | 227 | ||
| 228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); | 228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); |
| 229 | if (node->i_private) { | 229 | set = node->i_private; |
| 230 | list_for_each_entry(buf, &set->associates, associates) | 230 | if (set) { |
| 231 | list_for_each_entry(buf, &set->associates, associates) { | ||
| 232 | down(&buf->sem); | ||
| 231 | buf->orphaned = 1; | 233 | buf->orphaned = 1; |
| 234 | up(&buf->sem); | ||
| 235 | } | ||
| 232 | } | 236 | } |
| 233 | mutex_unlock(&node->i_mutex); | 237 | mutex_unlock(&node->i_mutex); |
| 234 | } | 238 | } |
