summaryrefslogtreecommitdiffstats
path: root/fs/coda
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/coda
parent75b6d92f2dd5112b02f4e78cf9f35f9825946ef0 (diff)
Merge with 2.4.0-test3-pre4.
Diffstat (limited to 'fs/coda')
-rw-r--r--fs/coda/cache.c2
-rw-r--r--fs/coda/dir.c32
-rw-r--r--fs/coda/pioctl.c2
-rw-r--r--fs/coda/psdev.c2
-rw-r--r--fs/coda/symlink.c3
5 files changed, 28 insertions, 13 deletions
diff --git a/fs/coda/cache.c b/fs/coda/cache.c
index eff2da6cd..e837db96a 100644
--- a/fs/coda/cache.c
+++ b/fs/coda/cache.c
@@ -228,6 +228,7 @@ static void coda_flag_children(struct dentry *parent, int flag)
struct list_head *child;
struct dentry *de;
+ spin_lock(&dcache_lock);
list_for_each(child, &parent->d_subdirs)
{
de = list_entry(child, struct dentry, d_child);
@@ -239,6 +240,7 @@ static void coda_flag_children(struct dentry *parent, int flag)
de->d_parent->d_name.len, de->d_parent->d_name.name);
coda_flag_inode(de->d_inode, flag);
}
+ spin_unlock(&dcache_lock);
return;
}
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 0e6fa5625..66279990e 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -15,9 +15,10 @@
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/locks.h>
-#include <asm/segment.h>
-#include <asm/uaccess.h>
#include <linux/string.h>
+#include <linux/smp_lock.h>
+
+#include <asm/uaccess.h>
#include <linux/coda.h>
#include <linux/coda_linux.h>
@@ -479,7 +480,7 @@ static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
CDEBUG(D_INODE, "old: %s, (%d length), new: %s"
"(%d length). old:d_count: %d, new:d_count: %d\n",
old_name, old_length, new_name, new_length,
- old_dentry->d_count, new_dentry->d_count);
+ atomic_read(&old_dentry->d_count), atomic_read(&new_dentry->d_count));
error = venus_rename(old_dir->i_sb, coda_i2f(old_dir),
coda_i2f(new_dir), old_length, new_length,
@@ -582,7 +583,7 @@ int coda_open(struct inode *i, struct file *f)
coda_vfs_stat.open++;
CDEBUG(D_SPECIAL, "OPEN inode number: %ld, count %d, flags %o.\n",
- f->f_dentry->d_inode->i_ino, f->f_dentry->d_count, flags);
+ f->f_dentry->d_inode->i_ino, atomic_read(&f->f_dentry->d_count), flags);
error = venus_open(i->i_sb, coda_i2f(i), coda_flags, &ino, &dev);
if (error) {
@@ -779,21 +780,21 @@ exit:
/* called when a cache lookup succeeds */
static int coda_dentry_revalidate(struct dentry *de, int flags)
{
- int valid = 1;
struct inode *inode = de->d_inode;
struct coda_inode_info *cii;
ENTRY;
if (!inode)
return 1;
+ lock_kernel();
if (coda_isroot(inode))
- return 1;
+ goto out;
if (is_bad_inode(inode))
- return 0;
+ goto bad;
cii = ITOC(de->d_inode);
if (! (cii->c_flags & (C_PURGE | C_FLUSH)) )
- return valid;
+ goto out;
shrink_dcache_parent(de);
@@ -801,17 +802,22 @@ static int coda_dentry_revalidate(struct dentry *de, int flags)
if (cii->c_flags & C_FLUSH)
coda_flag_inode_children(inode, C_FLUSH);
- if (de->d_count > 1) {
+ if (atomic_read(&de->d_count) > 1) {
/* pretend it's valid, but don't change the flags */
CDEBUG(D_DOWNCALL, "BOOM for: ino %ld, %s\n",
de->d_inode->i_ino, coda_f2s(&cii->c_fid));
- return 1;
+ goto out;
}
/* clear the flags. */
cii->c_flags &= ~(C_VATTR | C_PURGE | C_FLUSH);
+bad:
+ unlock_kernel();
return 0;
+out:
+ unlock_kernel();
+ return 1;
}
/*
@@ -857,8 +863,9 @@ int coda_revalidate_inode(struct dentry *dentry)
dentry->d_name.len, dentry->d_name.name,
dentry->d_parent->d_name.len, dentry->d_parent->d_name.name);
+ lock_kernel();
if ( cii->c_flags == 0 )
- return 0;
+ goto ok;
if (cii->c_flags & (C_VATTR | C_PURGE | C_FLUSH)) {
error = venus_getattr(inode->i_sb, &(cii->c_fid), &attr);
@@ -890,6 +897,8 @@ int coda_revalidate_inode(struct dentry *dentry)
cii->c_flags &= ~(C_VATTR | C_PURGE | C_FLUSH);
}
+ok:
+ unlock_kernel();
return 0;
return_bad_inode:
@@ -899,6 +908,7 @@ return_bad_inode:
iput(container);
}
make_bad_inode(inode);
+ unlock_kernel();
return -EIO;
}
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c
index d97204125..dd2636895 100644
--- a/fs/coda/pioctl.c
+++ b/fs/coda/pioctl.c
@@ -120,7 +120,7 @@ static int coda_pioctl(struct inode * inode, struct file * filp,
CDEBUG(D_PIOCTL, "ioctl on inode %ld\n", target_inode->i_ino);
CDEBUG(D_DOWNCALL, "dput on ino: %ld, icount %d, dcount %d\n", target_inode->i_ino,
- atomic_read(&target_inode->i_count), nd.dentry->d_count);
+ atomic_read(&target_inode->i_count), atomic_read(&nd.dentry->d_count));
path_release(&nd);
return error;
}
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 14fe68ad4..695e4158c 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -391,7 +391,7 @@ int init_coda_psdev(void)
CODA_PSDEV_MAJOR);
return -EIO;
}
- devfs_handle = devfs_mk_dir (NULL, "coda", 4, NULL);
+ devfs_handle = devfs_mk_dir (NULL, "coda", NULL);
devfs_register_series (devfs_handle, "%u", MAX_CODADEVS, DEVFS_FL_NONE,
CODA_PSDEV_MAJOR, 0,
S_IFCHR | S_IRUSR | S_IWUSR,
diff --git a/fs/coda/symlink.c b/fs/coda/symlink.c
index 81ac4dfda..252f11664 100644
--- a/fs/coda/symlink.c
+++ b/fs/coda/symlink.c
@@ -14,6 +14,7 @@
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/locks.h>
+#include <linux/smp_lock.h>
#include <linux/coda.h>
#include <linux/coda_linux.h>
@@ -30,10 +31,12 @@ static int coda_symlink_filler(struct file *file, struct page *page)
unsigned int len = PAGE_SIZE;
char *p = (char*)kmap(page);
+ lock_kernel();
cnp = ITOC(inode);
coda_vfs_stat.follow_link++;
error = venus_readlink(inode->i_sb, &(cnp->c_fid), p, &len);
+ unlock_kernel();
if (error)
goto fail;
SetPageUptodate(page);