From: Alex Elder <aelder@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: XFS Mailing List <xfs@oss.sgi.com>
Subject: Re: [PATCH 10/11] xfs: clean up end index calculation in xfs_page_state_convert
Date: Thu, 29 Apr 2010 15:50:53 -0500 [thread overview]
Message-ID: <1272574253.3221.145.camel@doink> (raw)
In-Reply-To: <20100428123016.305118675@bombadil.infradead.org>
On Wed, 2010-04-28 at 08:29 -0400, Christoph Hellwig wrote:
> plain text document attachment (xfs-iomap-cleanup-11)
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Whoops, I think I responded twice to patch 9.
The whole series of 11 looks good.
Reviewed-by: Alex Elder <aelder@sgi.com>
> Index: xfs/fs/xfs/linux-2.6/xfs_aops.c
> ===================================================================
> --- xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2010-04-28 12:59:52.857024355 +0200
> +++ xfs/fs/xfs/linux-2.6/xfs_aops.c 2010-04-28 12:59:54.989003542 +0200
> @@ -1064,7 +1064,7 @@ xfs_page_state_convert(
> unsigned long p_offset = 0;
> unsigned int type;
> __uint64_t end_offset;
> - pgoff_t end_index, last_index, tlast;
> + pgoff_t end_index, last_index;
> ssize_t size, len;
> int flags, err, imap_valid = 0, uptodate = 1;
> int page_dirty, count = 0;
> @@ -1259,15 +1259,22 @@ xfs_page_state_convert(
> xfs_start_page_writeback(page, 1, count);
>
> if (ioend && imap_valid) {
> - struct xfs_mount *m = XFS_I(inode)->i_mount;
> - xfs_off_t iomap_offset = XFS_FSB_TO_B(m, imap.br_startoff);
> - xfs_off_t iomap_bsize = XFS_FSB_TO_B(m, imap.br_blockcount);
> -
> - offset = (iomap_offset + iomap_bsize - 1) >>
> - PAGE_CACHE_SHIFT;
> - tlast = min_t(pgoff_t, offset, last_index);
> + xfs_off_t end_index;
> +
> + end_index = imap.br_startoff + imap.br_blockcount;
> +
> + /* to bytes */
> + end_index <<= inode->i_blkbits;
> +
> + /* to pages */
> + end_index = (end_index - 1) >> PAGE_CACHE_SHIFT;
> +
> + /* check against file size */
> + if (end_index > last_index)
> + end_index = last_index;
> +
> xfs_cluster_write(inode, page->index + 1, &imap, &ioend,
> - wbc, startio, all_bh, tlast);
> + wbc, startio, all_bh, end_index);
> }
>
> if (iohead)
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-04-29 20:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-28 12:28 [PATCH 00/11] remove xfs_iomap Christoph Hellwig
2010-04-28 12:28 ` [PATCH 01/11] xfs: limit xfs_imap_to_bmap to a single mapping Christoph Hellwig
2010-04-29 13:55 ` Alex Elder
2010-04-28 12:28 ` [PATCH 02/11] xfs: remove iomap_target Christoph Hellwig
2010-04-29 14:25 ` Alex Elder
2010-04-28 12:28 ` [PATCH 03/11] xfs: remove iomap_delta Christoph Hellwig
2010-04-29 14:27 ` Alex Elder
2010-04-28 12:28 ` [PATCH 04/11] xfs: report iomap_offset and iomap_bsize in block base Christoph Hellwig
2010-04-29 14:32 ` Alex Elder
2010-04-28 12:28 ` [PATCH 05/11] xfs: report iomap_bn " Christoph Hellwig
2010-04-29 14:39 ` Alex Elder
2010-04-28 12:28 ` [PATCH 06/11] xfs: kill struct xfs_iomap Christoph Hellwig
2010-04-29 16:27 ` Alex Elder
2010-04-28 12:28 ` [PATCH 07/11] xfs: move I/O type flags into xfs_aops.c Christoph Hellwig
2010-04-29 20:07 ` Alex Elder
2010-04-28 12:28 ` [PATCH 08/11] xfs: clean up xfs_iomap_valid Christoph Hellwig
2010-04-29 20:15 ` Alex Elder
2010-04-28 12:28 ` [PATCH 09/11] xfs: clean up mapping size calculation in __xfs_get_blocks Christoph Hellwig
2010-04-29 20:26 ` Alex Elder
2010-04-29 20:32 ` Alex Elder
2010-04-28 12:29 ` [PATCH 10/11] xfs: clean up end index calculation in xfs_page_state_convert Christoph Hellwig
2010-04-29 20:50 ` Alex Elder [this message]
2010-04-28 12:29 ` [PATCH 11/11] xfs: mark xfs_iomap_write_ helpers static Christoph Hellwig
2010-04-29 20:37 ` Alex Elder
2010-04-29 0:21 ` [PATCH 00/11] remove xfs_iomap Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1272574253.3221.145.camel@doink \
--to=aelder@sgi.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox