Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp471376lqb; Thu, 29 Feb 2024 06:25:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWMsXn8iJVwLolD0dWdnGpXEf9OvAlzCMI7gofXYyTuOL+QpcLIG2Lg9t2/q/HnKFEZ4uHyz+50rzKAA5IUZPkc1P/pJZI84uesjXNleQ== X-Google-Smtp-Source: AGHT+IGSMDVgTYt+ijZ0aKiivCeXPqgF3PRAWbpzYtiilbQ+3bzsUE+cQ+xiIZ/o062Jy21Sp9Kk X-Received: by 2002:a05:622a:1d1:b0:42e:c33a:5d7a with SMTP id t17-20020a05622a01d100b0042ec33a5d7amr825891qtw.52.1709216758093; Thu, 29 Feb 2024 06:25:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709216758; cv=pass; d=google.com; s=arc-20160816; b=H7WaWU5oWriVdImbTu01ImMKmhtuOmOC6FvawDacXht5QoOYtvw9DQGB/bN15mrPFv 62GdfPmK1T2lI5zORH2ZEN1g6mc4fr1CFSAFM7uH956ctEC3TTlZCMROQrgHJc7ZTIAr WV076T98SbDVx5kB4oXWfq6o4v1ukkllybvdSnX6bHCLFOm5js8Ke12G5i8z5KTqJkbU bQe61odY2r1GSYrFj0ixtqPg154Sp3QNcDYd8ezQGVcHa1gocQRpKZBhNQ31ZpBjXQI7 JDtAOuvwyCWycVuNtn+odydqk8sj3ihAzUOqGtX18SdO3YUc8NjZ7A+zcjNCMA0ERKE7 v0lw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZCNmVzVlBGnDKAbqszPwXD9+Tbb+ulfXyjjucBp4CFs=; fh=wyI5MlU6/X9wUZhVm/DYGKNqkmE8wEPih8BceLbJUg8=; b=Wc2AxsdJhpvkh+Yl3znAxU61ks6EPoXXHhbBw1MCpqt92ku/O8VPHiaebOvZR/qGYQ BxL/mBh4jEL3ZnCiQ5sCj6v7YMJAJ2crNjct5lR/mx+6icXf2LyyQtAfen1MGWe0cQBW xrmjSH2kjxDZKmvuRcsUDwE9+JvHqF4m2ZYKcaxxzEEqW8AhCSkrmEWTe/dEf4PyzYtO 4AUh8P/zGpfVPLiMqF4naUs/61wa8j7xqJFYoyNmUMp1B6Uw3WAxhFBBcVhmJD9C4HBl CxRQtAdneJJ25LTv4HCJALCLPNQ3Wl4zfVj4ZQi4IFNE7Sp3wGpp3oCNLQxZ+nqiu0fk iU9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NDaCacHR; 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-1434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dt31-20020a05620a479f00b00787ac643457si1398101qkb.70.2024.02.29.06.25.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 06:25:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1434-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=@gmail.com header.s=20230601 header.b=NDaCacHR; 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-1434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1434-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D07691C20C16 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 C4EA11361D6; 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-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 Content-Transfer-Encoding: 8bit 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, }; -- 2.39.2