From: Daniel Phillips <phillips@phunq.net>
To: Cong Meng <mcpacino@gmail.com>
Cc: Nick Piggin <npiggin@kernel.dk>,
linux-kernel@vger.kernel.org, dm-devel@redhat.com,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: introduce dm-snap-mv
Date: Thu, 7 Oct 2010 14:31:14 -0700 [thread overview]
Message-ID: <201010071431.14937.phillips@phunq.net> (raw)
In-Reply-To: <20101006083150.GA15758@zhongling>
Hi Meng,
The patch looks sensible, however the question is: why do you want to
do this? Would it not be better to generalize your metadata format to
accomodate the device's native blocksize?
Regards,
Daniel
> a kernel patch
> --------------
> Now, dm-snap-mv highly depends on a kernel patch below, which make __getblk()
> can get a 4K buffer head while block size of the disk is NOT 4K.
>
> Signed-off-by: Cong Meng <mcpacino@gmail.com>
> ---
> fs/buffer.c | 7 ++-----
> 1 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 3e7dca2..f7f9d33 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1051,10 +1051,7 @@ grow_buffers(struct block_device *bdev, sector_t block, int size)
> pgoff_t index;
> int sizebits;
>
> - sizebits = -1;
> - do {
> - sizebits++;
> - } while ((size << sizebits) < PAGE_SIZE);
> + sizebits = PAGE_CACHE_SHIFT - bdev->bd_inode->i_blkbits;
>
> index = block >> sizebits;
>
> @@ -2924,7 +2921,7 @@ int submit_bh(int rw, struct buffer_head * bh)
> */
> bio = bio_alloc(GFP_NOIO, 1);
>
> - bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
> + bio->bi_sector = bh->b_blocknr << (bh->b_bdev->bd_inode->i_blkbits - 9);
> bio->bi_bdev = bh->b_bdev;
> bio->bi_io_vec[0].bv_page = bh->b_page;
> bio->bi_io_vec[0].bv_len = bh->b_size;
next prev parent reply other threads:[~2010-10-07 21:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-06 8:31 introduce dm-snap-mv Cong Meng
2010-10-07 21:31 ` Daniel Phillips [this message]
2010-10-08 8:22 ` Christoph Hellwig
2010-10-08 9:14 ` McPacino
2010-10-08 9:24 ` Christoph Hellwig
2010-10-08 9:28 ` McPacino
2010-10-08 13:22 ` Daniel Phillips
2010-10-13 16:45 ` McPacino
2010-10-08 9:01 ` McPacino
2010-10-19 19:58 ` [dm-devel] " Mikulas Patocka
2010-11-06 3:24 ` Daniel Phillips
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=201010071431.14937.phillips@phunq.net \
--to=phillips@phunq.net \
--cc=akpm@linux-foundation.org \
--cc=dm-devel@redhat.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcpacino@gmail.com \
--cc=npiggin@kernel.dk \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).