]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_btree.h
NFS: Fix a typo in nfs_call_unlink()
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_btree.h
index 44f1bd98064a49d04916366c921db35dbf508493..6e40a0a198ffd19a1da3750e6d1cd6746e8414ef 100644 (file)
@@ -122,13 +122,13 @@ extern const __uint32_t   xfs_magics[];
  * Given block size, type prefix, block pointer, and index of requested entry
  * (first entry numbered 1).
  */
-#define        XFS_BTREE_REC_ADDR(bsz,t,bb,i,mxr)      \
+#define        XFS_BTREE_REC_ADDR(t,bb,i)      \
        ((t ## _rec_t *)((char *)(bb) + sizeof(t ## _block_t) + \
         ((i) - 1) * sizeof(t ## _rec_t)))
-#define        XFS_BTREE_KEY_ADDR(bsz,t,bb,i,mxr)      \
+#define        XFS_BTREE_KEY_ADDR(t,bb,i)      \
        ((t ## _key_t *)((char *)(bb) + sizeof(t ## _block_t) + \
         ((i) - 1) * sizeof(t ## _key_t)))
-#define        XFS_BTREE_PTR_ADDR(bsz,t,bb,i,mxr)      \
+#define        XFS_BTREE_PTR_ADDR(t,bb,i,mxr)  \
        ((t ## _ptr_t *)((char *)(bb) + sizeof(t ## _block_t) + \
         (mxr) * sizeof(t ## _key_t) + ((i) - 1) * sizeof(t ## _ptr_t)))
 
@@ -145,7 +145,7 @@ typedef struct xfs_btree_cur
        union {
                xfs_alloc_rec_incore_t  a;
                xfs_bmbt_irec_t         b;
-               xfs_inobt_rec_t         i;
+               xfs_inobt_rec_incore_t  i;
        }               bc_rec;         /* current insert/search record value */
        struct xfs_buf  *bc_bufs[XFS_BTREE_MAXLEVELS];  /* buf ptr per level */
        int             bc_ptrs[XFS_BTREE_MAXLEVELS];   /* key/record # */
@@ -243,6 +243,9 @@ xfs_btree_check_lptr(
        xfs_dfsbno_t            ptr,    /* btree block disk address */
        int                     level); /* btree block level */
 
+#define xfs_btree_check_lptr_disk(cur, ptr, level) \
+       xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level)
+
 /*
  * Checking routine: check that short form block header is ok.
  */
@@ -441,30 +444,14 @@ xfs_btree_setbuf(
 /*
  * Min and max functions for extlen, agblock, fileoff, and filblks types.
  */
-#define        XFS_EXTLEN_MIN(a,b)     \
-       ((xfs_extlen_t)(a) < (xfs_extlen_t)(b) ? \
-               (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
-#define        XFS_EXTLEN_MAX(a,b)     \
-       ((xfs_extlen_t)(a) > (xfs_extlen_t)(b) ? \
-               (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
-#define        XFS_AGBLOCK_MIN(a,b)    \
-       ((xfs_agblock_t)(a) < (xfs_agblock_t)(b) ? \
-               (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
-#define        XFS_AGBLOCK_MAX(a,b)    \
-       ((xfs_agblock_t)(a) > (xfs_agblock_t)(b) ? \
-               (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
-#define        XFS_FILEOFF_MIN(a,b)    \
-       ((xfs_fileoff_t)(a) < (xfs_fileoff_t)(b) ? \
-               (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
-#define        XFS_FILEOFF_MAX(a,b)    \
-       ((xfs_fileoff_t)(a) > (xfs_fileoff_t)(b) ? \
-               (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
-#define        XFS_FILBLKS_MIN(a,b)    \
-       ((xfs_filblks_t)(a) < (xfs_filblks_t)(b) ? \
-               (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
-#define        XFS_FILBLKS_MAX(a,b)    \
-       ((xfs_filblks_t)(a) > (xfs_filblks_t)(b) ? \
-               (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
+#define        XFS_EXTLEN_MIN(a,b)     min_t(xfs_extlen_t, (a), (b))
+#define        XFS_EXTLEN_MAX(a,b)     max_t(xfs_extlen_t, (a), (b))
+#define        XFS_AGBLOCK_MIN(a,b)    min_t(xfs_agblock_t, (a), (b))
+#define        XFS_AGBLOCK_MAX(a,b)    max_t(xfs_agblock_t, (a), (b))
+#define        XFS_FILEOFF_MIN(a,b)    min_t(xfs_fileoff_t, (a), (b))
+#define        XFS_FILEOFF_MAX(a,b)    max_t(xfs_fileoff_t, (a), (b))
+#define        XFS_FILBLKS_MIN(a,b)    min_t(xfs_filblks_t, (a), (b))
+#define        XFS_FILBLKS_MAX(a,b)    max_t(xfs_filblks_t, (a), (b))
 
 #define        XFS_FSB_SANITY_CHECK(mp,fsb)    \
        (XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \