xfs
[Top] [All Lists]

[PATCH] xfs: clean up xlog_align

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfs: clean up xlog_align
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 10 May 2010 13:28:14 -0400
User-agent: Mutt/1.5.19 (2009-01-05)
Add suggested cleanups to commit 29db3370a1369541d58d692fbfb168b8a0bd7f41
from review that didn't end up being commited.

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

Index: xfs/fs/xfs/xfs_log_recover.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log_recover.c   2010-05-10 19:12:01.539262194 +0200
+++ xfs/fs/xfs/xfs_log_recover.c        2010-05-10 19:14:52.295255420 +0200
@@ -132,15 +132,10 @@ xlog_align(
        int             nbblks,
        xfs_buf_t       *bp)
 {
-       xfs_daddr_t     offset;
-       xfs_caddr_t     ptr;
+       xfs_daddr_t     offset = blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1);
 
-       offset = blk_no & ((xfs_daddr_t) log->l_sectBBsize - 1);
-       ptr = XFS_BUF_PTR(bp) + BBTOB(offset);
-
-       ASSERT(ptr + BBTOB(nbblks) <= XFS_BUF_PTR(bp) + XFS_BUF_SIZE(bp));
-
-       return ptr;
+       ASSERT(BBTOB(offset + nbblks) <= XFS_BUF_SIZE(bp));
+       return XFS_BUF_PTR(bp) + BBTOB(offset);
 }
 
 

<Prev in Thread] Current Thread [Next in Thread>