Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp786416imi; Fri, 22 Jul 2022 09:26:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s9RIOzBWFsSozDWUDeuRFiUQFb3J1jdqeAh0CK8H3r4l+IXMBzxDidx8M9YM1gL6j2sHon X-Received: by 2002:a65:6a05:0:b0:3db:27cb:9123 with SMTP id m5-20020a656a05000000b003db27cb9123mr464395pgu.497.1658507208007; Fri, 22 Jul 2022 09:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658507208; cv=none; d=google.com; s=arc-20160816; b=FZpmX7KBKeYplg9HN7AcvohJpZzgy1qaMzzBweqLk/RhBegg7Q3ZLjyRPjIuFH4zWt CFgGTIeno2c1TrJMqKE/lXlukeg+TxApeuN7lKd4XuYGYXYT4pkXL9krIGiKIJuxgDpp VyXei9NVXy0Lupw8EbjD2+v2n57thZyd3q4mxYL/sNDN1CSNP5HvkXbFPtjd/2Pvp/J5 wOdgUmS+iM72Uy5/s8xHesmUjCLFK1FMVW4Q/6ZPytprTqh8IKwSfRWQ52oMkq1NxkIu lMhp4TXSGDmTjsDs+pJE0wlng+VqMRbnEvFKkeLoFk2zjvk41VTKzdgGwCK9Gqw4tPiZ 08UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sYdK5Po1dlw7EwssP5lS20P2VrCndDaBOTyFsmk21f4=; b=EPAcwu0XZ8v9PHI5fq/0qJorhSnptRiAy54PvdFCxVhxrY77MJJAelMM9btpGdmxZu g6ZyNb+VjMwBE1J4o8Y8qinBBKdiCbvv/Py89QtjvB2pVb31kUpmqkEaM4fhuIGs3rU3 vqt/8uFqo+csP9k3XHkimgOxK6qJYi4eWFCdzz4DAoKMdL4L301VRchi14sJcoBW2nDE x5s9qdeZx3efx6if8USGYFpuxvv9iwJnlL7dKkSE3XCyVvzoKCaHJdzQpJ5gzQzfwswY XvFxh9Fo+jBkQFvksi7Rp7gl/XRv696N9Ys6LsiJcdPx7uTLmUPy7iM7n8xg8j9pXvMY guYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M7syBNh7; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n32-20020a635920000000b0040c9a07ae80si6150110pgb.165.2022.07.22.09.26.26; Fri, 22 Jul 2022 09:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M7syBNh7; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiGVQYm (ORCPT + 99 others); Fri, 22 Jul 2022 12:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbiGVQYm (ORCPT ); Fri, 22 Jul 2022 12:24:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A1F58AB31; Fri, 22 Jul 2022 09:24:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 245A2621BD; Fri, 22 Jul 2022 16:24:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 801EFC341C6; Fri, 22 Jul 2022 16:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658507080; bh=ERD6L0tGWO0x9Vzt+94y6IPYs2il1yz7+hLCIIQ9VMQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M7syBNh7Q+slzlSg95Ty+U3caUx3OkvdZKYgFaT6zO7YKN9OsdTxAXKpzM/fQ8EUj 8laTCMg9BidYfI43AVNQjAskrSgTEIhdawoWcCWFN1EAKRyOqivbfv7qK9N59+Vvnq ixHzlI/3Lkn2UIyRqLOaAICt3NyJKQeAO9La4LBsM3B/cUM9f6Cxa2XXZSNWSWP4n7 eKglhO2cux23pKTuvR31k1jROOcx4Jvj6L34W3fwmJ0EjPxsmlZpViqsKNhWnWhV8U qZwtGZ8Kg87h7OJAYIWHEdlyKK+giZJRMb/S/JIukT8Eyn8v4Et7jPN0R8WTIdRmRv SETEtPcVhPZPQ== Date: Fri, 22 Jul 2022 09:24:39 -0700 From: "Darrick J. Wong" To: Eric Biggers Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-api@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Keith Busch Subject: Re: [PATCH v4 9/9] xfs: support STATX_DIOALIGN Message-ID: References: <20220722071228.146690-1-ebiggers@kernel.org> <20220722071228.146690-10-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220722071228.146690-10-ebiggers@kernel.org> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Jul 22, 2022 at 12:12:28AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Add support for STATX_DIOALIGN to xfs, so that direct I/O alignment > restrictions are exposed to userspace in a generic way. > > Signed-off-by: Eric Biggers LGTM Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/xfs_iops.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > index 29f5b8b8aca69a..bac3f56141801e 100644 > --- a/fs/xfs/xfs_iops.c > +++ b/fs/xfs/xfs_iops.c > @@ -605,6 +605,15 @@ xfs_vn_getattr( > stat->blksize = BLKDEV_IOSIZE; > stat->rdev = inode->i_rdev; > break; > + case S_IFREG: > + if (request_mask & STATX_DIOALIGN) { > + struct xfs_buftarg *target = xfs_inode_buftarg(ip); > + > + stat->result_mask |= STATX_DIOALIGN; > + stat->dio_mem_align = target->bt_logical_sectorsize; > + stat->dio_offset_align = target->bt_logical_sectorsize; > + } > + fallthrough; > default: > stat->blksize = xfs_stat_blksize(ip); > stat->rdev = 0; > -- > 2.37.0 >