Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp475532lqb; Thu, 29 Feb 2024 06:31:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV9nODpCzo3A2Bb8pqZa7OY2FZTVXGEDH5jNlOWabKkFHZFE84Zo5QZFiDhopxTXvYdjcCzX43ltpp5hykvvlasnpupX5l9qQpZGQAmHw== X-Google-Smtp-Source: AGHT+IGjxXiQ6724GBI6wfnVQp3qkL1RBpUsTrKcDQy9b4LPjQyweeihCGE6dEL+6hFEs4sE7LRj X-Received: by 2002:a17:907:7005:b0:a3e:d450:d3e0 with SMTP id wr5-20020a170907700500b00a3ed450d3e0mr1530536ejb.43.1709217110329; Thu, 29 Feb 2024 06:31:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709217110; cv=pass; d=google.com; s=arc-20160816; b=XVnYhhH4i6w7P4Vdv7hX5b1T+8rzqEJriPIQvwNANa8jGE5iL7NEoWECPh8BjM0H51 C78b90yMoIumIWmnQ8vTfWdWfJ2Skqou+X0G0M8evHc+w7qjWhUmECjVOeU4me3OFnPK uYrldE5pFhZ6hgkTOgK7boHiJ8ZJKx4P/RK72Uee0zbV/KAWuZQ75lJ8EFLfuI4m5VOc ix4fucllETcfkWyGnCIGaeRa8LswRRkj8UBvNS5hO6vN6HaX2CQ+ISET12XN4hrjRvfK 5EclzHeZV/AHTtAImsvkvt2MrAUSS5REP7XQGsPzGUe2lUeuxcmxyShVOfPjwedGUniP neUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=qu3U8IuSgRhuL6lhNV0IIoBjHo1cngp25DTu7fDPeiY=; fh=L/pWpJkyrNbCnJoBMe2uvq2+mjMbzKV10nRAGjb8oC0=; b=PjUJ0AXS61cyYTAol81nMRtazHFIXa34RGAB8BViAO7sZnHg5GqWybmTzLufKK5KLC Zl/UUoScAH0KGbGp2WTp1b+efxQpn/pzksaObhPeYgvaRZk4vqdt/bYlKOnUra70XH2X ueFNZHet/7MJJtYWFPp7DIuETJtAfo7JyB7kpj+4/kxXXdkNVdTYahmkmhI5oDTVo38a O08QzUcd1F0usiuGiEgB371yDV2T6V/kLOCn3yxJp8lEeo87RN/ypwCEyP92XPZhsvpx aL6/6XG/coSztb55gBRc/AhE993sJWRzvUaq9kr35LSBBrNjPHKTiueOWGgfK8GCmOp2 x7WA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="mtcduGf/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-1433-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j14-20020a05640211ce00b00563dc851cbbsi609715edw.90.2024.02.29.06.31.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 06:31:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1433-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="mtcduGf/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-1433-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 9CEFE1F25E37 for ; Thu, 29 Feb 2024 14:25:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E213136647; 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-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 Content-Transfer-Encoding: 8bit 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) --- 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, -- 2.39.2