]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_attr_leaf.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / fs / xfs / xfs_attr_leaf.c
index e4071eb1e6cf78c4f97c3dabe87b030d569d516e..9455051f01208e61ae7d32cf9ab2cbad858d5fe7 100644 (file)
@@ -24,7 +24,6 @@
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
-#include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
@@ -34,7 +33,6 @@
 #include "xfs_ialloc_btree.h"
 #include "xfs_alloc.h"
 #include "xfs_btree.h"
-#include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
 #include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
@@ -524,7 +522,7 @@ xfs_attr_shortform_compare(const void *a, const void *b)
 
 /*
  * Copy out entries of shortform attribute lists for attr_list().
- * Shortform atrtribute lists are not stored in hashval sorted order.
+ * Shortform attribute lists are not stored in hashval sorted order.
  * If the output buffer is not large enough to hold them all, then we
  * we have to calculate each entries' hashvalue and sort them before
  * we can begin returning them to the user.
@@ -869,8 +867,8 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args)
        /* both on-disk, don't endian-flip twice */
        node->btree[0].hashval =
                leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval;
-       INT_SET(node->btree[0].before, ARCH_CONVERT, blkno);
-       INT_SET(node->hdr.count, ARCH_CONVERT, 1);
+       node->btree[0].before = cpu_to_be32(blkno);
+       node->hdr.count = cpu_to_be16(1);
        xfs_da_log_buf(args->trans, bp1, 0, XFS_LBSIZE(dp->i_mount) - 1);
        error = 0;
 out:
@@ -1541,7 +1539,7 @@ xfs_attr_leaf_toosmall(xfs_da_state_t *state, int *action)
        /*
         * Check for the degenerate case of the block being empty.
         * If the block is empty, we'll simply delete it, no need to
-        * coalesce it with a sibling block.  We choose (aribtrarily)
+        * coalesce it with a sibling block.  We choose (arbitrarily)
         * to merge with the forward block unless it is NULL.
         */
        if (count == 0) {
@@ -2804,12 +2802,12 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp,
        node = bp->data;
        ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC);
        parent_blkno = xfs_da_blkno(bp);        /* save for re-read later */
-       count = INT_GET(node->hdr.count, ARCH_CONVERT);
+       count = be16_to_cpu(node->hdr.count);
        if (!count) {
                xfs_da_brelse(*trans, bp);
                return(0);
        }
-       child_fsb = INT_GET(node->btree[0].before, ARCH_CONVERT);
+       child_fsb = be32_to_cpu(node->btree[0].before);
        xfs_da_brelse(*trans, bp);      /* no locks for later trans */
 
        /*
@@ -2869,7 +2867,7 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp,
                                &bp, XFS_ATTR_FORK);
                        if (error)
                                return(error);
-                       child_fsb = INT_GET(node->btree[i+1].before, ARCH_CONVERT);
+                       child_fsb = be32_to_cpu(node->btree[i+1].before);
                        xfs_da_brelse(*trans, bp);
                }
                /*
@@ -2938,11 +2936,9 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
                    ((entry->flags & XFS_ATTR_LOCAL) == 0)) {
                        name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
                        if (name_rmt->valueblk) {
-                               /* both on-disk, don't endian flip twice */
-                               lp->valueblk = name_rmt->valueblk;
-                               INT_SET(lp->valuelen, ARCH_CONVERT,
-                                               XFS_B_TO_FSB(dp->i_mount,
-                                                   be32_to_cpu(name_rmt->valuelen)));
+                               lp->valueblk = be32_to_cpu(name_rmt->valueblk);
+                               lp->valuelen = XFS_B_TO_FSB(dp->i_mount,
+                                                   be32_to_cpu(name_rmt->valuelen));
                                lp++;
                        }
                }
@@ -2955,10 +2951,8 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
        error = 0;
        for (lp = list, i = 0; i < count; i++, lp++) {
                tmp = xfs_attr_leaf_freextent(trans, dp,
-                                                    INT_GET(lp->valueblk,
-                                                               ARCH_CONVERT),
-                                                    INT_GET(lp->valuelen,
-                                                               ARCH_CONVERT));
+                               lp->valueblk, lp->valuelen);
+
                if (error == 0)
                        error = tmp;    /* save only the 1st errno */
        }
@@ -2994,7 +2988,7 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
                nmap = 1;
                error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt,
                                        XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
-                                       NULL, 0, &map, &nmap, NULL);
+                                       NULL, 0, &map, &nmap, NULL, NULL);
                if (error) {
                        return(error);
                }