aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 37ebe36056eb..d1c4dec51a3b 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -887,6 +887,41 @@ xfs_fs_inode_init_once(
887 inode_init_once((struct inode *)vnode); 887 inode_init_once((struct inode *)vnode);
888} 888}
889 889
890
891/*
892 * Slab object creation initialisation for the XFS inode.
893 * This covers only the idempotent fields in the XFS inode;
894 * all other fields need to be initialised on allocation
895 * from the slab. This avoids the need to repeatedly intialise
896 * fields in the xfs inode that left in the initialise state
897 * when freeing the inode.
898 */
899void
900xfs_inode_init_once(
901 kmem_zone_t *zone,
902 void *inode)
903{
904 struct xfs_inode *ip = inode;
905
906 memset(ip, 0, sizeof(struct xfs_inode));
907 atomic_set(&ip->i_iocount, 0);
908 atomic_set(&ip->i_pincount, 0);
909 spin_lock_init(&ip->i_flags_lock);
910 INIT_LIST_HEAD(&ip->i_reclaim);
911 init_waitqueue_head(&ip->i_ipin_wait);
912 /*
913 * Because we want to use a counting completion, complete
914 * the flush completion once to allow a single access to
915 * the flush completion without blocking.
916 */
917 init_completion(&ip->i_flush);
918 complete(&ip->i_flush);
919
920 mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
921 "xfsino", ip->i_ino);
922 mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino);
923}
924
890/* 925/*
891 * Attempt to flush the inode, this will actually fail 926 * Attempt to flush the inode, this will actually fail
892 * if the inode is pinned, but we dirty the inode again 927 * if the inode is pinned, but we dirty the inode again
@@ -2018,7 +2053,7 @@ xfs_init_zones(void)
2018 xfs_inode_zone = 2053 xfs_inode_zone =
2019 kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode", 2054 kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode",
2020 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | 2055 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
2021 KM_ZONE_SPREAD, NULL); 2056 KM_ZONE_SPREAD, xfs_inode_init_once);
2022 if (!xfs_inode_zone) 2057 if (!xfs_inode_zone)
2023 goto out_destroy_efi_zone; 2058 goto out_destroy_efi_zone;
2024 2059