From patchwork Tue Aug 1 17:21:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13337083 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 A8F0AC001DF for ; Tue, 1 Aug 2023 17:27:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47E2C940038; Tue, 1 Aug 2023 13:27:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42E18940010; Tue, 1 Aug 2023 13:27:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34444940038; Tue, 1 Aug 2023 13:27:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1E061940010 for ; Tue, 1 Aug 2023 13:27:19 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DCAAC1C8EC4 for ; Tue, 1 Aug 2023 17:27:18 +0000 (UTC) X-FDA: 81076216956.28.5DC6C37 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP id 78B8EC1741 for ; Tue, 1 Aug 2023 17:22:23 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="YOi/w0no"; spf=none (imf22.hostedemail.com: domain of BATV+44153ebb3f5e3de177ba+7282+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+44153ebb3f5e3de177ba+7282+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690910543; a=rsa-sha256; cv=none; b=pn8yFqgeac8wYn1nhKDFKSelQL3rk5qmDvvVMtLKBSa7DG0HRcigItr/rtvwkAdDligODT PBvRbRl6M4I7ycZJ5v7Si/QKkFrg/NQdZp5Hi2ebja15sRml4EER2dWKHKDjUX4eWqDP+U gaDJNwZG/luWy4E+EnouI3ErHD1HGtA= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="YOi/w0no"; spf=none (imf22.hostedemail.com: domain of BATV+44153ebb3f5e3de177ba+7282+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+44153ebb3f5e3de177ba+7282+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=1690910543; 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=fw7dM1JsVnVndL2bSWsxPXEp2IvCudbljLOvAhT8Np8=; b=v0WUS853b9Sk/RT7PT0t3UggsCrL3jdXRGhZsjksl8vuWqaZsZhWLobJgVwR5ZaXVZHkT0 rTYlD82HLfiRJX+LHNKy94gWQeAsvXQ9M9Onzp9Kc0Y6ORYdqYkaci877w8FZz92kwBjsb +PsVL6X7Z2J971RsftAgOV+Yh8uS0a8= 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=fw7dM1JsVnVndL2bSWsxPXEp2IvCudbljLOvAhT8Np8=; b=YOi/w0nofenlN5gIdk42JnisZa 6ySpZds34NUDRPdlbIJ9XMyFrBlwfvzJy4WTmeaPF7dJNEpoAm+2rI+hJxzWeiDnoH8VwNoJF0oJp H0ZXDuTHKY1yXEEg+9PA7rmiagtQSg+ALFlFLqmI10cmaNf7RF5J1+cmaEwg3ZTR1EoyZktOTmBsI lF8+53ZcFqDEgOXOrTX82JdWh/A8hgepiQGppexMN/PX4XH5OMI5uEOgrwTnBFot9A1R77EClVW3Z KjiuFDUbdVaudO5eYyVmB/VG1UqIuYWvOBWR8cr1rhI/qtW4TTN0XUjz3FjwFpOOm3qqLrkdjtzGN xRv3/F3w==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQt4d-002uXB-1q; Tue, 01 Aug 2023 17:22:20 +0000 From: Christoph Hellwig To: Jens Axboe Cc: "Darrick J. Wong" , Andrew Morton , Matthew Wilcox , Christian Brauner , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Luis Chamberlain , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH 4/6] block: stop setting ->direct_IO Date: Tue, 1 Aug 2023 19:21:59 +0200 Message-Id: <20230801172201.1923299-5-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230801172201.1923299-1-hch@lst.de> References: <20230801172201.1923299-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-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 78B8EC1741 X-Stat-Signature: 394neuujjh613518jkacqoptmhjbmkux X-Rspam-User: X-HE-Tag: 1690910543-720621 X-HE-Meta: U2FsdGVkX19vvh24im9BvAeGv9wB5o04cNDMo/uMOU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K03WZlZGg8KC7HOgKIe27b3Wf56wZmoSBkrS4ciNQ9owY+qhMNiB383vU159imUiSXJDNjIZmLj9MkYyBZmie+dfSu8nqjlrvhU09r9l8KVXmVN11miaeQWsRbi+rNpqL8z+DM6qvX8xhYYvsHxP1+UtGeuMGj0m/saVYnd4ddSfVtz9x7kIDpiCufP1H4XoOkMotZ/y5AGtOBYcqDHRVpA+u7Cj+PvqQd9zqdFsU/k+JfYlhZFwOY/MTRS+OlfA04lZNUD23FF9QAmro5i/4sBRa712Dt0b/cjtSmHQKFS2/VLCrv8jMSVuIzUtOYoaaApQWeZ5tWjpaq4Vx0EzlApxNC1uTbsbhn58JmmMV/FN+m2zNqiuFF+NM3uAkRm+pXdGwofSiFCefaP76T1ktdBiky0LeSp9C6yUS/22eHiQIU6ofl3TOv10vtrnODY= 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 Reviewed-by: Luis Chamberlain Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- block/fops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/fops.c b/block/fops.c index 8a05d99166e3bd..f0b822c28ddfe2 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, }; @@ -505,7 +504,7 @@ static int blkdev_open(struct inode *inode, struct file *filp) * during an unstable branch. */ filp->f_flags |= O_LARGEFILE; - filp->f_mode |= FMODE_BUF_RASYNC; + filp->f_mode |= FMODE_BUF_RASYNC | FMODE_CAN_ODIRECT; /* * Use the file private data to store the holder for exclusive openes.