linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chandra Seetharaman <sekharan@us.ibm.com>
To: dsterba@suse.cz
Cc: saeed bishara <saeed.bishara@gmail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/7] btrfs: subpagesize-blocksize: Use a global alignment for size
Date: Mon, 16 Dec 2013 10:18:38 -0600	[thread overview]
Message-ID: <1387210718.4241.215.camel@chandra-dt.ibm.com> (raw)
In-Reply-To: <20131216144830.GF6498@twin.jikos.cz>

On Mon, 2013-12-16 at 15:48 +0100, David Sterba wrote:
> On Mon, Dec 16, 2013 at 02:33:11PM +0200, saeed bishara wrote:
> > On Thu, Dec 12, 2013 at 1:38 AM, Chandra Seetharaman
> > <sekharan@us.ibm.com> wrote:
> > > In order to handle a blocksize that is smaller than the
> > > PAGE_SIZE, we need align all IOs to PAGE_SIZE.
> > >
> > > This patch defines a new macro btrfs_align_size() that
> > > calculates the alignment size based on the sectorsize
> > > and uses it at appropriate places.
> > >
> > > Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> > > ---
> > >  fs/btrfs/btrfs_inode.h  |  7 +++++++
> > >  fs/btrfs/compression.c  |  3 ++-
> > >  fs/btrfs/extent-tree.c  | 12 ++++++------
> > >  fs/btrfs/extent_io.c    | 17 ++++++-----------
> > >  fs/btrfs/file.c         | 15 +++++++--------
> > >  fs/btrfs/inode.c        | 41 ++++++++++++++++++++++-------------------
> > >  fs/btrfs/ioctl.c        |  6 +++---
> > >  fs/btrfs/ordered-data.c |  2 +-
> > >  fs/btrfs/tree-log.c     |  2 +-
> > >  9 files changed, 55 insertions(+), 50 deletions(-)
> > >
> > > diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
> > > index ac0b39d..eee994f 100644
> > > --- a/fs/btrfs/btrfs_inode.h
> > > +++ b/fs/btrfs/btrfs_inode.h
> > > @@ -280,4 +280,11 @@ static inline void btrfs_inode_resume_unlocked_dio(struct inode *inode)
> > >                   &BTRFS_I(inode)->runtime_flags);
> > >  }
> > >
> > > +static inline u64 btrfs_align_size(struct inode *inode)
> > > +{
> > > +       if (BTRFS_I(inode)->root->sectorsize < PAGE_CACHE_SIZE)
> > > +               return (u64)PAGE_CACHE_SIZE;
> > > +       else
> > > +               return (u64)BTRFS_I(inode)->root->sectorsize;
> > > +}
> > for performance, isn't it worth to store this value instead of
> > calculating it each time?

Good suggestion Saeed. will do
> 
> I agree, would be better to add the corresponding item into fs_info,
> initialized as proposed above.

Godd idea David. will do.
> 



  reply	other threads:[~2013-12-16 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 23:38 [PATCH 0/7] Patches to support subpagesize blocksize Chandra Seetharaman
2013-12-11 23:38 ` [PATCH 1/7] btrfs: subpagesize-blocksize: Define extent_buffer_head Chandra Seetharaman
2013-12-16 12:32   ` saeed bishara
2013-12-16 16:17     ` Chandra Seetharaman
2013-12-17 15:35       ` David Sterba
2013-12-11 23:38 ` [PATCH 2/7] btrfs: subpagesize-blocksize: Use a global alignment for size Chandra Seetharaman
2013-12-16 12:33   ` saeed bishara
2013-12-16 14:48     ` David Sterba
2013-12-16 16:18       ` Chandra Seetharaman [this message]
2013-12-11 23:38 ` [PATCH 3/7] btrfs: subpagesize-blocksize: Handle small extent maps properly Chandra Seetharaman
2013-12-11 23:38 ` [PATCH 4/7] btrfs: subpagesize-blocksize: Handle iosize properly in submit_extent_page() Chandra Seetharaman
2013-12-11 23:38 ` [PATCH 5/7] btrfs: subpagesize-blocksize: handle checksum calculations properly Chandra Seetharaman
2013-12-11 23:38 ` [PATCH 6/7] btrfs: subpagesize-blocksize: Handle relocation clusters appropriately Chandra Seetharaman
2013-12-11 23:38 ` [PATCH 7/7] btrfs: subpagesize-blocksize: Allow mounting filesystems where sectorsize != PAGE_SIZE Chandra Seetharaman
2013-12-13  1:07   ` David Sterba
2013-12-16 12:50     ` saeed bishara
2013-12-12 20:40 ` [PATCH 0/7] Patches to support subpagesize blocksize Josef Bacik
2013-12-13  1:17 ` David Sterba
2013-12-13 15:17   ` Chandra Seetharaman
2013-12-13 15:58     ` David Sterba
2013-12-13 18:39 ` Josef Bacik
2013-12-13 22:09   ` Chandra Seetharaman
2014-01-08 20:06   ` Chandra Seetharaman

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=1387210718.4241.215.camel@chandra-dt.ibm.com \
    --to=sekharan@us.ibm.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=saeed.bishara@gmail.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;
as well as URLs for NNTP newsgroup(s).