From patchwork Thu Nov 21 18:00:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 293209 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7B4602C00C6 for ; Fri, 22 Nov 2013 05:00:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211Ab3KUSAy (ORCPT ); Thu, 21 Nov 2013 13:00:54 -0500 Received: from mailgw1.uni-kl.de ([131.246.120.220]:37970 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373Ab3KUSAy (ORCPT ); Thu, 21 Nov 2013 13:00:54 -0500 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-9.4) with ESMTP id rALI0pcR023151 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Thu, 21 Nov 2013 19:00:51 +0100 Received: from mail2.itwm.fhg.de ([131.246.191.79]:48022) by itwm2.itwm.fhg.de with esmtps (TLSv1:DES-CBC3-SHA:168) (/C=DE/ST=Bayern/L=Muenchen/O=Fraunhofer/OU=ITWM/OU=Services/CN=smtp.itwm.fraunhofer.de)(verified=1) (Exim 4.74 #1) id 1VjYYb-000790-At; Thu, 21 Nov 2013 19:00:49 +0100 Message-ID: <528E4A50.7040609@itwm.fraunhofer.de> Date: Thu, 21 Nov 2013 19:00:48 +0100 From: Bernd Schubert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: fsdevel@fhgfs.com, xfs@oss.sgi.com, linux-ext4@vger.kernel.org CC: Kent Overstreet , NeilBrown , Jens Axboe Subject: bio_add_page rw mode check by merge_bvec_fn X-ITWM-CharSet: UTF-8 X-ITWM-Scanned-By: mail2.itwm.fhg.de Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi all, raid5_mergeable_bvec() (q->merge_bvec_fn) checks for the rw-type and makes decisions based on that if the bio is mergable or not. But so far this value is only initialized on calling submit_bio(), at least not by ext4 and xfs. I have not checked other file system so far. Question 1: merge_bvec_fn is supposed to be removed, is is still worth to fix the usage of merge_bvec_fn? Question 2: If it is still supposed to be fixed, how do want to have it? So far I have two patches for xfs and ext4 to set the rw type directly there, but maybe bio_add_page should get an int rw_type parameter and set bio->bi_rw itself? Thanks, Bernd --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index d488f80..4cddc15 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -370,6 +370,7 @@ static int io_submit_init_bio(struct ext4_io_submit *io, bio->bi_bdev = bh->b_bdev; bio->bi_end_io = ext4_end_bio; bio->bi_private = ext4_get_io_end(io->io_end); + bio->bi_rw |= io->io_op; io->io_bio = bio; io->io_next_block = bh->b_blocknr; return 0; diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 71c8c9d..b48048f 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -401,7 +401,8 @@ xfs_submit_ioend_bio( STATIC struct bio * xfs_alloc_ioend_bio( - struct buffer_head *bh) + struct buffer_head *bh, + struct writeback_control *wbc) { int nvecs = bio_get_nr_vecs(bh->b_bdev); struct bio *bio = bio_alloc(GFP_NOIO, nvecs); @@ -409,6 +410,7 @@ xfs_alloc_ioend_bio( ASSERT(bio->bi_private == NULL); bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9); bio->bi_bdev = bh->b_bdev; + bio->bi_rw |= (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE; return bio; } @@ -511,7 +513,8 @@ xfs_submit_ioend( if (!bio) { retry: - bio = xfs_alloc_ioend_bio(bh); + bio = xfs_alloc_ioend_bio(bh, wbc); + } else if (bh->b_blocknr != lastblock + 1) { xfs_submit_ioend_bio(wbc, ioend, bio); goto retry;