diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:36:05 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:36:05 -0400 |
commit | 69ef921b55cc3788d1d2a27b33b27d04acd0090a (patch) | |
tree | bcc7c1f4b7f15628f122dfdb96f8d4d37f587e92 /fs/xfs/xfs_log.c | |
parent | 218106a1104c598011e5df9d9aac7e0416be03e6 (diff) |
xfs: byteswap constants instead of variables
Micro-optimize various comparisms by always byteswapping the constant
instead of the variable, which allows to do the swap at compile instead
of runtime.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 41d5b8f2bf92..5b24a71811f8 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -3521,13 +3521,13 @@ xlog_verify_iclog(xlog_t *log, | |||
3521 | spin_unlock(&log->l_icloglock); | 3521 | spin_unlock(&log->l_icloglock); |
3522 | 3522 | ||
3523 | /* check log magic numbers */ | 3523 | /* check log magic numbers */ |
3524 | if (be32_to_cpu(iclog->ic_header.h_magicno) != XLOG_HEADER_MAGIC_NUM) | 3524 | if (iclog->ic_header.h_magicno != cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) |
3525 | xfs_emerg(log->l_mp, "%s: invalid magic num", __func__); | 3525 | xfs_emerg(log->l_mp, "%s: invalid magic num", __func__); |
3526 | 3526 | ||
3527 | ptr = (xfs_caddr_t) &iclog->ic_header; | 3527 | ptr = (xfs_caddr_t) &iclog->ic_header; |
3528 | for (ptr += BBSIZE; ptr < ((xfs_caddr_t)&iclog->ic_header) + count; | 3528 | for (ptr += BBSIZE; ptr < ((xfs_caddr_t)&iclog->ic_header) + count; |
3529 | ptr += BBSIZE) { | 3529 | ptr += BBSIZE) { |
3530 | if (be32_to_cpu(*(__be32 *)ptr) == XLOG_HEADER_MAGIC_NUM) | 3530 | if (*(__be32 *)ptr == cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) |
3531 | xfs_emerg(log->l_mp, "%s: unexpected magic num", | 3531 | xfs_emerg(log->l_mp, "%s: unexpected magic num", |
3532 | __func__); | 3532 | __func__); |
3533 | } | 3533 | } |