]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/export.c
fuse: clean up open file passing in setattr
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / export.c
index 06be6e774cf943e08c41b616fc2d99ceb17efc11..c3bbc198f9ce66d6a0c4bf2b02bb581932e12ee1 100644 (file)
@@ -60,14 +60,11 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, void *vobjp)
 
        inode = ocfs2_iget(OCFS2_SB(sb), handle->ih_blkno, 0);
 
-       if (IS_ERR(inode)) {
-               mlog_errno(PTR_ERR(inode));
+       if (IS_ERR(inode))
                return (void *)inode;
-       }
 
        if (handle->ih_generation != inode->i_generation) {
                iput(inode);
-               mlog_errno(-ESTALE);
                return ERR_PTR(-ESTALE);
        }
 
@@ -91,8 +88,6 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
        struct dentry *parent;
        struct inode *inode;
        struct inode *dir = child->d_inode;
-       struct buffer_head *dirent_bh = NULL;
-       struct ocfs2_dir_entry *dirent;
 
        mlog_entry("(0x%p, '%.*s')\n", child,
                   child->d_name.len, child->d_name.name);
@@ -108,8 +103,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
                goto bail;
        }
 
-       status = ocfs2_find_files_on_disk("..", 2, &blkno, dir, &dirent_bh,
-                                         &dirent);
+       status = ocfs2_lookup_ino_from_name(dir, "..", 2, &blkno);
        if (status < 0) {
                parent = ERR_PTR(-ENOENT);
                goto bail_unlock;
@@ -134,16 +128,13 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
 bail_unlock:
        ocfs2_meta_unlock(dir, 0);
 
-       if (dirent_bh)
-               brelse(dirent_bh);
-
 bail:
        mlog_exit_ptr(parent);
 
        return parent;
 }
 
-static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
+static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
                           int connectable)
 {
        struct inode *inode = dentry->d_inode;
@@ -151,6 +142,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
        int type = 1;
        u64 blkno;
        u32 generation;
+       __le32 *fh = (__force __le32 *) fh_in;
 
        mlog_entry("(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry,
                   dentry->d_name.len, dentry->d_name.name,
@@ -202,7 +194,7 @@ bail:
        return type;
 }
 
-static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh,
+static struct dentry *ocfs2_decode_fh(struct super_block *sb, u32 *fh_in,
                                      int fh_len, int fileid_type,
                                      int (*acceptable)(void *context,
                                                        struct dentry *de),
@@ -210,6 +202,7 @@ static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh,
 {
        struct ocfs2_inode_handle handle, parent;
        struct dentry *ret = NULL;
+       __le32 *fh = (__force __le32 *) fh_in;
 
        mlog_entry("(0x%p, 0x%p, %d, %d, 0x%p, 0x%p)\n",
                   sb, fh, fh_len, fileid_type, acceptable, context);