aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hppfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hppfs')
-rw-r--r--fs/hppfs/hppfs_kern.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c
index affb7412125e..a1e1f0f61aa5 100644
--- a/fs/hppfs/hppfs_kern.c
+++ b/fs/hppfs/hppfs_kern.c
@@ -155,6 +155,20 @@ static void hppfs_read_inode(struct inode *ino)
155 ino->i_blocks = proc_ino->i_blocks; 155 ino->i_blocks = proc_ino->i_blocks;
156} 156}
157 157
158static struct inode *hppfs_iget(struct super_block *sb)
159{
160 struct inode *inode;
161
162 inode = iget_locked(sb, 0);
163 if (!inode)
164 return ERR_PTR(-ENOMEM);
165 if (inode->i_state & I_NEW) {
166 hppfs_read_inode(inode);
167 unlock_new_inode(inode);
168 }
169 return inode;
170}
171
158static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, 172static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
159 struct nameidata *nd) 173 struct nameidata *nd)
160{ 174{
@@ -190,9 +204,11 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
190 if(IS_ERR(proc_dentry)) 204 if(IS_ERR(proc_dentry))
191 return(proc_dentry); 205 return(proc_dentry);
192 206
193 inode = iget(ino->i_sb, 0); 207 inode = hppfs_iget(ino->i_sb);
194 if(inode == NULL) 208 if (IS_ERR(inode)) {
209 err = PTR_ERR(inode);
195 goto out_dput; 210 goto out_dput;
211 }
196 212
197 err = init_inode(inode, proc_dentry); 213 err = init_inode(inode, proc_dentry);
198 if(err) 214 if(err)
@@ -652,7 +668,6 @@ static void hppfs_destroy_inode(struct inode *inode)
652static const struct super_operations hppfs_sbops = { 668static const struct super_operations hppfs_sbops = {
653 .alloc_inode = hppfs_alloc_inode, 669 .alloc_inode = hppfs_alloc_inode,
654 .destroy_inode = hppfs_destroy_inode, 670 .destroy_inode = hppfs_destroy_inode,
655 .read_inode = hppfs_read_inode,
656 .delete_inode = hppfs_delete_inode, 671 .delete_inode = hppfs_delete_inode,
657 .statfs = hppfs_statfs, 672 .statfs = hppfs_statfs,
658}; 673};
@@ -745,9 +760,11 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
745 sb->s_magic = HPPFS_SUPER_MAGIC; 760 sb->s_magic = HPPFS_SUPER_MAGIC;
746 sb->s_op = &hppfs_sbops; 761 sb->s_op = &hppfs_sbops;
747 762
748 root_inode = iget(sb, 0); 763 root_inode = hppfs_iget(sb);
749 if(root_inode == NULL) 764 if (IS_ERR(root_inode)) {
765 err = PTR_ERR(root_inode);
750 goto out; 766 goto out;
767 }
751 768
752 err = init_inode(root_inode, proc_sb->s_root); 769 err = init_inode(root_inode, proc_sb->s_root);
753 if(err) 770 if(err)