- Update to 2.6.25-rc3.
[linux-flexiantxendom0-3.2.10.git] / fs / jfs / inode.c
index 4672013..2103397 100644 (file)
 #include "jfs_debug.h"
 
 
-void jfs_read_inode(struct inode *inode)
+struct inode *jfs_iget(struct super_block *sb, unsigned long ino)
 {
-       if (diRead(inode)) {
-               make_bad_inode(inode);
-               return;
+       struct inode *inode;
+       int ret;
+
+       inode = iget_locked(sb, ino);
+       if (!inode)
+               return ERR_PTR(-ENOMEM);
+       if (!(inode->i_state & I_NEW))
+               return inode;
+
+       ret = diRead(inode);
+       if (ret < 0) {
+               iget_failed(inode);
+               return ERR_PTR(ret);
        }
 
        if (S_ISREG(inode->i_mode)) {
@@ -55,6 +65,8 @@ void jfs_read_inode(struct inode *inode)
                inode->i_op = &jfs_file_inode_operations;
                init_special_inode(inode, inode->i_mode, inode->i_rdev);
        }
+       unlock_new_inode(inode);
+       return inode;
 }
 
 /*