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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B00CCC433FE for ; Mon, 4 Apr 2022 04:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377204AbiDDEyg (ORCPT ); Mon, 4 Apr 2022 00:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377287AbiDDEyU (ORCPT ); Mon, 4 Apr 2022 00:54:20 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99F153B299; Sun, 3 Apr 2022 21:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=b5rvgKHQBrxUjxrXC1n/6ZmRlGY5pOrxtPmT3z1PEjc=; b=SlZcwtx7AAAee889K+zl49LOb9 oV6PrhY+KekPy01nguN00WX7mhZwuYAm38m0y6xm2BW33Wz8fASnXyAdwPNQt5wbQdvfLdIhjZmdc wmMfGoqckxzjpwJVo7iY9EIHrDYxEpJug//AV/69EiHp07dx72GjnnAl5l6DRHH01+lxPTBfjLItY 8h5XY1wF2I4AbmO2ndxmfnQkKtWWJL/9VGeG2SgFOuBkqsUzz82z4VyeKRaYBu0nP35uRzZffOFpq i/4soywdERhe1oWmrVjnNpdJ7QQB1+hsg95r5wpBH1I/sJyngnq8q2Hwwx0mHUoo80mTAR34+RKr6 1Ku5c33Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbEh8-00D5Dg-TI; Mon, 04 Apr 2022 04:52:02 +0000 Date: Sun, 3 Apr 2022 21:52:02 -0700 From: Christoph Hellwig To: "Yuezhang.Mo@sony.com" Cc: Namjae Jeon , "sj1557.seo@samsung.com" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" , "axboe@kernel.dk" , Christoph Hellwig Subject: Re: [PATCH v2 1/2] block: add sync_blockdev_range() Message-ID: References: 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 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Apr 02, 2022 at 03:28:00AM +0000, Yuezhang.Mo@sony.com wrote: > sync_blockdev_range() is to support syncing multiple sectors > with as few block device requests as possible, it is helpful > to make the block device to give full play to its performance. > > Signed-off-by: Yuezhang Mo > Suggested-by: Christoph Hellwig > Reviewed-by: Andy Wu > Reviewed-by: Aoyama Wataru > cc: Jens Axboe > --- > block/bdev.c | 10 ++++++++++ > include/linux/blkdev.h | 6 ++++++ > 2 files changed, 16 insertions(+) > > diff --git a/block/bdev.c b/block/bdev.c > index 102837a37051..57043e4f3322 100644 > --- a/block/bdev.c > +++ b/block/bdev.c > @@ -200,6 +200,16 @@ int sync_blockdev(struct block_device *bdev) > } > EXPORT_SYMBOL(sync_blockdev); > > +int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend) > +{ > + if (!bdev) > + return 0; This check isn't really needed, and I don't think we need a !CONFIG_BLOCK stub for this either.