All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/6] Btrfs: use bio_clone_bioset_partial to simplify DIO submit
Date: Tue, 16 May 2017 11:15:53 -0600	[thread overview]
Message-ID: <20170516171552.GB11826@localhost.localdomain> (raw)
In-Reply-To: <20170516143737.GA24541@infradead.org>

On Tue, May 16, 2017 at 07:37:37AM -0700, Christoph Hellwig wrote:
> >  }
> >  
> > +struct bio *btrfs_bio_clone_partial(struct bio *orig, gfp_t gfp_mask, int offset, int size)
> > +{
> > +	struct bio *bio;
> > +
> > +	bio = bio_clone_fast(orig, gfp_mask, btrfs_bioset);
> > +	if (bio) {
> 
> bio_clone_fast will never fail when backed by a bioset, which this
> one always is.  Also you always pass GFP_NPFS as the gfp_mask argument,
> it might make sense to hardcode that here.
> 

I see.

> > +		struct btrfs_io_bio *btrfs_bio = btrfs_io_bio(bio);
> > +		btrfs_bio->csum = NULL;
> > +		btrfs_bio->csum_allocated = NULL;
> > +		btrfs_bio->end_io = NULL;
> > +
> > +		bio_trim(bio, (offset >> 9), (size >> 9));
> 
> No need for the inner braces here.
> 
> Last but not least do you even need this as a separate helper?
> 

Not necessary indeed, but I need to access %btrfs_bioset which is
'static' defined in extent_io.c

> > +struct bio *btrfs_bio_clone_partial(struct bio *orig, gfp_t gfp_mask, int offset, int size);
> 
> Over long line, please trim to 80 characters

OK, fixed.

Thanks for the comments.

Thanks,

-liubo

  reply	other threads:[~2017-05-16 18:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  1:16 [PATCH 0/6 RFC] utilize bio_clone_fast to clean up Liu Bo
2017-04-18  1:16 ` [PATCH 1/6] Btrfs: use bio_clone_fast to clone our bio Liu Bo
2017-05-17 17:53   ` David Sterba
2017-04-18  1:16 ` [PATCH 2/6] Btrfs: use bio_clone_bioset_partial to simplify DIO submit Liu Bo
2017-05-11 14:16   ` David Sterba
2017-05-16 14:37   ` Christoph Hellwig
2017-05-16 17:15     ` Liu Bo [this message]
2017-04-18  1:16 ` [PATCH 3/6] Btrfs: change how we iterate bios in endio Liu Bo
2017-04-18  1:16 ` [PATCH 4/6] Btrfs: record error if one block has failed to retry Liu Bo
2017-05-17 18:32   ` David Sterba
2017-04-18  1:16 ` [PATCH 5/6] Btrfs: change check-integrity to use bvec_iter Liu Bo
2017-05-05 17:13   ` David Sterba
2017-04-18  1:16 ` [PATCH 6/6] Btrfs: unify naming of btrfs_io_bio Liu Bo
2017-05-17 18:32   ` David Sterba
2017-05-05 14:24 ` [PATCH 0/6 RFC] utilize bio_clone_fast to clean up David Sterba
2017-05-09 22:49   ` Liu Bo
2017-05-10  4:28     ` Liu Bo
2017-05-10 17:53     ` David Sterba

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=20170516171552.GB11826@localhost.localdomain \
    --to=bo.li.liu@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.