linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: do not reset bio->bi_ops while writing bio
@ 2017-08-23 18:15 Liu Bo
  2017-08-24 14:10 ` Christoph Hellwig
  2017-09-06 14:42 ` David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Liu Bo @ 2017-08-23 18:15 UTC (permalink / raw)
  To: linux-btrfs

flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC,
but it's not needed at all since bio->bi_ops has set up properly in
both __extent_writepage() and write_one_eb(), and in the case of
write_one_eb(), it also sets REQ_META, which we will lose in
flush_epd_write_bio().

This remove this unnecessary bio->bi_ops setting.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/extent_io.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b61d68f..a454a10 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4054,9 +4054,6 @@ static void flush_epd_write_bio(struct extent_page_data *epd)
 	if (epd->bio) {
 		int ret;
 
-		bio_set_op_attrs(epd->bio, REQ_OP_WRITE,
-				 epd->sync_io ? REQ_SYNC : 0);
-
 		ret = submit_one_bio(epd->bio, 0, 0);
 		BUG_ON(ret < 0); /* -ENOMEM */
 		epd->bio = NULL;
-- 
2.9.4


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

* Re: [PATCH] Btrfs: do not reset bio->bi_ops while writing bio
  2017-08-23 18:15 [PATCH] Btrfs: do not reset bio->bi_ops while writing bio Liu Bo
@ 2017-08-24 14:10 ` Christoph Hellwig
  2017-08-24 18:04   ` Liu Bo
  2017-09-06 14:42 ` David Sterba
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2017-08-24 14:10 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Wed, Aug 23, 2017 at 12:15:09PM -0600, Liu Bo wrote:
> flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC,
> but it's not needed at all since bio->bi_ops has set up properly in
> both __extent_writepage() and write_one_eb(), and in the case of
> write_one_eb(), it also sets REQ_META, which we will lose in
> flush_epd_write_bio().
> 
> This remove this unnecessary bio->bi_ops setting.

Nitpick: it's bi_op, not bi_ops.

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

* Re: [PATCH] Btrfs: do not reset bio->bi_ops while writing bio
  2017-08-24 14:10 ` Christoph Hellwig
@ 2017-08-24 18:04   ` Liu Bo
  2017-08-25  7:46     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Bo @ 2017-08-24 18:04 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-btrfs

On Thu, Aug 24, 2017 at 07:10:41AM -0700, Christoph Hellwig wrote:
> On Wed, Aug 23, 2017 at 12:15:09PM -0600, Liu Bo wrote:
> > flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC,
> > but it's not needed at all since bio->bi_ops has set up properly in
> > both __extent_writepage() and write_one_eb(), and in the case of
> > write_one_eb(), it also sets REQ_META, which we will lose in
> > flush_epd_write_bio().
> > 
> > This remove this unnecessary bio->bi_ops setting.
> 
> Nitpick: it's bi_op, not bi_ops.

Ah thanks, it's bio->bi_opf ;)

thanks,
-liubo

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

* Re: [PATCH] Btrfs: do not reset bio->bi_ops while writing bio
  2017-08-24 18:04   ` Liu Bo
@ 2017-08-25  7:46     ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2017-08-25  7:46 UTC (permalink / raw)
  To: Liu Bo; +Cc: Christoph Hellwig, linux-btrfs

On Thu, Aug 24, 2017 at 11:04:40AM -0700, Liu Bo wrote:
> On Thu, Aug 24, 2017 at 07:10:41AM -0700, Christoph Hellwig wrote:
> > On Wed, Aug 23, 2017 at 12:15:09PM -0600, Liu Bo wrote:
> > > flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC,
> > > but it's not needed at all since bio->bi_ops has set up properly in
> > > both __extent_writepage() and write_one_eb(), and in the case of
> > > write_one_eb(), it also sets REQ_META, which we will lose in
> > > flush_epd_write_bio().
> > > 
> > > This remove this unnecessary bio->bi_ops setting.
> > 
> > Nitpick: it's bi_op, not bi_ops.
> 
> Ah thanks, it's bio->bi_opf ;)

Heh.  Of course..

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

* Re: [PATCH] Btrfs: do not reset bio->bi_ops while writing bio
  2017-08-23 18:15 [PATCH] Btrfs: do not reset bio->bi_ops while writing bio Liu Bo
  2017-08-24 14:10 ` Christoph Hellwig
@ 2017-09-06 14:42 ` David Sterba
  1 sibling, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-09-06 14:42 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Wed, Aug 23, 2017 at 12:15:09PM -0600, Liu Bo wrote:
> flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC,
> but it's not needed at all since bio->bi_ops has set up properly in
> both __extent_writepage() and write_one_eb(), and in the case of
> write_one_eb(), it also sets REQ_META, which we will lose in
> flush_epd_write_bio().
> 
> This remove this unnecessary bio->bi_ops setting.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.com>

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

end of thread, other threads:[~2017-09-06 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-23 18:15 [PATCH] Btrfs: do not reset bio->bi_ops while writing bio Liu Bo
2017-08-24 14:10 ` Christoph Hellwig
2017-08-24 18:04   ` Liu Bo
2017-08-25  7:46     ` Christoph Hellwig
2017-09-06 14:42 ` David Sterba

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).