summaryrefslogtreecommitdiffstats
path: root/fs/hpfs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-19 22:45:37 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-19 22:45:37 +0000
commit6d403070f28cd44860fdb3a53be5da0275c65cf4 (patch)
tree0d0e7fe7b5fb7568d19e11d7d862b77a866ce081 /fs/hpfs
parentecf1bf5f6c2e668d03b0a9fb026db7aa41e292e1 (diff)
Merge with 2.4.0-test1-ac21 + pile of MIPS cleanups to make merging
possible. Chainsawed RM200 kernel to compile again. Jazz machine status unknown.
Diffstat (limited to 'fs/hpfs')
-rw-r--r--fs/hpfs/file.c2
-rw-r--r--fs/hpfs/hpfs_fn.h2
-rw-r--r--fs/hpfs/inode.c8
-rw-r--r--fs/hpfs/namei.c10
4 files changed, 15 insertions, 7 deletions
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index c0707b52c..ebe12eb40 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -56,7 +56,7 @@ void hpfs_truncate(struct inode *i)
i->i_blocks = 1 + ((i->i_size + 511) >> 9);
i->u.hpfs_i.mmu_private = i->i_size;
hpfs_truncate_btree(i->i_sb, i->i_ino, 1, ((i->i_size + 511) >> 9));
- hpfs_write_inode(i);
+ hpfs_write_inode(i, 0);
}
int hpfs_get_block(struct inode *inode, long iblock, struct buffer_head *bh_result, int create)
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index a01140f1f..a76efa035 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -266,7 +266,7 @@ ssize_t hpfs_file_write(struct file *file, const char *buf, size_t count, loff_t
void hpfs_read_inode(struct inode *);
void hpfs_write_inode_ea(struct inode *, struct fnode *);
-void hpfs_write_inode(struct inode *);
+void hpfs_write_inode(struct inode *, int);
void hpfs_write_inode_nolock(struct inode *);
int hpfs_notify_change(struct dentry *, struct iattr *);
void hpfs_write_if_changed(struct inode *);
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index 69303cb9e..2f3f3f32e 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -228,12 +228,12 @@ void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
}
}
-void hpfs_write_inode(struct inode *i)
+void hpfs_write_inode(struct inode *i, int unused)
{
struct inode *parent;
if (!i->i_nlink) return;
if (i->i_ino == i->i_sb->s_hpfs_root) return;
- if (i->i_hpfs_rddir_off && !i->i_count) {
+ if (i->i_hpfs_rddir_off && !atomic_read(&i->i_count)) {
if (*i->i_hpfs_rddir_off) printk("HPFS: write_inode: some position still there\n");
kfree(i->i_hpfs_rddir_off);
i->i_hpfs_rddir_off = NULL;
@@ -300,14 +300,14 @@ int hpfs_notify_change(struct dentry *dentry, struct iattr *attr)
if (inode->i_sb->s_hpfs_root == inode->i_ino) return -EINVAL;
if ((error = inode_change_ok(inode, attr))) return error;
inode_setattr(inode, attr);
- hpfs_write_inode(inode);
+ hpfs_write_inode(inode, 0);
return 0;
}
void hpfs_write_if_changed(struct inode *inode)
{
if (inode->i_hpfs_dirty) {
- hpfs_write_inode(inode);
+ hpfs_write_inode(inode, 0);
}
}
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index b09ad98ea..5684801df 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -330,7 +330,15 @@ int hpfs_unlink(struct inode *dir, struct dentry *dentry)
struct iattr newattrs;
int err;
hpfs_unlock_2inodes(dir, inode);
- if (rep || dentry->d_count > 1 || permission(inode, MAY_WRITE) || get_write_access(inode)) goto ret;
+ if (rep)
+ goto ret;
+ d_drop(dentry);
+ if (dentry->d_count > 1 ||
+ permission(inode, MAY_WRITE) ||
+ get_write_access(inode)) {
+ d_rehash(dentry);
+ goto ret;
+ }
/*printk("HPFS: truncating file before delete.\n");*/
down(&inode->i_sem);
newattrs.ia_size = 0;