fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / xfs / linux-2.6 / xfs_export.c
index 80eb249..5fb75d9 100644 (file)
 #include "xfs_log.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
-#include "xfs_dir.h"
 #include "xfs_mount.h"
 #include "xfs_export.h"
 
+STATIC struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
+
 /*
  * XFS encodes and decodes the fileid portion of NFS filehandles
  * itself instead of letting the generic NFS code do it.  This
@@ -37,7 +38,7 @@
  */
 
 STATIC struct dentry *
-linvfs_decode_fh(
+xfs_fs_decode_fh(
        struct super_block      *sb,
        __u32                   *fh,
        int                     fh_len,
@@ -78,12 +79,12 @@ linvfs_decode_fh(
        }
 
        fh = (__u32 *)&ifid;
-       return find_exported_dentry(sb, fh, parent, acceptable, context);
+       return sb->s_export_op->find_exported_dentry(sb, fh, parent, acceptable, context);
 }
 
 
 STATIC int
-linvfs_encode_fh(
+xfs_fs_encode_fh(
        struct dentry           *dentry,
        __u32                   *fh,
        int                     *max_len,
@@ -95,7 +96,7 @@ linvfs_encode_fh(
        int                     len;
        int                     is64 = 0;
 #if XFS_BIG_INUMS
-       vfs_t                   *vfs = LINVFS_GET_VFS(inode->i_sb);
+       bhv_vfs_t               *vfs = vfs_from_sb(inode->i_sb);
 
        if (!(vfs->vfs_flag & VFS_32BITINODES)) {
                /* filesystem may contain 64bit inode numbers */
@@ -130,21 +131,21 @@ linvfs_encode_fh(
 }
 
 STATIC struct dentry *
-linvfs_get_dentry(
+xfs_fs_get_dentry(
        struct super_block      *sb,
        void                    *data)
 {
-       vnode_t                 *vp;
+       bhv_vnode_t             *vp;
        struct inode            *inode;
        struct dentry           *result;
-       vfs_t                   *vfsp = LINVFS_GET_VFS(sb);
+       bhv_vfs_t               *vfsp = vfs_from_sb(sb);
        int                     error;
 
-       VFS_VGET(vfsp, &vp, (fid_t *)data, error);
+       error = bhv_vfs_vget(vfsp, &vp, (fid_t *)data);
        if (error || vp == NULL)
                return ERR_PTR(-ESTALE) ;
 
-       inode = LINVFS_GET_IP(vp);
+       inode = vn_to_inode(vp);
        result = d_alloc_anon(inode);
         if (!result) {
                iput(inode);
@@ -154,25 +155,20 @@ linvfs_get_dentry(
 }
 
 STATIC struct dentry *
-linvfs_get_parent(
+xfs_fs_get_parent(
        struct dentry           *child)
 {
        int                     error;
-       vnode_t                 *vp, *cvp;
+       bhv_vnode_t             *vp, *cvp;
        struct dentry           *parent;
-       struct dentry           dotdot;
-
-       dotdot.d_name.name = "..";
-       dotdot.d_name.len = 2;
-       dotdot.d_inode = NULL;
 
        cvp = NULL;
-       vp = LINVFS_GET_VP(child->d_inode);
-       VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error);
+       vp = vn_from_inode(child->d_inode);
+       error = bhv_vop_lookup(vp, &dotdot, &cvp, 0, NULL, NULL);
        if (unlikely(error))
                return ERR_PTR(-error);
 
-       parent = d_alloc_anon(LINVFS_GET_IP(cvp));
+       parent = d_alloc_anon(vn_to_inode(cvp));
        if (unlikely(!parent)) {
                VN_RELE(cvp);
                return ERR_PTR(-ENOMEM);
@@ -180,9 +176,9 @@ linvfs_get_parent(
        return parent;
 }
 
-struct export_operations linvfs_export_ops = {
-       .decode_fh              = linvfs_decode_fh,
-       .encode_fh              = linvfs_encode_fh,
-       .get_parent             = linvfs_get_parent,
-       .get_dentry             = linvfs_get_dentry,
+struct export_operations xfs_export_operations = {
+       .decode_fh              = xfs_fs_decode_fh,
+       .encode_fh              = xfs_fs_encode_fh,
+       .get_parent             = xfs_fs_get_parent,
+       .get_dentry             = xfs_fs_get_dentry,
 };