]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jfs/namei.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6-omap-h63xx.git] / fs / jfs / namei.c
index 0ba6778edaa2ae73d9595d8f425c7d3e98dce7a7..cc3cedffbfa11d69b4c6b5bb4b4a5ab96e99dc4c 100644 (file)
@@ -1455,7 +1455,7 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
                free_UCSname(&key);
                if (rc == -ENOENT) {
                        d_add(dentry, NULL);
-                       return ERR_PTR(0);
+                       return NULL;
                } else if (rc) {
                        jfs_err("jfs_lookup: dtSearch returned %d", rc);
                        return ERR_PTR(rc);
@@ -1511,25 +1511,12 @@ struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
 
 struct dentry *jfs_get_parent(struct dentry *dentry)
 {
-       struct super_block *sb = dentry->d_inode->i_sb;
-       struct dentry *parent = ERR_PTR(-ENOENT);
-       struct inode *inode;
        unsigned long parent_ino;
 
        parent_ino =
                le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
-       inode = jfs_iget(sb, parent_ino);
-       if (IS_ERR(inode)) {
-               parent = ERR_CAST(inode);
-       } else {
-               parent = d_alloc_anon(inode);
-               if (!parent) {
-                       parent = ERR_PTR(-ENOMEM);
-                       iput(inode);
-               }
-       }
 
-       return parent;
+       return d_obtain_alias(jfs_iget(dentry->d_inode->i_sb, parent_ino));
 }
 
 const struct inode_operations jfs_dir_inode_operations = {
@@ -1560,6 +1547,7 @@ const struct file_operations jfs_dir_operations = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl   = jfs_compat_ioctl,
 #endif
+       .llseek         = generic_file_llseek,
 };
 
 static int jfs_ci_hash(struct dentry *dir, struct qstr *this)