]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_super.c
[XFS] move root inode IRELE into xfs_unmountfs
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_super.c
index 27758409fc85b269c33db6f196cdc45dc0ff804c..9ccbb1ca277b74c0eca2b4cddf758a2b0b9ea993 100644 (file)
@@ -581,118 +581,6 @@ xfs_max_file_offset(
        return (((__uint64_t)pagefactor) << bitshift) - 1;
 }
 
-STATIC_INLINE void
-xfs_set_inodeops(
-       struct inode            *inode)
-{
-       switch (inode->i_mode & S_IFMT) {
-       case S_IFREG:
-               inode->i_op = &xfs_inode_operations;
-               inode->i_fop = &xfs_file_operations;
-               inode->i_mapping->a_ops = &xfs_address_space_operations;
-               break;
-       case S_IFDIR:
-               if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb))
-                       inode->i_op = &xfs_dir_ci_inode_operations;
-               else
-                       inode->i_op = &xfs_dir_inode_operations;
-               inode->i_fop = &xfs_dir_file_operations;
-               break;
-       case S_IFLNK:
-               inode->i_op = &xfs_symlink_inode_operations;
-               if (!(XFS_I(inode)->i_df.if_flags & XFS_IFINLINE))
-                       inode->i_mapping->a_ops = &xfs_address_space_operations;
-               break;
-       default:
-               inode->i_op = &xfs_inode_operations;
-               init_special_inode(inode, inode->i_mode, inode->i_rdev);
-               break;
-       }
-}
-
-STATIC_INLINE void
-xfs_revalidate_inode(
-       xfs_mount_t             *mp,
-       bhv_vnode_t             *vp,
-       xfs_inode_t             *ip)
-{
-       struct inode            *inode = vn_to_inode(vp);
-
-       inode->i_mode   = ip->i_d.di_mode;
-       inode->i_nlink  = ip->i_d.di_nlink;
-       inode->i_uid    = ip->i_d.di_uid;
-       inode->i_gid    = ip->i_d.di_gid;
-
-       switch (inode->i_mode & S_IFMT) {
-       case S_IFBLK:
-       case S_IFCHR:
-               inode->i_rdev =
-                       MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff,
-                             sysv_minor(ip->i_df.if_u2.if_rdev));
-               break;
-       default:
-               inode->i_rdev = 0;
-               break;
-       }
-
-       inode->i_generation = ip->i_d.di_gen;
-       i_size_write(inode, ip->i_d.di_size);
-       inode->i_atime.tv_sec   = ip->i_d.di_atime.t_sec;
-       inode->i_atime.tv_nsec  = ip->i_d.di_atime.t_nsec;
-       inode->i_mtime.tv_sec   = ip->i_d.di_mtime.t_sec;
-       inode->i_mtime.tv_nsec  = ip->i_d.di_mtime.t_nsec;
-       inode->i_ctime.tv_sec   = ip->i_d.di_ctime.t_sec;
-       inode->i_ctime.tv_nsec  = ip->i_d.di_ctime.t_nsec;
-       if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE)
-               inode->i_flags |= S_IMMUTABLE;
-       else
-               inode->i_flags &= ~S_IMMUTABLE;
-       if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
-               inode->i_flags |= S_APPEND;
-       else
-               inode->i_flags &= ~S_APPEND;
-       if (ip->i_d.di_flags & XFS_DIFLAG_SYNC)
-               inode->i_flags |= S_SYNC;
-       else
-               inode->i_flags &= ~S_SYNC;
-       if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME)
-               inode->i_flags |= S_NOATIME;
-       else
-               inode->i_flags &= ~S_NOATIME;
-       xfs_iflags_clear(ip, XFS_IMODIFIED);
-}
-
-void
-xfs_initialize_vnode(
-       struct xfs_mount        *mp,
-       bhv_vnode_t             *vp,
-       struct xfs_inode        *ip)
-{
-       struct inode            *inode = vn_to_inode(vp);
-
-       if (!ip->i_vnode) {
-               ip->i_vnode = vp;
-               inode->i_private = ip;
-       }
-
-       /*
-        * We need to set the ops vectors, and unlock the inode, but if
-        * we have been called during the new inode create process, it is
-        * too early to fill in the Linux inode.  We will get called a
-        * second time once the inode is properly set up, and then we can
-        * finish our work.
-        */
-       if (ip->i_d.di_mode != 0 && (inode->i_state & I_NEW)) {
-               xfs_revalidate_inode(mp, vp, ip);
-               xfs_set_inodeops(inode);
-
-               xfs_iflags_clear(ip, XFS_INEW);
-               barrier();
-
-               unlock_new_inode(inode);
-       }
-}
-
 int
 xfs_blkdev_get(
        xfs_mount_t             *mp,
@@ -982,26 +870,21 @@ STATIC struct inode *
 xfs_fs_alloc_inode(
        struct super_block      *sb)
 {
-       bhv_vnode_t             *vp;
-
-       vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
-       if (unlikely(!vp))
-               return NULL;
-       return vn_to_inode(vp);
+       return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
 }
 
 STATIC void
 xfs_fs_destroy_inode(
        struct inode            *inode)
 {
-       kmem_zone_free(xfs_vnode_zone, vn_from_inode(inode));
+       kmem_zone_free(xfs_vnode_zone, inode);
 }
 
 STATIC void
 xfs_fs_inode_init_once(
        void                    *vnode)
 {
-       inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
+       inode_init_once((struct inode *)vnode);
 }
 
 /*
@@ -1248,8 +1131,6 @@ xfs_fs_put_super(
        error = xfs_unmount_flush(mp, 0);
        WARN_ON(error);
 
-       IRELE(rip);
-
        /*
         * If we're forcing a shutdown, typically because of a media error,
         * we want to make sure we invalidate dirty pages that belong to
@@ -1921,8 +1802,6 @@ xfs_fs_fill_super(
        error = xfs_unmount_flush(mp, 0);
        WARN_ON(error);
 
-       IRELE(mp->m_rootip);
-
        xfs_unmountfs(mp);
        goto out_free_fsname;
 }
@@ -2045,7 +1924,7 @@ xfs_free_trace_bufs(void)
 STATIC int __init
 xfs_init_zones(void)
 {
-       xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode",
+       xfs_vnode_zone = kmem_zone_init_flags(sizeof(struct inode), "xfs_vnode",
                                        KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
                                        KM_ZONE_SPREAD,
                                        xfs_fs_inode_init_once);