summaryrefslogtreecommitdiffstats
path: root/fs/ramfs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-08 00:53:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-08 00:53:00 +0000
commitb8553086288629b4efb77e97f5582e08bc50ad65 (patch)
tree0a19bd1c21e148f35c7a0f76baa4f7a056b966b0 /fs/ramfs
parent75b6d92f2dd5112b02f4e78cf9f35f9825946ef0 (diff)
Merge with 2.4.0-test3-pre4.
Diffstat (limited to 'fs/ramfs')
-rw-r--r--fs/ramfs/inode.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 9bb7611c1..22833d064 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -202,15 +202,21 @@ static inline int ramfs_positive(struct dentry *dentry)
*/
static int ramfs_empty(struct dentry *dentry)
{
- struct list_head *list = dentry->d_subdirs.next;
+ struct list_head *list;
+
+ spin_lock(&dcache_lock);
+ list = dentry->d_subdirs.next;
while (list != &dentry->d_subdirs) {
struct dentry *de = list_entry(list, struct dentry, d_child);
- if (ramfs_positive(de))
+ if (ramfs_positive(de)) {
+ spin_unlock(&dcache_lock);
return 0;
+ }
list = list->next;
}
+ spin_unlock(&dcache_lock);
return 1;
}