From patchwork Mon Jun 12 05:37:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13275607 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E57B6C7EE2E for ; Mon, 12 Jun 2023 05:37:43 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1q8aFI-0004xp-IN; Mon, 12 Jun 2023 05:37:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q8aF6-0004x3-21 for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Jun 2023 05:37:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4trhRw7xARg2lJaXKLjvoI562MgArwdRoegsyL2HFFQ=; b=BDpIUWCW/WtkPk17eErCzbdBpH PU12J6VN3YSu2G8GomLrcCT+uLPUTxUkvXGK3lNzHpqWk83MKwSIAPemORcpd5HdQdM+qdC0+FOAJ eqUkeoFyhXX9XyURLsIalOfQGjgfMAWtwEM66HxkGR6N1xDgfYk5yg7RiKwpVz0ZBh5g=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=4trhRw7xARg2lJaXKLjvoI562MgArwdRoegsyL2HFFQ=; b=S ntfSROQdaon/CVsxrs7XDB5uEKlbtTwplG7Nx0AXdXkaMkxWfHjDHd1bl9zGPXOv9NDoQ/htqT6gQ 0N6IkXmmRsZXfygAeBUki3dMEY4Aj4i9+xu+84hn16/U1W6UtPbrsGANvIqZi9zotJD2d7e5vqau+ MTcm0lTAZve2DDNI=; Received: from bombadil.infradead.org ([198.137.202.133]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1q8aF0-0002uR-R6 for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Jun 2023 05:37:26 +0000 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:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=4trhRw7xARg2lJaXKLjvoI562MgArwdRoegsyL2HFFQ=; b=x+c50jeIZW7m/QplkfoSsK/Cxa ndP60B4TEdN+GlO6lpj3/whvj6a5ceUGKv002v4x1+ugVx8Gn5KX8WvLxeiALiaQC9RND5PB+tF1P q5qVxfbfOwSvVUFc6Zfr0MQtM5l11P7Zjv9QCCFVYZS2BEpRW6s/xDA8KwHChdjbpHGcIMJUYZ/83 7LVM23YmOY8IfKLq+aFYBL4algEC8Q/++Govj+iwco/61XBPKbLdix3SPCnYTh6EbHIKeUGZNnA04 nKE2vrOhasKhaJOUBAUvibhP9w6UxWtiysH5Dw8x2J/u+hpZ2NrYhyrpFU1xodjYswsC5nJYABSEm H7y1inbQ==; Received: from 2a02-8389-2341-5b80-8c8c-28f8-1274-e038.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:8c8c:28f8:1274:e038] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q8aEr-002fGv-1w; Mon, 12 Jun 2023 05:37:14 +0000 From: Christoph Hellwig To: jaegeuk@kernel.org, chao@kernel.org Date: Mon, 12 Jun 2023 07:37:11 +0200 Message-Id: <20230612053711.585847-1-hch@lst.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Headers-End: 1q8aF0-0002uR-R6 Subject: [f2fs-dev] [PATCH] f2fs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file systems can just set the FMODE_CAN_ODIRECT flag at open time instead of wiring up a dummy direct_IO method to indicate support for direct I/O. Do that for f2fs so that noop_direct_IO can eventually be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu --- fs/f2fs/data.c | 1 - fs/f2fs/file.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 7165b1202f539c..5e90416f64daa1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -4067,7 +4067,6 @@ const struct address_space_operations f2fs_dblock_aops = { .migrate_folio = filemap_migrate_folio, .invalidate_folio = f2fs_invalidate_folio, .release_folio = f2fs_release_folio, - .direct_IO = noop_direct_IO, .bmap = f2fs_bmap, .swap_activate = f2fs_swap_activate, .swap_deactivate = f2fs_swap_deactivate, diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 5ac53d2627d20d..ca809e366cb79f 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -547,6 +547,7 @@ static int f2fs_file_open(struct inode *inode, struct file *filp) return err; filp->f_mode |= FMODE_NOWAIT; + filp->f_mode |= FMODE_CAN_ODIRECT; return dquot_file_open(inode, filp); }