Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_attr_leaf.c
index b3d5c35b604756f3fc2c3e1614fb517ac724cd24..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);
                }
                /*
@@ -2990,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);
                }