From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5655537F8C5; Mon, 23 Feb 2026 23:37:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771889841; cv=none; b=ZtDpNzy+5lTztC5BpKIq0x8fBzIiEiXmNPiIw08d16ebLnw9Ovbyd2niLilFiW+ZX4c7s5CRrznTp9UsbbYklfus5/NMHaEOQjIVrvSzGhlYqu3BvdeL31RdDHdbmtViNNDK0JqXyhYxvmCVkUVnN5ofyzE9ZKfDB/keVxOB7FQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771889841; c=relaxed/simple; bh=3Uib4IKJQWh53aAfk8OfdaipIJk+IqYEM2fHW4ZUujo=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qDb6WWITf1FmFiarz8A6F2OCvQ2MM5VDFiFMFJGwuGCUwfVbxwDU8g10GaSAVyaVCRkuY1LivsJDNRsAeu3iwA+6+SlGBgaKXWR6IH0+gDtl6vxcj4qKE1cGAnobHC+rapcMIFK0CwcCsi96ZDMxzagilYNN+qCKsd26RXfbBLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q7fsOVeK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q7fsOVeK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED636C19421; Mon, 23 Feb 2026 23:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771889841; bh=3Uib4IKJQWh53aAfk8OfdaipIJk+IqYEM2fHW4ZUujo=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=q7fsOVeKozcYHLr2JAjnQeosXQwbJ7b64LSXIldcHH4RMlfbM0TX8w/SFzNJW0526 4zBT/HteovmJns04Hj8qst5cNx23VHPvE2/LKjY6AzKvYfbUajsUYHUmXWZQLQHMqI Ea6WrYqF9pYrgycLi6POvqQ/URx/z2sRQ8LR43NZoxYScRALusoY/0ThKkRaXmYMq0 CkGiUH7hdvx/JqOPUKjQcO7O/Uym84VKlXftzyKgZYspSyUDUetUQzu0t/pnp9+xoS KPGFQAQdPpolaDdrVjD+/+vLzG2ej/Nyyq73GeLeE4Wz+m5G/ZadKboH7lxflp8q6y yBeQOxaqjF1TQ== Date: Mon, 23 Feb 2026 15:37:20 -0800 Subject: [PATCH 05/19] fuse2fs: implement directio file reads From: "Darrick J. Wong" To: tytso@mit.edu Cc: bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, miklos@szeredi.hu, bernd@bsbernd.com, joannelkoong@gmail.com, neal@gompa.dev Message-ID: <177188744571.3943178.9862571723096683447.stgit@frogsfrogsfrogs> In-Reply-To: <177188744403.3943178.7675407203918355137.stgit@frogsfrogsfrogs> References: <177188744403.3943178.7675407203918355137.stgit@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Darrick J. Wong Implement file reads via iomap. Currently only directio is supported. Signed-off-by: "Darrick J. Wong" --- fuse4fs/fuse4fs.c | 14 +++++++++++++- misc/fuse2fs.c | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c index e6a60f4ea637f3..9fa875d1d99ae8 100644 --- a/fuse4fs/fuse4fs.c +++ b/fuse4fs/fuse4fs.c @@ -6151,7 +6151,19 @@ static int fuse4fs_iomap_begin_read(struct fuse4fs *ff, ext2_ino_t ino, uint64_t count, uint32_t opflags, struct fuse_file_iomap *read) { - return -ENOSYS; + if (!(opflags & FUSE_IOMAP_OP_DIRECT)) + return -ENOSYS; + + /* fall back to slow path for inline data reads */ + if (inode->i_flags & EXT4_INLINE_DATA_FL) + return -ENOSYS; + + if (inode->i_flags & EXT4_EXTENTS_FL) + return fuse4fs_iomap_begin_extent(ff, ino, inode, pos, count, + opflags, read); + + return fuse4fs_iomap_begin_indirect(ff, ino, inode, pos, count, + opflags, read); } static int fuse4fs_iomap_begin_write(struct fuse4fs *ff, ext2_ino_t ino, diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 70ded520cd318a..a5105855f1669a 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -5597,7 +5597,19 @@ static int fuse2fs_iomap_begin_read(struct fuse2fs *ff, ext2_ino_t ino, uint64_t count, uint32_t opflags, struct fuse_file_iomap *read) { - return -ENOSYS; + if (!(opflags & FUSE_IOMAP_OP_DIRECT)) + return -ENOSYS; + + /* fall back to slow path for inline data reads */ + if (inode->i_flags & EXT4_INLINE_DATA_FL) + return -ENOSYS; + + if (inode->i_flags & EXT4_EXTENTS_FL) + return fuse2fs_iomap_begin_extent(ff, ino, inode, pos, count, + opflags, read); + + return fuse2fs_iomap_begin_indirect(ff, ino, inode, pos, count, + opflags, read); } static int fuse2fs_iomap_begin_write(struct fuse2fs *ff, ext2_ino_t ino,