Skip to content

Commit

Permalink
xfs: vectorise DA btree operations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Chinner authored and Ben Myers committed Oct 30, 2013
1 parent 4141956 commit 4bceb18
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 81 deletions.
3 changes: 2 additions & 1 deletion fs/xfs/xfs_attr_inactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "xfs_quota.h"
#include "xfs_trace.h"
#include "xfs_dinode.h"
#include "xfs_dir2.h"

/*
* Look at all the extents for this logical region,
Expand Down Expand Up @@ -236,7 +237,7 @@ xfs_attr3_node_inactive(
xfs_trans_brelse(*trans, bp);
return 0;
}
btree = xfs_da3_node_tree_p(node);
btree = dp->d_ops->node_tree_p(node);
child_fsb = be32_to_cpu(btree[0].before);
xfs_trans_brelse(*trans, bp); /* no locks for later trans */

Expand Down
3 changes: 2 additions & 1 deletion fs/xfs/xfs_attr_leaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "xfs_buf_item.h"
#include "xfs_cksum.h"
#include "xfs_dinode.h"
#include "xfs_dir2.h"


/*
Expand Down Expand Up @@ -916,7 +917,7 @@ xfs_attr3_leaf_to_node(
goto out;
node = bp1->b_addr;
xfs_da3_node_hdr_from_disk(&icnodehdr, node);
btree = xfs_da3_node_tree_p(node);
btree = dp->d_ops->node_tree_p(node);

leaf = bp2->b_addr;
xfs_attr3_leaf_hdr_from_disk(&icleafhdr, leaf);
Expand Down
11 changes: 6 additions & 5 deletions fs/xfs/xfs_attr_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "xfs_buf_item.h"
#include "xfs_cksum.h"
#include "xfs_dinode.h"
#include "xfs_dir2.h"

STATIC int
xfs_attr_shortform_compare(const void *a, const void *b)
Expand Down Expand Up @@ -226,6 +227,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
struct xfs_da_node_entry *btree;
int error, i;
struct xfs_buf *bp;
struct xfs_inode *dp = context->dp;

trace_xfs_attr_node_list(context);

Expand All @@ -239,7 +241,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
*/
bp = NULL;
if (cursor->blkno > 0) {
error = xfs_da3_node_read(NULL, context->dp, cursor->blkno, -1,
error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1,
&bp, XFS_ATTR_FORK);
if ((error != 0) && (error != EFSCORRUPTED))
return(error);
Expand Down Expand Up @@ -289,7 +291,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
for (;;) {
__uint16_t magic;

error = xfs_da3_node_read(NULL, context->dp,
error = xfs_da3_node_read(NULL, dp,
cursor->blkno, -1, &bp,
XFS_ATTR_FORK);
if (error)
Expand All @@ -310,7 +312,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
}

xfs_da3_node_hdr_from_disk(&nodehdr, node);
btree = xfs_da3_node_tree_p(node);
btree = dp->d_ops->node_tree_p(node);
for (i = 0; i < nodehdr.count; btree++, i++) {
if (cursor->hashval
<= be32_to_cpu(btree->hashval)) {
Expand Down Expand Up @@ -346,8 +348,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
break;
cursor->blkno = leafhdr.forw;
xfs_trans_brelse(NULL, bp);
error = xfs_attr3_leaf_read(NULL, context->dp, cursor->blkno, -1,
&bp);
error = xfs_attr3_leaf_read(NULL, dp, cursor->blkno, -1, &bp);
if (error)
return error;
}
Expand Down
Loading

0 comments on commit 4bceb18

Please sign in to comment.