Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp298100lqo; Thu, 9 May 2024 23:11:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWl6K0kHCW0ytdRBmIua/7gqC1RByoEdWDzYmARE8YQJitwfxZBrdYraFebwBb1LFBb/AWR3vjgyluqRpZ+8wmc1kVogI166QhwiSNhxA== X-Google-Smtp-Source: AGHT+IG+2LAxYdImhuPJ+mWs+Q5SlmJZQplSmw81fLa1WoXCtrDum9Z/9ELlsCUWqy+0+sR31ne9 X-Received: by 2002:ad4:53a8:0:b0:6a0:669f:ff2c with SMTP id 6a1803df08f44-6a1682794ccmr13807406d6.64.1715321517272; Thu, 09 May 2024 23:11:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715321517; cv=pass; d=google.com; s=arc-20160816; b=HBJ9KWHEwrgM76ZiDVhK0pucpGNNaTW7mgHn8mgeT6XI5T9XvfwBzv4RjqKQ9zpCoO 0DQk9nmAU4vw62T4mIC4WZs7I/0bmSflnBIDb9tYQ56wnK1bOOS9NdNnfkWIGP0vp2LH jjo8hjstPpHsT2nwVB/V7mnhXwIbXw3eHyGklPnCfP2t4bxWGhQ/jlvU6tytDERvhmbj kXmgOFv1gRVlT96KbsKdnJM/Ornbq74xa5LPaMNwG6/x7Un3V5e3pWGzjQY0RjTepduH i/u6bd5y/3sj/2VJx/3n+WZcL5Q/Jg+guorDIeKO1F4J0ek3Ry8e3Q4NsNDYx+FKVwm2 zBOw== 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=hZhrcUEaCz3NJloTVX6GrdenLDm/0pV21Z4CgXpXVSA=; fh=uRRo/bsVkkMz4T1a2t0y0xSNbzWg22XBPvnHoLuz/8k=; b=wOTO6rKbgWhB8Uxn3kCCm6yDnyhRUJDO0kQcd9kZsvpsOZDrAk6so8mHVPi95785IP TSuCbzguqPna7HrdoWI8Xqc/rU0bm5AxmaTEQRsULZkBrsy49OklAa3BTBvTlS3iGeyR b0gx9bgKod70vBvScsUy7T3Km+W4NOoqSbjhyxDk9jLYAdO72AN6UywjzHBsXWBehbWF zPZFM/c7ssYaaN3P2QC8pFg2GSIbMoSD5cIHi+9RjTHfNuX8ESHDi3ozFD4OQ93rRFVk RschNn0Yz0jUOu9UO4/5Dba3GxojowRb7oL2XF97YuU6PMFAc/WTKWwma/HCubtwAVgm 8rqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=p0xkDhDG; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-175308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2ef3f7si30186086d6.498.2024.05.09.23.11.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 23:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=p0xkDhDG; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-175308-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 011661C20282 for ; Fri, 10 May 2024 06:11:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 177BF1527AA; Fri, 10 May 2024 06:11:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="p0xkDhDG" Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 741CB1527A8 for ; Fri, 10 May 2024 06:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715321509; cv=none; b=CDq7mHn0mpvGf5HdN7Mqs0WaeRxSkqfWXUMQvC0AEjUv/tgurWGaSSw7EZ5EAhj6d5bm32iEniQpoWe9gTgXi0qkeI6KzKJsmhCTzI5eNcGYTJNGaTHjlp0uawitEYntiOJ/gJkPPYudiar9L/sRX2ajfAnnSg1E1DAA5vbYnyk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715321509; c=relaxed/simple; bh=HlmC0UjiQtAoSWC6vjrGsiGGVG3ulYA6PNHXK+VQfuw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ImIm1N8VD+NuHf8KTR4ZBBJOCcWpyCv3J29PqdkbGfsTPakfGGWojgD1rqahjpGiteKN6yma/DblezRU06MM4dzQa+6RIX8wSN6WW4XD3E64wZVVAnxolUHXdrfu6eUIx5lX67FsqkreRGwYxBPRfaZZqgtkF3RGzIaN0KlksDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=p0xkDhDG; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715321505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hZhrcUEaCz3NJloTVX6GrdenLDm/0pV21Z4CgXpXVSA=; b=p0xkDhDGFMw1npOCcR14CTUBw/AEO3G+1Kq0u3L63DlCquZLcXQPdrgJu8u33ak2kuFK58 Xju/XvaUBXg2rjm5kG27Z07mfklV5ILpzote/iFp8MrESY6xk75TwNeDQX5aIh9mvCInIX UcnuT2giowntxKmEOOjQ1N3ISe557F8= From: Youling Tang To: Kent Overstreet Cc: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, Youling Tang Subject: [PATCH] bcachefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Date: Fri, 10 May 2024 14:10:58 +0800 Message-Id: <20240510061058.316819-1-youling.tang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Youling Tang 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 bcachefs so that noop_direct_IO can eventually be removed. Similar to commit b29434999371 ("xfs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method"). Signed-off-by: Youling Tang --- fs/bcachefs/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index a8d71cec1c17..7ef41ce2d8c6 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1142,6 +1142,8 @@ static int bch2_open(struct inode *vinode, struct file *file) return ret; } + file->f_mode |= FMODE_CAN_ODIRECT; + return generic_file_open(vinode, file); } @@ -1234,7 +1236,6 @@ static const struct address_space_operations bch_address_space_operations = { .write_end = bch2_write_end, .invalidate_folio = bch2_invalidate_folio, .release_folio = bch2_release_folio, - .direct_IO = noop_direct_IO, #ifdef CONFIG_MIGRATION .migrate_folio = filemap_migrate_folio, #endif -- 2.34.1