From patchwork Thu Feb 29 14:24:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 1906345 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mtcduGf/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=mqnx=kg=vger.kernel.org=linux-ext4+bounces-1433-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tltn35p9Yz23fC for ; Fri, 1 Mar 2024 01:25:59 +1100 (AEDT) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4Tltn03xZKz4wc7 for ; Fri, 1 Mar 2024 01:25:56 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4Tltn03t2dz4wcH; Fri, 1 Mar 2024 01:25:56 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mtcduGf/; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-ext4+bounces-1433-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4Tltmz750Cz4wc7 for ; Fri, 1 Mar 2024 01:25:55 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2CAC31C2031A for ; Thu, 29 Feb 2024 14:25:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C4D31361BC; Thu, 29 Feb 2024 14:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mtcduGf/" X-Original-To: linux-ext4@vger.kernel.org Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95F0512FB0B for ; Thu, 29 Feb 2024 14:24:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709216665; cv=none; b=N3hETBVN7v2lYqUEe6HZqdRDdTPzaUL2oZU7EOZSPIque9lrjiAUIlPxbyl1j1NUcQjh89DiBJEx5oFfM6ek/gGSQ9knxidr+u19Spg/lk0ubW8BxxnrP6IC+LjBxaoAyzf49NeZUtTnkxY1zy6bqI/NL5Dv4DEkSUDWGiaT8Jw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709216665; c=relaxed/simple; bh=iekEPTmQteBtjTG7D3blaVP/ayR2+DAqjKW89ic8p1M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MvqyP9yqaM5tybQCtepTaHIJOfwtpzYldlB3v+1Bu3Hu4msnRZS9sYsIjogIQCMu9jfklSlOiQAZgKMe/DEbWCe+zbiP0T33CeOBarg9QBvMXBWY0ldg6zWmahCoZAbg6tuObRNE6AKZF0AyYv3iUT2yILe/Sr0IxJN961TcnJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mtcduGf/; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e581ba25e1so752022b3a.1 for ; Thu, 29 Feb 2024 06:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709216662; x=1709821462; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qu3U8IuSgRhuL6lhNV0IIoBjHo1cngp25DTu7fDPeiY=; b=mtcduGf/aQHIdZ74YxOybIJwGYcV1HLnFco/veKEZHyNbGdidYsb0//fEfrmXTt/yQ KgCraE6rnIbjHtWIYVmThSaOA1sYqHEWN5JyiUJdPYKWYKbU87CDQoiOnYnv4/Otf79v jgttawaMEy3SrN1RULX9ZmMDPTg+OwmaJO+/HjJL4EG0TloHjXCd9ik3MmTJP07VaILb wc2gtsz8Vs9w08sVOPHsUnnZbaYtdDjamGAyVajGpcjVqTCy/Hq/CG8h3KMCA9B0P3bf bqwPCtOLn3fqv2bYAwkP6NMpHJ6QfU+E4J5Jwi/XfC+2R65CMsN6ddssVzD0KeLYYBoL sLaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709216662; x=1709821462; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qu3U8IuSgRhuL6lhNV0IIoBjHo1cngp25DTu7fDPeiY=; b=WTYqEK+98q88ZxiWd6X/kZGn2o6DfGrycNxYQwhh5fbu+lZyS8Hs1y3sFE0qstOv3e 8ndzPOh3Axz4cxPPEI7epOvgpwGIYitYoLLnZUZtJgOejtqgQpUJCLBSSSeJ3386RDCI Xnub7c2gNSIiePSNbXp7jF6R2mTyhUCu/0sdUZVPI4vvLvWAdxUjzMaiEucCzHEULnBm 3XJgJPv8HGXNindwsVa/EosYju9PgDbC/n/uexrI139d+BoL4xLYUv8xUCq8i65GHbPe h8swwSoIS6SS135wKRJ2vR9hSBHJV26N76Bh50UQ7kWwpoAqEYY6/YU4iqfP/AGID/6a NmMg== X-Gm-Message-State: AOJu0Yzd+T9oyzezCXiBDWS4ykFgfvRvxpS4jeaGHE18hRe/jg1WTJ/Q XcfP0j/njfYmIsWcO9zebUPrt3TCqY/H3mLLXoFvpHnaCAewWFTaZTXiIbK/tOQ= X-Google-Smtp-Source: AGHT+IFJjBr8/SQiaav8xld6BxO8N2vBa72d21C5CPmY42Ts6Lc2p9wJ4JYWXApr/x0RImqZQhorLg== X-Received: by 2002:a05:6a00:4b4e:b0:6e4:c592:deaa with SMTP id kr14-20020a056a004b4e00b006e4c592deaamr2702475pfb.11.1709216661673; Thu, 29 Feb 2024 06:24:21 -0800 (PST) Received: from dw-tp.. ([49.205.218.89]) by smtp.gmail.com with ESMTPSA id z17-20020aa79911000000b006e58920c58asm1306693pff.185.2024.02.29.06.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 06:24:20 -0800 (PST) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org Cc: Jan Kara , Christoph Hellwig , Ritesh Harjani Subject: [PATCH 1/2] ext4: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Date: Thu, 29 Feb 2024 19:54:12 +0530 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig 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. Signed-off-by: Christoph Hellwig [RH: Rebased to upstream] Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara --- Stumbled upon [1], while I was trying to enable this flag in ext4_file_open(). Looks like it might have slipped through the cracks. Hence sending this patch with Christoph as the author. [1]: https://lore.kernel.org/linux-ext4/20230612053731.585947-1-hch@lst.de/ fs/ext4/file.c | 2 +- fs/ext4/inode.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 54d6ff22585c..965febab1d04 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -886,7 +886,7 @@ static int ext4_file_open(struct inode *inode, struct file *filp) } filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | - FMODE_DIO_PARALLEL_WRITE; + FMODE_DIO_PARALLEL_WRITE | FMODE_CAN_ODIRECT; return dquot_file_open(inode, filp); } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2ccf3b5e3a7c..60a03b2ca178 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3530,7 +3530,6 @@ static const struct address_space_operations ext4_aops = { .bmap = ext4_bmap, .invalidate_folio = ext4_invalidate_folio, .release_folio = ext4_release_folio, - .direct_IO = noop_direct_IO, .migrate_folio = buffer_migrate_folio, .is_partially_uptodate = block_is_partially_uptodate, .error_remove_folio = generic_error_remove_folio, @@ -3547,7 +3546,6 @@ static const struct address_space_operations ext4_journalled_aops = { .bmap = ext4_bmap, .invalidate_folio = ext4_journalled_invalidate_folio, .release_folio = ext4_release_folio, - .direct_IO = noop_direct_IO, .migrate_folio = buffer_migrate_folio_norefs, .is_partially_uptodate = block_is_partially_uptodate, .error_remove_folio = generic_error_remove_folio, @@ -3564,7 +3562,6 @@ static const struct address_space_operations ext4_da_aops = { .bmap = ext4_bmap, .invalidate_folio = ext4_invalidate_folio, .release_folio = ext4_release_folio, - .direct_IO = noop_direct_IO, .migrate_folio = buffer_migrate_folio, .is_partially_uptodate = block_is_partially_uptodate, .error_remove_folio = generic_error_remove_folio, @@ -3573,7 +3570,6 @@ static const struct address_space_operations ext4_da_aops = { static const struct address_space_operations ext4_dax_aops = { .writepages = ext4_dax_writepages, - .direct_IO = noop_direct_IO, .dirty_folio = noop_dirty_folio, .bmap = ext4_bmap, .swap_activate = ext4_iomap_swap_activate, From patchwork Thu Feb 29 14:24:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 1906346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=NDaCacHR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=kcbw=kg=vger.kernel.org=linux-ext4+bounces-1434-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tltn44tNNz23qX for ; Fri, 1 Mar 2024 01:26:00 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4Tltn44QgSz4wcH for ; Fri, 1 Mar 2024 01:26:00 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4Tltn44N9Lz4wc7; Fri, 1 Mar 2024 01:26:00 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=NDaCacHR; dkim-atps=neutral Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-ext4+bounces-1434-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4Tltn40J99z4wcH for ; Fri, 1 Mar 2024 01:26:00 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B13CA1F25F3A for ; Thu, 29 Feb 2024 14:25:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F7EE1361C6; Thu, 29 Feb 2024 14:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NDaCacHR" X-Original-To: linux-ext4@vger.kernel.org Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8D831369B1 for ; Thu, 29 Feb 2024 14:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709216668; cv=none; b=ioVLODBTyBRd9A5KFQdu5GCp2C6qQa0xDoKVBTXDxAFRKM1Vt2UWDTMfGN6+P3eiUT28eKZJQ9tX+q9pd1bgE2Hv5TTjUlNU224f15UF3PxsAzwR7dNMq0EAwgYpjMnd297nr31g965lZhYjxhd4Z0QmMXOE/0Yq5RDlWL+tI/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709216668; c=relaxed/simple; bh=5sdwJcrorpWZYJYa3Cxxef2Wg2r5AC5nmj/VEvFeAIk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NkAuID4r6iNxBbj7opNlgOzW95UDC3uOsxVJ9UktgJTQrTPWya1/vSOv175v7AX0y45Q1nC1+MZWMoNZcsvXELT3NVY1SfIT5508zWmO+qjtRdPrnLlR6x80mCcFRwzNVhxlVnb0OjFkhp92lyt4DWcqU6hzYWnpiIeXYIWth+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NDaCacHR; arc=none smtp.client-ip=209.85.167.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3bba50cd318so647025b6e.0 for ; Thu, 29 Feb 2024 06:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709216664; x=1709821464; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZCNmVzVlBGnDKAbqszPwXD9+Tbb+ulfXyjjucBp4CFs=; b=NDaCacHR01gew4xkR4Sfpk6W1GdL2ZcMDJDcs7ghdFXUZPUKaeccVE0pfEYX9y5euu vtvalfhww85VjU8afzD5O5mkT8SolkFBHX8S91FDL8PtY6UtwYiuD3eGa/6X9yy66xkH G5WQkvqjEfDUlP5Y1rzKiWi2r5FIPFAn/RlBVdSsqlRNHfKwfMouPlcwiKQBDLuZqRna w4hikk/JscT6JOWGi2/J+Hezq9H6pT+aVVrhrhLqFIZJIWpmfqSCAM8A3LXDhCbgcSVc 2vmOmiUj/E4IzikxP8uf+HeuyZFlWWtD71I9usvoBJQfDPvhq/lsoI98p/W+bFjU9N01 M07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709216664; x=1709821464; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZCNmVzVlBGnDKAbqszPwXD9+Tbb+ulfXyjjucBp4CFs=; b=sf3iByzZHSjCUxnKVSUVawIsdBg5nlNxsI5EVUOM/yC7ys4Otni8VssD8Otkc5q3bZ WXaeY3yr+qoPO6TTyKz+j5xMHLdwYe3OocCQklqhxteJUb0HcbAO/k46bzNvFp5eg7dn fGH1Gt8NDvbixXekHTwGtkh6KDGpgNxMIsTFMptz8vlYy6EcUhUgv6WDSCOEBitVg4N3 Prn0iFqcI/vsUNDKXjv7qPzkz59dEFPIfSkgJkQTrkwIqkPbWrLR/D4d5ztIKiLtmbWx FrE7+R2rbvFl3y0E6uwndg1n+X16PAEoBe8JYFizshEswHOc0NUHKgCeKYfchPmBUY0i JZYw== X-Gm-Message-State: AOJu0YxUzSEyx51ZQb0XfQcblQw5OFwlyeKaX6rSFAf37hxvYnPccZa7 bLVYfB8c3euXgjIr3pLBnbU2777jc4rzcG0qoPNz5i6zztKypfOsBf/54bkNwa0= X-Google-Smtp-Source: AGHT+IHrlesZUO+xY254h5s3hDMjCg4XtB0h9AQXAvgQBNIqwwGmH0KM17D8WI/tvviu0nA9SNpuGw== X-Received: by 2002:a05:6808:2e86:b0:3c0:bdb1:eb8f with SMTP id gt6-20020a0568082e8600b003c0bdb1eb8fmr3057660oib.17.1709216664086; Thu, 29 Feb 2024 06:24:24 -0800 (PST) Received: from dw-tp.. ([49.205.218.89]) by smtp.gmail.com with ESMTPSA id z17-20020aa79911000000b006e58920c58asm1306693pff.185.2024.02.29.06.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 06:24:23 -0800 (PST) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org Cc: Jan Kara , Christoph Hellwig , "Ritesh Harjani (IBM)" Subject: [PATCH 2/2] ext2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Date: Thu, 29 Feb 2024 19:54:13 +0530 Message-ID: <94f78492f55c3f421359fb6e0d8fab6e79ea17b2.1709215665.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Signed-off-by: Ritesh Harjani (IBM) --- fs/ext2/file.c | 8 +++++++- fs/ext2/inode.c | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/ext2/file.c b/fs/ext2/file.c index 4ddc36f4dbd4..10b061ac5bc0 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c @@ -302,6 +302,12 @@ static ssize_t ext2_file_write_iter(struct kiocb *iocb, struct iov_iter *from) return generic_file_write_iter(iocb, from); } +static int ext2_file_open(struct inode *inode, struct file *filp) +{ + filp->f_mode |= FMODE_CAN_ODIRECT; + return dquot_file_open(inode, filp); +} + const struct file_operations ext2_file_operations = { .llseek = generic_file_llseek, .read_iter = ext2_file_read_iter, @@ -311,7 +317,7 @@ const struct file_operations ext2_file_operations = { .compat_ioctl = ext2_compat_ioctl, #endif .mmap = ext2_file_mmap, - .open = dquot_file_open, + .open = ext2_file_open, .release = ext2_release_file, .fsync = ext2_fsync, .get_unmapped_area = thp_get_unmapped_area, diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 5a4272b2c6b0..6f719d784eb9 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -965,7 +965,6 @@ const struct address_space_operations ext2_aops = { .write_begin = ext2_write_begin, .write_end = ext2_write_end, .bmap = ext2_bmap, - .direct_IO = noop_direct_IO, .writepages = ext2_writepages, .migrate_folio = buffer_migrate_folio, .is_partially_uptodate = block_is_partially_uptodate, @@ -974,7 +973,6 @@ const struct address_space_operations ext2_aops = { static const struct address_space_operations ext2_dax_aops = { .writepages = ext2_dax_writepages, - .direct_IO = noop_direct_IO, .dirty_folio = noop_dirty_folio, };