From patchwork Thu Jul 20 14:04:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13320587 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 E4A35EB64DD for ; Thu, 20 Jul 2023 14:08:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79285280115; Thu, 20 Jul 2023 10:08:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71B2728004C; Thu, 20 Jul 2023 10:08:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BB93280115; Thu, 20 Jul 2023 10:08:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4359928004C for ; Thu, 20 Jul 2023 10:08:50 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E2129120170 for ; Thu, 20 Jul 2023 14:08:49 +0000 (UTC) X-FDA: 81032171178.12.25898DC Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP id D0D1FA047A for ; Thu, 20 Jul 2023 14:05:09 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=OwL7uhRk; spf=none (imf15.hostedemail.com: domain of BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+ae7cc45e83adbe90d207+7270+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=1689861909; 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=2edPrdL7m4BTLQgL/NuD1QkLdVOYHBfaZFGCvDQFQfg=; b=qYH57WVDP+7R0ZDop/sFY1RAY4mkVBh64nlkCfXkP8qloX4XdbjdCTJO/SgdGh5CctPAGI WZ/kUsVoN5VokPWzp3cuI0T5XptP3zX2DhBU0WSr5dtxVfzVrn/N+eBeI1oeGnxUMuQ/0O N/j7exeN6KqV1v6CUkZBsEB4YEJlmpI= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=OwL7uhRk; spf=none (imf15.hostedemail.com: domain of BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+ae7cc45e83adbe90d207+7270+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689861909; a=rsa-sha256; cv=none; b=7WxSDMuTyxSDN567tjyL1TJ97mdF0haOufHHN0mOwhnbuoWSTwzCiE1j6hL1TsOMzT0tKp 62pnmQjXYNMqyqZ5eeKSEm1+nXD/5msJFpfZ8VTuh2b28qPIGPF0rt7NwA7LdQu2XDh8Ft STVzEzNuKI/Q2bYt3My3YYK+jegRad4= 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=2edPrdL7m4BTLQgL/NuD1QkLdVOYHBfaZFGCvDQFQfg=; b=OwL7uhRkFeTFS6ZvjxdAWM3y1x RHsM4c1rRHpuWx7voqK4KAG2bGhvjTGr8Kt7Uw1rLav9sqvlOf+smv90NNU1BrwvpWhNuzQEPjJim SL6mMmrfLx/ZjL8JuHH7h8vFLzW8boQBAXQmwgjBuwOTGNhR5aOLTLtsUa/dG5QIZMfBIrNwGy9dF QtzTQ67Mn651iBrXmMGTcW6qHGY4b0TpdiUa+OZC5AyyVF0OxgqJW62fvy0q1llGNGZ+hwXJGY72W ghbu2Eg8o6DvtLDGj9CTT91ZgZrV9Db4wlhSdYAtBckdOPBs5857BWr6fo49nE/l7j9rfnWWOo4N/ ef2tG8MA==; Received: from [2001:4bb8:19a:298e:a587:c3ea:b692:5b8d] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qMUHB-00BKsX-1J; Thu, 20 Jul 2023 14:05:05 +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 Subject: [PATCH 4/6] block: stop setting ->direct_IO Date: Thu, 20 Jul 2023 16:04:50 +0200 Message-Id: <20230720140452.63817-5-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230720140452.63817-1-hch@lst.de> References: <20230720140452.63817-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-Queue-Id: D0D1FA047A X-Rspam-User: X-Stat-Signature: ztiifsbg35bqrh5t46rk75sgiof8kbtt X-Rspamd-Server: rspam01 X-HE-Tag: 1689861909-499823 X-HE-Meta: U2FsdGVkX1/z8jGFDSL9Z7d3YdvoYWwc8EDaeb32qF/1+UWh/Wzk/wBrWBv3m89njgEjurCCqJDPlFQ/ksOz4KuKuhvk2A/o4+9eGIJVoznffcocR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u2xuFw6ry6UNH4m4oru5JHfXy7VZB9ysWpWUnxV0M7vvGly+ogDwHKkq4jL/nv2b+V/nkojAhOyH7gCXGqI7Sj3KTYekQiUQkHbCVfxUvwKQ8/VxATmz2I0OyiXhdZarOB7z71wBryfvd9zfFjAPSbh3kUc4sRw0nOiLL3ddetEdswqtKV1Zu83lrM0nvF+vK+oi1B11PFktn1PobOzv41cDzRfLB1GTaY+ZVRTJr2LdYdvb89zW+bCgFC4cPP/gshZg95hPVgI= 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: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Luis Chamberlain --- block/fops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/fops.c b/block/fops.c index eb599a173ef02d..0c37c35003c3b7 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.