xfs
[Top] [All Lists]

[PATCH 1/7] xfs: endianess annotation for xfs_agfl_t

To: nathans@xxxxxxx
Subject: [PATCH 1/7] xfs: endianess annotation for xfs_agfl_t
From: Christoph Hellwig <hch@xxxxxx>
Date: Mon, 10 Jul 2006 19:04:04 +0200
Cc: xfs@xxxxxxxxxxx
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
trivial, xfs_agfl_t is always used for ondisk values.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfs-2.6.x/fs/xfs/xfs_ag.h
===================================================================
--- xfs-2.6.x.orig/fs/xfs/xfs_ag.h      2006-07-09 19:28:15.000000000 +0200
+++ xfs-2.6.x/fs/xfs/xfs_ag.h   2006-07-09 19:34:47.000000000 +0200
@@ -150,7 +150,7 @@
 #define        XFS_BUF_TO_AGFL(bp)     ((xfs_agfl_t *)XFS_BUF_PTR(bp))
 
 typedef struct xfs_agfl {
-       xfs_agblock_t   agfl_bno[1];    /* actually XFS_AGFL_SIZE(mp) */
+       __be32          agfl_bno[1];    /* actually XFS_AGFL_SIZE(mp) */
 } xfs_agfl_t;
 
 /*
Index: xfs-2.6.x/fs/xfs/xfs_alloc.c
===================================================================
--- xfs-2.6.x.orig/fs/xfs/xfs_alloc.c   2006-07-09 19:28:15.000000000 +0200
+++ xfs-2.6.x/fs/xfs/xfs_alloc.c        2006-07-09 19:34:47.000000000 +0200
@@ -2011,7 +2011,7 @@
        /*
         * Get the block number and update the data structures.
         */
-       bno = INT_GET(agfl->agfl_bno[be32_to_cpu(agf->agf_flfirst)], 
ARCH_CONVERT);
+       bno = be32_to_cpu(agfl->agfl_bno[be32_to_cpu(agf->agf_flfirst)]);
        be32_add(&agf->agf_flfirst, 1);
        xfs_trans_brelse(tp, agflbp);
        if (be32_to_cpu(agf->agf_flfirst) == XFS_AGFL_SIZE(mp))
@@ -2098,7 +2098,7 @@
 {
        xfs_agf_t               *agf;   /* a.g. freespace structure */
        xfs_agfl_t              *agfl;  /* a.g. free block array */
-       xfs_agblock_t           *blockp;/* pointer to array entry */
+       __be32                  *blockp;/* pointer to array entry */
        int                     error;
 #ifdef XFS_ALLOC_TRACE
        static char             fname[] = "xfs_alloc_put_freelist";
@@ -2122,7 +2122,7 @@
        pag->pagf_flcount++;
        ASSERT(be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp));
        blockp = &agfl->agfl_bno[be32_to_cpu(agf->agf_fllast)];
-       INT_SET(*blockp, ARCH_CONVERT, bno);
+       *blockp = cpu_to_be32(bno);
        TRACE_MODAGF(NULL, agf, XFS_AGF_FLLAST | XFS_AGF_FLCOUNT);
        xfs_alloc_log_agf(tp, agbp, XFS_AGF_FLLAST | XFS_AGF_FLCOUNT);
        xfs_trans_log_buf(tp, agflbp,


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 1/7] xfs: endianess annotation for xfs_agfl_t, Christoph Hellwig <=