aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_node.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-10-29 07:11:48 -0400
committerBen Myers <bpm@sgi.com>2013-10-30 14:39:14 -0400
commit9d23fc8575de7012b8853bd6fefe10534665de2f (patch)
tree6dab547e4e967349aaa48bca5d64e0055a32508d /fs/xfs/xfs_dir2_node.c
parent4740175e75f70ab71f76ae98ab00f7db731a48f7 (diff)
xfs: vectorise directory data operations
Following from the initial patches to vectorise the shortform directory encode/decode operations, convert half the data block operations to use the vector. The rest will be done in a second patch. This further reduces the size of the built binary: 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 Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/xfs_dir2_node.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index b8381646b8af..a1d133981c14 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -604,7 +604,7 @@ xfs_dir2_leafn_lookup_for_addname(
604 ASSERT(free->hdr.magic == cpu_to_be32(XFS_DIR2_FREE_MAGIC) || 604 ASSERT(free->hdr.magic == cpu_to_be32(XFS_DIR2_FREE_MAGIC) ||
605 free->hdr.magic == cpu_to_be32(XFS_DIR3_FREE_MAGIC)); 605 free->hdr.magic == cpu_to_be32(XFS_DIR3_FREE_MAGIC));
606 } 606 }
607 length = xfs_dir3_data_entsize(mp, args->namelen); 607 length = dp->d_ops->data_entsize(args->namelen);
608 /* 608 /*
609 * Loop over leaf entries with the right hash value. 609 * Loop over leaf entries with the right hash value.
610 */ 610 */
@@ -815,7 +815,7 @@ xfs_dir2_leafn_lookup_for_entry(
815 xfs_trans_brelse(tp, state->extrablk.bp); 815 xfs_trans_brelse(tp, state->extrablk.bp);
816 args->cmpresult = cmp; 816 args->cmpresult = cmp;
817 args->inumber = be64_to_cpu(dep->inumber); 817 args->inumber = be64_to_cpu(dep->inumber);
818 args->filetype = xfs_dir3_dirent_get_ftype(mp, dep); 818 args->filetype = dp->d_ops->data_get_ftype(dep);
819 *indexp = index; 819 *indexp = index;
820 state->extravalid = 1; 820 state->extravalid = 1;
821 state->extrablk.bp = curbp; 821 state->extrablk.bp = curbp;
@@ -1259,13 +1259,13 @@ xfs_dir2_leafn_remove(
1259 longest = be16_to_cpu(bf[0].length); 1259 longest = be16_to_cpu(bf[0].length);
1260 needlog = needscan = 0; 1260 needlog = needscan = 0;
1261 xfs_dir2_data_make_free(tp, dbp, off, 1261 xfs_dir2_data_make_free(tp, dbp, off,
1262 xfs_dir3_data_entsize(mp, dep->namelen), &needlog, &needscan); 1262 dp->d_ops->data_entsize(dep->namelen), &needlog, &needscan);
1263 /* 1263 /*
1264 * Rescan the data block freespaces for bestfree. 1264 * Rescan the data block freespaces for bestfree.
1265 * Log the data block header if needed. 1265 * Log the data block header if needed.
1266 */ 1266 */
1267 if (needscan) 1267 if (needscan)
1268 xfs_dir2_data_freescan(mp, hdr, &needlog); 1268 xfs_dir2_data_freescan(dp, hdr, &needlog);
1269 if (needlog) 1269 if (needlog)
1270 xfs_dir2_data_log_header(tp, dbp); 1270 xfs_dir2_data_log_header(tp, dbp);
1271 xfs_dir3_data_check(dp, dbp); 1271 xfs_dir3_data_check(dp, dbp);
@@ -1711,7 +1711,7 @@ xfs_dir2_node_addname_int(
1711 dp = args->dp; 1711 dp = args->dp;
1712 mp = dp->i_mount; 1712 mp = dp->i_mount;
1713 tp = args->trans; 1713 tp = args->trans;
1714 length = xfs_dir3_data_entsize(mp, args->namelen); 1714 length = dp->d_ops->data_entsize(args->namelen);
1715 /* 1715 /*
1716 * If we came in with a freespace block that means that lookup 1716 * If we came in with a freespace block that means that lookup
1717 * found an entry with our hash value. This is the freespace 1717 * found an entry with our hash value. This is the freespace
@@ -2007,15 +2007,15 @@ xfs_dir2_node_addname_int(
2007 dep->inumber = cpu_to_be64(args->inumber); 2007 dep->inumber = cpu_to_be64(args->inumber);
2008 dep->namelen = args->namelen; 2008 dep->namelen = args->namelen;
2009 memcpy(dep->name, args->name, dep->namelen); 2009 memcpy(dep->name, args->name, dep->namelen);
2010 xfs_dir3_dirent_put_ftype(mp, dep, args->filetype); 2010 dp->d_ops->data_put_ftype(dep, args->filetype);
2011 tagp = xfs_dir3_data_entry_tag_p(mp, dep); 2011 tagp = dp->d_ops->data_entry_tag_p(dep);
2012 *tagp = cpu_to_be16((char *)dep - (char *)hdr); 2012 *tagp = cpu_to_be16((char *)dep - (char *)hdr);
2013 xfs_dir2_data_log_entry(tp, dbp, dep); 2013 xfs_dir2_data_log_entry(tp, dp, dbp, dep);
2014 /* 2014 /*
2015 * Rescan the block for bestfree if needed. 2015 * Rescan the block for bestfree if needed.
2016 */ 2016 */
2017 if (needscan) 2017 if (needscan)
2018 xfs_dir2_data_freescan(mp, hdr, &needlog); 2018 xfs_dir2_data_freescan(dp, hdr, &needlog);
2019 /* 2019 /*
2020 * Log the data block header if needed. 2020 * Log the data block header if needed.
2021 */ 2021 */
@@ -2228,8 +2228,9 @@ xfs_dir2_node_replace(
2228 * Fill in the new inode number and log the entry. 2228 * Fill in the new inode number and log the entry.
2229 */ 2229 */
2230 dep->inumber = cpu_to_be64(inum); 2230 dep->inumber = cpu_to_be64(inum);
2231 xfs_dir3_dirent_put_ftype(state->mp, dep, args->filetype); 2231 args->dp->d_ops->data_put_ftype(dep, args->filetype);
2232 xfs_dir2_data_log_entry(args->trans, state->extrablk.bp, dep); 2232 xfs_dir2_data_log_entry(args->trans, args->dp,
2233 state->extrablk.bp, dep);
2233 rval = 0; 2234 rval = 0;
2234 } 2235 }
2235 /* 2236 /*