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 96912C433EF for ; Tue, 31 May 2022 06:22:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241079AbiEaGWe (ORCPT ); Tue, 31 May 2022 02:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237554AbiEaGWd (ORCPT ); Tue, 31 May 2022 02:22:33 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63CC244A3F; Mon, 30 May 2022 23:22:31 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 8364968AFE; Tue, 31 May 2022 08:22:27 +0200 (CEST) Date: Tue, 31 May 2022 08:22:27 +0200 From: Christoph Hellwig To: Damien Le Moal Cc: Keith Busch , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, axboe@kernel.dk, Kernel Team , hch@lst.de, bvanassche@acm.org, ebiggers@kernel.org, pankydev8@gmail.com, Keith Busch Subject: Re: [PATCHv4 5/9] block: add a helper function for dio alignment Message-ID: <20220531062227.GB21098@lst.de> References: <20220526010613.4016118-1-kbusch@fb.com> <20220526010613.4016118-6-kbusch@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Thu, May 26, 2022 at 10:54:02AM +0900, Damien Le Moal wrote: > Nit: The name of this helper really suggest a bool return, which would be a more > flexible interface I think: > > if (!blkdev_dio_aligned(bdev, pos, iter)) > return -EINVAL; <-- or whatever error code the caller wants. > > And that will allow you to get rid of the ret variable in a least > __blkdev_direct_IO_async. I agree, a bool return looks more natural here. Otherwise this looks good to me.