aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_leaf.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_leaf.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_leaf.c')
-rw-r--r--fs/xfs/xfs_dir2_leaf.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 51fdc11a1e2c..dd195363ccf2 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -500,7 +500,7 @@ xfs_dir2_block_to_leaf(
500 hdr->magic = cpu_to_be32(XFS_DIR3_DATA_MAGIC); 500 hdr->magic = cpu_to_be32(XFS_DIR3_DATA_MAGIC);
501 501
502 if (needscan) 502 if (needscan)
503 xfs_dir2_data_freescan(mp, hdr, &needlog); 503 xfs_dir2_data_freescan(dp, hdr, &needlog);
504 /* 504 /*
505 * Set up leaf tail and bests table. 505 * Set up leaf tail and bests table.
506 */ 506 */
@@ -700,7 +700,7 @@ xfs_dir2_leaf_addname(
700 ents = xfs_dir3_leaf_ents_p(leaf); 700 ents = xfs_dir3_leaf_ents_p(leaf);
701 xfs_dir3_leaf_hdr_from_disk(&leafhdr, leaf); 701 xfs_dir3_leaf_hdr_from_disk(&leafhdr, leaf);
702 bestsp = xfs_dir2_leaf_bests_p(ltp); 702 bestsp = xfs_dir2_leaf_bests_p(ltp);
703 length = xfs_dir3_data_entsize(mp, args->namelen); 703 length = dp->d_ops->data_entsize(args->namelen);
704 704
705 /* 705 /*
706 * See if there are any entries with the same hash value 706 * See if there are any entries with the same hash value
@@ -901,20 +901,20 @@ xfs_dir2_leaf_addname(
901 dep->inumber = cpu_to_be64(args->inumber); 901 dep->inumber = cpu_to_be64(args->inumber);
902 dep->namelen = args->namelen; 902 dep->namelen = args->namelen;
903 memcpy(dep->name, args->name, dep->namelen); 903 memcpy(dep->name, args->name, dep->namelen);
904 xfs_dir3_dirent_put_ftype(mp, dep, args->filetype); 904 dp->d_ops->data_put_ftype(dep, args->filetype);
905 tagp = xfs_dir3_data_entry_tag_p(mp, dep); 905 tagp = dp->d_ops->data_entry_tag_p(dep);
906 *tagp = cpu_to_be16((char *)dep - (char *)hdr); 906 *tagp = cpu_to_be16((char *)dep - (char *)hdr);
907 /* 907 /*
908 * Need to scan fix up the bestfree table. 908 * Need to scan fix up the bestfree table.
909 */ 909 */
910 if (needscan) 910 if (needscan)
911 xfs_dir2_data_freescan(mp, hdr, &needlog); 911 xfs_dir2_data_freescan(dp, hdr, &needlog);
912 /* 912 /*
913 * Need to log the data block's header. 913 * Need to log the data block's header.
914 */ 914 */
915 if (needlog) 915 if (needlog)
916 xfs_dir2_data_log_header(tp, dbp); 916 xfs_dir2_data_log_header(tp, dbp);
917 xfs_dir2_data_log_entry(tp, dbp, dep); 917 xfs_dir2_data_log_entry(tp, dp, dbp, dep);
918 /* 918 /*
919 * If the bests table needs to be changed, do it. 919 * If the bests table needs to be changed, do it.
920 * Log the change unless we've already done that. 920 * Log the change unless we've already done that.
@@ -1230,7 +1230,7 @@ xfs_dir2_leaf_lookup(
1230 * Return the found inode number & CI name if appropriate 1230 * Return the found inode number & CI name if appropriate
1231 */ 1231 */
1232 args->inumber = be64_to_cpu(dep->inumber); 1232 args->inumber = be64_to_cpu(dep->inumber);
1233 args->filetype = xfs_dir3_dirent_get_ftype(dp->i_mount, dep); 1233 args->filetype = dp->d_ops->data_get_ftype(dep);
1234 error = xfs_dir_cilookup_result(args, dep->name, dep->namelen); 1234 error = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
1235 xfs_trans_brelse(tp, dbp); 1235 xfs_trans_brelse(tp, dbp);
1236 xfs_trans_brelse(tp, lbp); 1236 xfs_trans_brelse(tp, lbp);
@@ -1433,7 +1433,7 @@ xfs_dir2_leaf_removename(
1433 */ 1433 */
1434 xfs_dir2_data_make_free(tp, dbp, 1434 xfs_dir2_data_make_free(tp, dbp,
1435 (xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr), 1435 (xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr),
1436 xfs_dir3_data_entsize(mp, dep->namelen), &needlog, &needscan); 1436 dp->d_ops->data_entsize(dep->namelen), &needlog, &needscan);
1437 /* 1437 /*
1438 * We just mark the leaf entry stale by putting a null in it. 1438 * We just mark the leaf entry stale by putting a null in it.
1439 */ 1439 */
@@ -1449,7 +1449,7 @@ xfs_dir2_leaf_removename(
1449 * log the data block header if necessary. 1449 * log the data block header if necessary.
1450 */ 1450 */
1451 if (needscan) 1451 if (needscan)
1452 xfs_dir2_data_freescan(mp, hdr, &needlog); 1452 xfs_dir2_data_freescan(dp, hdr, &needlog);
1453 if (needlog) 1453 if (needlog)
1454 xfs_dir2_data_log_header(tp, dbp); 1454 xfs_dir2_data_log_header(tp, dbp);
1455 /* 1455 /*
@@ -1561,9 +1561,9 @@ xfs_dir2_leaf_replace(
1561 * Put the new inode number in, log it. 1561 * Put the new inode number in, log it.
1562 */ 1562 */
1563 dep->inumber = cpu_to_be64(args->inumber); 1563 dep->inumber = cpu_to_be64(args->inumber);
1564 xfs_dir3_dirent_put_ftype(dp->i_mount, dep, args->filetype); 1564 dp->d_ops->data_put_ftype(dep, args->filetype);
1565 tp = args->trans; 1565 tp = args->trans;
1566 xfs_dir2_data_log_entry(tp, dbp, dep); 1566 xfs_dir2_data_log_entry(tp, dp, dbp, dep);
1567 xfs_dir3_leaf_check(dp->i_mount, lbp); 1567 xfs_dir3_leaf_check(dp->i_mount, lbp);
1568 xfs_trans_brelse(tp, lbp); 1568 xfs_trans_brelse(tp, lbp);
1569 return 0; 1569 return 0;