Commit 76a13e22 authored by Dave Kleikamp's avatar Dave Kleikamp

Merge jfs@jfs.bkbits.net:linux-2.5

into shaggy.austin.ibm.com:/shaggy/bk/jfs-2.5
parents 4c17e91a 3be31ff6
...@@ -36,17 +36,11 @@ extern struct file_operations jfs_file_operations; ...@@ -36,17 +36,11 @@ extern struct file_operations jfs_file_operations;
struct address_space_operations jfs_aops; struct address_space_operations jfs_aops;
extern int freeZeroLink(struct inode *); extern int freeZeroLink(struct inode *);
struct inode *jfs_iget(struct super_block *sb, ino_t ino) void jfs_read_inode(struct inode *inode)
{ {
struct inode *inode = iget_locked(sb, ino);
if (!inode || !(inode->i_state & I_NEW))
return inode;
if (diRead(inode)) { if (diRead(inode)) {
make_bad_inode(inode); make_bad_inode(inode);
unlock_new_inode(inode); return;
return NULL;
} }
if (S_ISREG(inode->i_mode)) { if (S_ISREG(inode->i_mode)) {
...@@ -69,8 +63,6 @@ struct inode *jfs_iget(struct super_block *sb, ino_t ino) ...@@ -69,8 +63,6 @@ struct inode *jfs_iget(struct super_block *sb, ino_t ino)
init_special_inode(inode, inode->i_mode, init_special_inode(inode, inode->i_mode,
kdev_t_to_nr(inode->i_rdev)); kdev_t_to_nr(inode->i_rdev));
} }
unlock_new_inode(inode);
return inode;
} }
/* This define is from fs/open.c */ /* This define is from fs/open.c */
......
...@@ -35,7 +35,6 @@ extern struct address_space_operations jfs_aops; ...@@ -35,7 +35,6 @@ extern struct address_space_operations jfs_aops;
extern int jfs_fsync(struct file *, struct dentry *, int); extern int jfs_fsync(struct file *, struct dentry *, int);
extern void jfs_truncate_nolock(struct inode *, loff_t); extern void jfs_truncate_nolock(struct inode *, loff_t);
extern struct inode *jfs_iget(struct super_block *, ino_t);
extern int jfs_init_acl(struct inode *, struct inode *); extern int jfs_init_acl(struct inode *, struct inode *);
/* /*
...@@ -1406,9 +1405,11 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry) ...@@ -1406,9 +1405,11 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry)
} }
} }
ip = jfs_iget(dip->i_sb, inum); ip = iget(dip->i_sb, inum);
if (ip == NULL) { if (ip == NULL || is_bad_inode(ip)) {
jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum); jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum);
if (ip)
iput(ip);
return ERR_PTR(-EACCES); return ERR_PTR(-EACCES);
} }
...@@ -1421,14 +1422,18 @@ struct dentry *jfs_get_parent(struct dentry *dentry) ...@@ -1421,14 +1422,18 @@ struct dentry *jfs_get_parent(struct dentry *dentry)
struct dentry *parent = ERR_PTR(-EACCES); struct dentry *parent = ERR_PTR(-EACCES);
struct inode *inode; struct inode *inode;
inode = jfs_iget(sb, JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot); inode = iget(sb, JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
if (inode) { if (inode) {
if (is_bad_inode(inode))
iput(inode);
else {
parent = d_alloc_anon(inode); parent = d_alloc_anon(inode);
if (!parent) { if (!parent) {
parent = ERR_PTR(-ENOMEM); parent = ERR_PTR(-ENOMEM);
iput(inode); iput(inode);
} }
} }
}
return parent; return parent;
} }
......
...@@ -58,8 +58,6 @@ MODULE_PARM_DESC(jfsloglevel, "Specify JFS loglevel (0, 1 or 2)"); ...@@ -58,8 +58,6 @@ MODULE_PARM_DESC(jfsloglevel, "Specify JFS loglevel (0, 1 or 2)");
/* /*
* External declarations * External declarations
*/ */
extern struct inode *jfs_iget(struct super_block *, ino_t);
extern int jfs_mount(struct super_block *); extern int jfs_mount(struct super_block *);
extern int jfs_mount_rw(struct super_block *, int); extern int jfs_mount_rw(struct super_block *, int);
extern int jfs_umount(struct super_block *); extern int jfs_umount(struct super_block *);
...@@ -69,6 +67,7 @@ extern int jfsIOWait(void *); ...@@ -69,6 +67,7 @@ extern int jfsIOWait(void *);
extern int jfs_lazycommit(void *); extern int jfs_lazycommit(void *);
extern int jfs_sync(void *); extern int jfs_sync(void *);
extern void jfs_read_inode(struct inode *inode);
extern void jfs_dirty_inode(struct inode *inode); extern void jfs_dirty_inode(struct inode *inode);
extern void jfs_delete_inode(struct inode *inode); extern void jfs_delete_inode(struct inode *inode);
extern void jfs_write_inode(struct inode *inode, int wait); extern void jfs_write_inode(struct inode *inode, int wait);
...@@ -313,7 +312,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -313,7 +312,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_magic = JFS_SUPER_MAGIC; sb->s_magic = JFS_SUPER_MAGIC;
inode = jfs_iget(sb, ROOT_I); inode = iget(sb, ROOT_I);
if (!inode || is_bad_inode(inode)) if (!inode || is_bad_inode(inode))
goto out_no_root; goto out_no_root;
sb->s_root = d_alloc_root(inode); sb->s_root = d_alloc_root(inode);
...@@ -397,6 +396,7 @@ static int jfs_sync_fs(struct super_block *sb, int wait) ...@@ -397,6 +396,7 @@ static int jfs_sync_fs(struct super_block *sb, int wait)
static struct super_operations jfs_super_operations = { static struct super_operations jfs_super_operations = {
.alloc_inode = jfs_alloc_inode, .alloc_inode = jfs_alloc_inode,
.destroy_inode = jfs_destroy_inode, .destroy_inode = jfs_destroy_inode,
.read_inode = jfs_read_inode,
.dirty_inode = jfs_dirty_inode, .dirty_inode = jfs_dirty_inode,
.write_inode = jfs_write_inode, .write_inode = jfs_write_inode,
.delete_inode = jfs_delete_inode, .delete_inode = jfs_delete_inode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment