Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp363902imi; Fri, 22 Jul 2022 00:16:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sVdZHmoJSMvtHSZUWpMSSWu71ZLaTHSAdUFeUrOT23bBMj8msWBGLQiXQpElM2Bp6WWo5L X-Received: by 2002:a17:903:41d0:b0:16d:23e9:41d0 with SMTP id u16-20020a17090341d000b0016d23e941d0mr2010060ple.47.1658474162402; Fri, 22 Jul 2022 00:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658474162; cv=none; d=google.com; s=arc-20160816; b=X/nnYpXUUlNyKiBqY6lAiucYBXzQHyZerjGKs5HhHCmicHQpkqbUqwcu5ixqVVrcTy Ff5ETf++Pckg+fIsi/k6w/g1haB43B1wIfDHKV50bue4BtRgCkkARO0LP4GzrFhCnp3b i9TPyChdsmdPI8TNaSH9MGKe7TF9mxA8GBeJZ9mfWo4YaDk5WAFSnQqkTx5y/r5hGuiL ps3jN2DLqCnnV3hCFhxh6I/AgxCYbCjrcXcmXLI/A8751mBuCyEz0KabE0Ibhndxlimp ulEotzyBZvUg1S9rP4l0urztBfOl5l4STZaUeXX8K9ajcKojwhp9A7FWGgQIbBdRIhuI qKDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R3yPlL04mTlr+crM3nBVweheRISvQZlJ3AFTrymz+CM=; b=eEWllD4LzQEM11A7zEwCWEMlcYIFdC/Ja2gcpd8tqFxI1SPs8wV51Te9T6qcoa2xqr zfLkTyjFUcBR8YEfC33oeFJ5sr06t6ckjykbdVvXdbiF6v2jDMEBQf4pkY5xzXeXTUD2 Z+PoS4NKtLILQsTW7XZ43ZYt4+Rw3kAikBtZeQUJBzdcPUbkJt4hPeylIA6SC4VMSLPB CSPbsxUTs3C/sqQWN/sPNMPA7q56ilu5kijSriVbIuoVscu/rlSyog2AI926quBaMTKk yxdsk6ra2op09lKFCBE490ooKaQgmTd+wjG9MhzryRLlz6HltLY1fecbZyW5FdH7odZ7 74eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eKeG5bGy; 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 o9-20020a170902d4c900b0016c2d91db1esi5529033plg.77.2022.07.22.00.15.45; Fri, 22 Jul 2022 00:16:02 -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=eKeG5bGy; 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 S234495AbiGVHOW (ORCPT + 99 others); Fri, 22 Jul 2022 03:14:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234344AbiGVHOH (ORCPT ); Fri, 22 Jul 2022 03:14:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57A6A93C37; Fri, 22 Jul 2022 00:14:06 -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 2BABD6218C; Fri, 22 Jul 2022 07:14:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0077C385A5; Fri, 22 Jul 2022 07:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658474046; bh=vRMBs3p3k29TcKDOjHrOzYfkIvFsVQJZG7mrxyu++ts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKeG5bGyliUl/1pyKmdtZZa0HOvtmSTtj9U4sC95NA5D8IDsq+Vegw9IPhy3zbjWv VqBDKe1x8aTlQjYpZmOMT+hUh8Aesxl0g1m7dUutCmVaHepkeaFHOzBQ+bMhojs9ly /WvlzVL8NEAuDYHcRJY4G6MbYT3B+y7a85CKNjHSv7sa9w11u6gXPuSWPqIx6s8FEq CBjT4NrDoDakb2YfI9wXiBl4aVMWoXX5NaOKuAMrM65vruCbF1lQRkQWGIdtzy3DOj HyUTCFpCWZcPAT8omY/l/15TzbUHaoqDQY9UCrKT6K/a1YkdC2IqrFuYv6I7tmEbOh F8uJYZfxDcI0A== From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: 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: [PATCH v4 9/9] xfs: support STATX_DIOALIGN Date: Fri, 22 Jul 2022 00:12:28 -0700 Message-Id: <20220722071228.146690-10-ebiggers@kernel.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220722071228.146690-1-ebiggers@kernel.org> References: <20220722071228.146690-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 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,SUSPICIOUS_RECIPS 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 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 --- 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