aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2013-10-29 07:11:51 -0400
committerBen Myers <bpm@sgi.com>2013-10-30 14:43:28 -0400
commit4bceb18f1551c8c047eeb54d48cda9f5453dc12f (patch)
tree913bd230913f0a09e7131af633985b7b55c6d891 /fs/xfs/xfs_dir2.c
parent4141956ae05e0685b14b30f92fdc8fb11b4a0cb2 (diff)
xfs: vectorise DA btree operations
The remaining non-vectorised code for the directory structure is the node format blocks. This is shared with the attribute tree, and so is slightly more complex to vectorise. Introduce a "non-directory" directory ops structure that is attached to all non-directory inodes so that attribute operations can be vectorised for all inodes. Once we do this, we can vectorise all the da btree operations. Because this patch adds more infrastructure than it removes the binary size does not decrease: text data bss dec hex filename 794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2.c')
-rw-r--r--fs/xfs/xfs_dir2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index 2b98a33ca383..1b44e83924b7 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -95,13 +95,17 @@ xfs_dir_mount(
95 ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb)); 95 ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb));
96 ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <= 96 ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
97 XFS_MAX_BLOCKSIZE); 97 XFS_MAX_BLOCKSIZE);
98
99 mp->m_dir_inode_ops = xfs_dir_get_ops(mp, NULL);
100 mp->m_nondir_inode_ops = xfs_nondir_get_ops(mp, NULL);
101
98 mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog); 102 mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog);
99 mp->m_dirblkfsbs = 1 << mp->m_sb.sb_dirblklog; 103 mp->m_dirblkfsbs = 1 << mp->m_sb.sb_dirblklog;
100 mp->m_dirdatablk = xfs_dir2_db_to_da(mp, XFS_DIR2_DATA_FIRSTDB(mp)); 104 mp->m_dirdatablk = xfs_dir2_db_to_da(mp, XFS_DIR2_DATA_FIRSTDB(mp));
101 mp->m_dirleafblk = xfs_dir2_db_to_da(mp, XFS_DIR2_LEAF_FIRSTDB(mp)); 105 mp->m_dirleafblk = xfs_dir2_db_to_da(mp, XFS_DIR2_LEAF_FIRSTDB(mp));
102 mp->m_dirfreeblk = xfs_dir2_db_to_da(mp, XFS_DIR2_FREE_FIRSTDB(mp)); 106 mp->m_dirfreeblk = xfs_dir2_db_to_da(mp, XFS_DIR2_FREE_FIRSTDB(mp));
103 107
104 nodehdr_size = __xfs_da3_node_hdr_size(xfs_sb_version_hascrc(&mp->m_sb)); 108 nodehdr_size = mp->m_dir_inode_ops->node_hdr_size();
105 mp->m_attr_node_ents = (mp->m_sb.sb_blocksize - nodehdr_size) / 109 mp->m_attr_node_ents = (mp->m_sb.sb_blocksize - nodehdr_size) /
106 (uint)sizeof(xfs_da_node_entry_t); 110 (uint)sizeof(xfs_da_node_entry_t);
107 mp->m_dir_node_ents = (mp->m_dirblksize - nodehdr_size) / 111 mp->m_dir_node_ents = (mp->m_dirblksize - nodehdr_size) /
@@ -113,7 +117,6 @@ xfs_dir_mount(
113 else 117 else
114 mp->m_dirnameops = &xfs_default_nameops; 118 mp->m_dirnameops = &xfs_default_nameops;
115 119
116 mp->m_dir_inode_ops = xfs_dir_get_ops(mp, NULL);
117} 120}
118 121
119/* 122/*