aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 7b9a8f132d5a..d9ccc830b73a 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -191,24 +191,6 @@ int sysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
191 return error; 191 return error;
192} 192}
193 193
194static inline void orphan_all_buffers(struct inode *node)
195{
196 struct sysfs_buffer_collection *set;
197 struct sysfs_buffer *buf;
198
199 mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD);
200 set = node->i_private;
201 if (set) {
202 list_for_each_entry(buf, &set->associates, associates) {
203 down(&buf->sem);
204 buf->orphaned = 1;
205 up(&buf->sem);
206 }
207 }
208 mutex_unlock(&node->i_mutex);
209}
210
211
212/* 194/*
213 * Unhashes the dentry corresponding to given sysfs_dirent 195 * Unhashes the dentry corresponding to given sysfs_dirent
214 * Called with parent inode's i_mutex held. 196 * Called with parent inode's i_mutex held.
@@ -216,7 +198,6 @@ static inline void orphan_all_buffers(struct inode *node)
216void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent) 198void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent)
217{ 199{
218 struct dentry *dentry = NULL; 200 struct dentry *dentry = NULL;
219 struct inode *inode;
220 201
221 /* We're not holding a reference to ->s_dentry dentry but the 202 /* We're not holding a reference to ->s_dentry dentry but the
222 * field will stay valid as long as sysfs_lock is held. 203 * field will stay valid as long as sysfs_lock is held.
@@ -236,17 +217,11 @@ void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent)
236 spin_lock(&dcache_lock); 217 spin_lock(&dcache_lock);
237 spin_lock(&dentry->d_lock); 218 spin_lock(&dentry->d_lock);
238 if (!d_unhashed(dentry) && dentry->d_inode) { 219 if (!d_unhashed(dentry) && dentry->d_inode) {
239 inode = dentry->d_inode;
240 spin_lock(&inode->i_lock);
241 __iget(inode);
242 spin_unlock(&inode->i_lock);
243 dget_locked(dentry); 220 dget_locked(dentry);
244 __d_drop(dentry); 221 __d_drop(dentry);
245 spin_unlock(&dentry->d_lock); 222 spin_unlock(&dentry->d_lock);
246 spin_unlock(&dcache_lock); 223 spin_unlock(&dcache_lock);
247 simple_unlink(parent->d_inode, dentry); 224 simple_unlink(parent->d_inode, dentry);
248 orphan_all_buffers(inode);
249 iput(inode);
250 } else { 225 } else {
251 spin_unlock(&dentry->d_lock); 226 spin_unlock(&dentry->d_lock);
252 spin_unlock(&dcache_lock); 227 spin_unlock(&dcache_lock);