public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: clean up xlog_align
@ 2010-05-10 17:28 Christoph Hellwig
  2010-05-10 18:15 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2010-05-10 17:28 UTC (permalink / raw)
  To: xfs

Add suggested cleanups to commit 29db3370a1369541d58d692fbfb168b8a0bd7f41
from review that didn't end up being commited.

Signed-off-by: Christoph Hellwig <hch@lst.de>

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);
 }
 
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: clean up xlog_align
  2010-05-10 17:28 [PATCH] xfs: clean up xlog_align Christoph Hellwig
@ 2010-05-10 18:15 ` Alex Elder
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Elder @ 2010-05-10 18:15 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Mon, 2010-05-10 at 13:28 -0400, Christoph Hellwig wrote:
> Add suggested cleanups to commit 29db3370a1369541d58d692fbfb168b8a0bd7f41
> from review that didn't end up being commited.

Whoops.  I said I was going to change it to be that
way but I guess that didn't happen.  Sorry about that.

I do like this way better.

> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Alex Elder <aelder@sgi.com>

> 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(


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-10 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10 17:28 [PATCH] xfs: clean up xlog_align Christoph Hellwig
2010-05-10 18:15 ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox