From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B510C2D0EB for ; Mon, 30 Mar 2020 06:28:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51AE120732 for ; Mon, 30 Mar 2020 06:28:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qF8rnTCq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729178AbgC3G2L (ORCPT ); Mon, 30 Mar 2020 02:28:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50132 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgC3G2L (ORCPT ); Mon, 30 Mar 2020 02:28:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CAVk4o7a9QdE9f5V4Rob2eu2jcOd66eTyjHi8aMLFJM=; b=qF8rnTCqYw1CmyXWeEB8U/VHeQ XumxbijNgxczjzUD7L0LAqp/ww3lgm+Ye59Di8yB/bkzXvBFwDT80jEFEoXu/+2Ksvpva91VQl3SC 2qtkTcuRHBfO/qtfxRN6TuVphJQPWBkSL7mMCltfE00kTI8S9vGvhreOor/Rco6yLiodc0WAAj4PZ 2foGx/iMTT7SrCR5nOIdsWuW+x4hgK4soR+xdmtOJ3JFnkcEa6cnsskdsFvVUXb6ncwS54bWKpS0A 08aTAZ6FCaK5nhzBoNhJc9ar9BOsR5PQVYX1VjjMsKaSd2VdSgbBwYoWe+L1CImI+62ILlFEZFsTq 669dqpPA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jInu1-000667-R8; Mon, 30 Mar 2020 06:28:05 +0000 Date: Sun, 29 Mar 2020 23:28:05 -0700 From: "hch@infradead.org" To: Chaitanya Kulkarni Cc: "hch@infradead.org" , Bart Van Assche , Jack Wang , "linux-block@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "axboe@kernel.dk" , "sagi@grimberg.me" , "leon@kernel.org" , "dledford@redhat.com" , "jgg@ziepe.ca" , "danil.kipnis@cloud.ionos.com" , "rpenyaev@suse.de" , "pankaj.gupta@cloud.ionos.com" Subject: Re: [PATCH v11 15/26] block: reexport bio_map_kern Message-ID: <20200330062805.GA21989@infradead.org> References: <20200320121657.1165-1-jinpu.wang@cloud.ionos.com> <20200320121657.1165-16-jinpu.wang@cloud.ionos.com> <15f25902-1f5a-a542-a311-c1e86330834b@acm.org> <20200328082953.GB16355@infradead.org> <20200329150524.GA13909@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Sun, Mar 29, 2020 at 06:08:31PM +0000, Chaitanya Kulkarni wrote: > > which bio_map_kerl is the wrong interfac given that it > > uses bio_add_pc_page. Read, write and other non-passthrough requests > > must use bio_add_page instead. > > > > Since rw are most common operations, it'd be nice to have a helper > function for REQ_OP_[READ|WRITE] to map and submit bio from data buffer > with chaining to avoid code duplication in each driver which based on > the bio_add_page(). > > I'd be happy to send a patch for that if that is acceptable. Well, there aren't a whole lot of driver submitting bios - it's mostly file systems, and those often use shared code and/or have very specific requirements. I've started to factor some reasonably common code into self-contained helpers with recent XFS work: xlog_map_iclog_data and xfs_rw_bdev. Both could probably move to the block layer with a little more work, but we'll have to be careful and actually find enough suitable users.