fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / ocfs2 / export.c
index 5810160..56e1fef 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "dir.h"
 #include "dlmglue.h"
+#include "dcache.h"
 #include "export.h"
 #include "inode.h"
 
@@ -57,16 +58,13 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, void *vobjp)
                return ERR_PTR(-ESTALE);
        }
 
-       inode = ocfs2_iget(OCFS2_SB(sb), handle->ih_blkno);
+       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);
        }
 
@@ -77,6 +75,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, void *vobjp)
                mlog_errno(-ENOMEM);
                return ERR_PTR(-ENOMEM);
        }
+       result->d_op = &ocfs2_dentry_ops;
 
        mlog_exit_ptr(result);
        return result;
@@ -95,10 +94,10 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
        mlog_entry("(0x%p, '%.*s')\n", child,
                   child->d_name.len, child->d_name.name);
 
-       mlog(0, "find parent of directory %"MLFu64"\n",
-            OCFS2_I(dir)->ip_blkno);
+       mlog(0, "find parent of directory %llu\n",
+            (unsigned long long)OCFS2_I(dir)->ip_blkno);
 
-       status = ocfs2_meta_lock(dir, NULL, NULL, 0);
+       status = ocfs2_meta_lock(dir, NULL, 0);
        if (status < 0) {
                if (status != -ENOENT)
                        mlog_errno(status);
@@ -113,9 +112,10 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
                goto bail_unlock;
        }
 
-       inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno);
+       inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0);
        if (IS_ERR(inode)) {
-               mlog(ML_ERROR, "Unable to create inode %"MLFu64"\n", blkno);
+               mlog(ML_ERROR, "Unable to create inode %llu\n",
+                    (unsigned long long)blkno);
                parent = ERR_PTR(-EACCES);
                goto bail_unlock;
        }
@@ -126,6 +126,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
                parent = ERR_PTR(-ENOMEM);
        }
 
+       parent->d_op = &ocfs2_dentry_ops;
+
 bail_unlock:
        ocfs2_meta_unlock(dir, 0);
 
@@ -160,8 +162,8 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
        blkno = OCFS2_I(inode)->ip_blkno;
        generation = inode->i_generation;
 
-       mlog(0, "Encoding fh: blkno: %"MLFu64", generation: %u\n",
-            blkno, generation);
+       mlog(0, "Encoding fh: blkno: %llu, generation: %u\n",
+            (unsigned long long)blkno, generation);
 
        len = 3;
        fh[0] = cpu_to_le32((u32)(blkno >> 32));
@@ -186,8 +188,8 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
                len = 6;
                type = 2;
 
-               mlog(0, "Encoding parent: blkno: %"MLFu64", generation: %u\n",
-                    blkno, generation);
+               mlog(0, "Encoding parent: blkno: %llu, generation: %u\n",
+                    (unsigned long long)blkno, generation);
        }
        
        *max_len = len;
@@ -220,16 +222,17 @@ static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh,
                parent.ih_blkno |= (u64)le32_to_cpu(fh[4]);
                parent.ih_generation = le32_to_cpu(fh[5]);
 
-               mlog(0, "Decoding parent: blkno: %"MLFu64", generation: %u\n",
-                    parent.ih_blkno, parent.ih_generation);
+               mlog(0, "Decoding parent: blkno: %llu, generation: %u\n",
+                    (unsigned long long)parent.ih_blkno,
+                    parent.ih_generation);
        }
 
        handle.ih_blkno = (u64)le32_to_cpu(fh[0]) << 32;
        handle.ih_blkno |= (u64)le32_to_cpu(fh[1]);
        handle.ih_generation = le32_to_cpu(fh[2]);
 
-       mlog(0, "Encoding fh: blkno: %"MLFu64", generation: %u\n",
-            handle.ih_blkno, handle.ih_generation);
+       mlog(0, "Encoding fh: blkno: %llu, generation: %u\n",
+            (unsigned long long)handle.ih_blkno, handle.ih_generation);
 
        ret = ocfs2_export_ops.find_exported_dentry(sb, &handle, &parent,
                                                    acceptable, context);