From patchwork Mon Apr 24 05:49:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13221669 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75D1FC77B73 for ; Mon, 24 Apr 2023 05:50:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1156F6B0087; Mon, 24 Apr 2023 01:50:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C7376B0089; Mon, 24 Apr 2023 01:50:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA8B26B008A; Mon, 24 Apr 2023 01:50:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DB0936B0087 for ; Mon, 24 Apr 2023 01:50:35 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BAD1740135 for ; Mon, 24 Apr 2023 05:50:35 +0000 (UTC) X-FDA: 80715210030.02.AF91104 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf25.hostedemail.com (Postfix) with ESMTP id 283ACA0012 for ; Mon, 24 Apr 2023 05:50:33 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=wpOqw6Fz; spf=none (imf25.hostedemail.com: domain of BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682315434; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ygZamnLPppSKQbVI2TYtcZ1SuuieTgm7wFWt/6s68PI=; b=MBxQIcuvV5xtr+/P3JTI/iYQcMHKsMKM84grg8ChqTay29SOM0BugEwd3Ql5xANrCGQJj6 3NF3q7oBPLxDGjie3da+SIPH0hFVnauNeFrVP5kMcto3v6VXQ6qsPRSZKUZR6mKqddgAYq PhJL8VY7g6y7joo9NE0f+CXlsZklw2w= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=wpOqw6Fz; spf=none (imf25.hostedemail.com: domain of BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e16e2fc4419b117693a1+7183+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682315434; a=rsa-sha256; cv=none; b=4SW4+NnAapbDhHlmT5E0DMfpvltHTw3JjK3LeFiXMubFmRcVP48bG9/Hga8XZsfPHtbo/3 Xu6swy/uIlRY+VL/duTEcQL++R9nfAhQlHndSlZDiMx/iL83nkvBhsZw9fni0GBjhAcQLK J9/D8V9HPCyxiV583eHN768SOf6Wcxc= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ygZamnLPppSKQbVI2TYtcZ1SuuieTgm7wFWt/6s68PI=; b=wpOqw6FzWnc2w4juTchLC7VO9t ir9ELtuxBb0jOKnL07jIkpyJF+L1nWBSzPVGIhqVdKTgVpv8nsOhz6XqjGvbC4V9beDfWCniIGswt O9bKd9P+QqRipzQOTI8TmgW/aUC2QEQw/GLLlogXyX29WSz+zFQVPjQfpsqKsOQNqIIlcpMnx4i9l eK8Ns7AAgVVLldGZlqGnxg0NNJ4YeF6tqzIBhBzJQw7Kon0F3ruc0VhAPDYUTJO+38G7SJ6XlYNkX v0ncA0oNgduUMDrajW3dXaIsa/P7DAZvC/IznI7HvWu6OsI4XjPKJ/KK+z4OqYXElqnES62wVc7FU cqsVOn2Q==; Received: from [2001:4bb8:189:a74f:e8a5:5f73:6d2:23b8] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pqp5b-00FPB8-1e; Mon, 24 Apr 2023 05:50:16 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Miklos Szeredi , "Darrick J. Wong" , Andrew Morton , David Howells , Matthew Wilcox , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/17] block: stop setting ->direct_IO Date: Mon, 24 Apr 2023 07:49:24 +0200 Message-Id: <20230424054926.26927-16-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230424054926.26927-1-hch@lst.de> References: <20230424054926.26927-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: jhsskgm4mkrpbh4cj6zxf97ir44mnid3 X-Rspam-User: X-Rspamd-Queue-Id: 283ACA0012 X-Rspamd-Server: rspam06 X-HE-Tag: 1682315433-642574 X-HE-Meta: U2FsdGVkX1+qWRIDG+eO8rYlzDO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B+GW71EJ75flp8vhW9YmEvyOwEKnZFxoGrZd7hBDjPdwkrAh4F9VFmydkdGaeTkAxslRJE0YkBFyHqakV7Ywq9GODom6lQY9GjmpN7dkpXZzRFcYdaTO8O7vaE591991MXnD29cQAnjUVw6wGo0RnrT4LsKuDzlyZf/99NkFJy/flzJUSTtdYFNt/YTo32gq0DPltnLzAL9zGPYgSegAorLpCeT5ginPq1kiBCxXPDlfOXqTYufZjJj39sdNtgdIv/Oho39LOQXQjiSpiq79x+f5KLaKLV/b2Fid/u+SjcnKDXqn3T24AQhJS+h/67LpCtNeX+BxlmTG3zrZp1YPOWaqLk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Direct I/O on block devices now nevers goes through aops->direct_IO. Stop setting it and set the FMODE_CAN_ODIRECT in ->open instead. Signed-off-by: Christoph Hellwig --- block/fops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/fops.c b/block/fops.c index fd510b6142bd57..318247832a7bcf 100644 --- a/block/fops.c +++ b/block/fops.c @@ -428,7 +428,6 @@ const struct address_space_operations def_blk_aops = { .writepage = blkdev_writepage, .write_begin = blkdev_write_begin, .write_end = blkdev_write_end, - .direct_IO = blkdev_direct_IO, .migrate_folio = buffer_migrate_folio_norefs, .is_dirty_writeback = buffer_check_dirty_writeback, }; @@ -481,7 +480,7 @@ static int blkdev_open(struct inode *inode, struct file *filp) * during an unstable branch. */ filp->f_flags |= O_LARGEFILE; - filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC; + filp->f_mode |= FMODE_CAN_ODIRECT | FMODE_NOWAIT | FMODE_BUF_RASYNC; if (filp->f_flags & O_NDELAY) filp->f_mode |= FMODE_NDELAY;