]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jfs/namei.c
trm290: cannot call ide_setup_dma()
[linux-2.6-omap-h63xx.git] / fs / jfs / namei.c
index 25161c4121e4ba4f677bd1ed73abc8dcbc003d3d..f8718de3505e9fc56805b5a338fbb244c59e3488 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/fs.h>
 #include <linux/ctype.h>
 #include <linux/quotaops.h>
+#include <linux/exportfs.h>
 #include "jfs_incore.h"
 #include "jfs_superblock.h"
 #include "jfs_inode.h"
@@ -1102,8 +1103,8 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
         * Make sure dest inode number (if any) is what we think it is
         */
        rc = dtSearch(new_dir, &new_dname, &ino, &btstack, JFS_LOOKUP);
-       if (rc == 0) {
-               if ((new_ip == 0) || (ino != new_ip->i_ino)) {
+       if (!rc) {
+               if ((!new_ip) || (ino != new_ip->i_ino)) {
                        rc = -ESTALE;
                        goto out3;
                }
@@ -1477,6 +1478,40 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
        return dentry;
 }
 
+static struct inode *jfs_nfs_get_inode(struct super_block *sb,
+               u64 ino, u32 generation)
+{
+       struct inode *inode;
+
+       if (ino == 0)
+               return ERR_PTR(-ESTALE);
+       inode = iget(sb, ino);
+       if (inode == NULL)
+               return ERR_PTR(-ENOMEM);
+
+       if (is_bad_inode(inode) ||
+           (generation && inode->i_generation != generation)) {
+               iput(inode);
+               return ERR_PTR(-ESTALE);
+       }
+
+       return inode;
+}
+
+struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+               int fh_len, int fh_type)
+{
+       return generic_fh_to_dentry(sb, fid, fh_len, fh_type,
+                                   jfs_nfs_get_inode);
+}
+
+struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
+               int fh_len, int fh_type)
+{
+       return generic_fh_to_parent(sb, fid, fh_len, fh_type,
+                                   jfs_nfs_get_inode);
+}
+
 struct dentry *jfs_get_parent(struct dentry *dentry)
 {
        struct super_block *sb = dentry->d_inode->i_sb;