summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@kernel.org>2026-07-12 22:37:04 -0400
committerEric Biggers <ebiggers@kernel.org>2026-07-20 10:39:26 -0700
commit35f440660fd53e2aa2e5be4aa5ccd87d388385ea (patch)
tree104183aaa63cdcdf100c108ea8d07767709ed71b /fs/ext4
parent170c3aa85d251ccd0f23a022a5efc5b3e105ac95 (diff)
downloadlinux-next-35f440660fd53e2aa2e5be4aa5ccd87d388385ea.tar.gz
linux-next-35f440660fd53e2aa2e5be4aa5ccd87d388385ea.zip
fscrypt: Remove fscrypt_dio_supported()
On block-based filesystems, fscrypt file contents encryption is now always implemented using blk-crypto. This implementation supports direct I/O. Therefore, fscrypt_dio_supported() now always returns true, except in the edge case where statx(STATX_DIOALIGN) is called on an encrypted regular file that hasn't had its key set up. But that was really a workaround rather than the desired behavior, so we can disregard it. Thus, fscrypt_dio_supported() is no longer needed. Remove it. Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260713023708.9245-14-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 567d62032bc5..0e21a2a0faa7 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -6147,11 +6147,8 @@ u32 ext4_dio_alignment(struct inode *inode)
return 0;
if (ext4_has_inline_data(inode))
return 0;
- if (IS_ENCRYPTED(inode)) {
- if (!fscrypt_dio_supported(inode))
- return 0;
+ if (IS_ENCRYPTED(inode))
return i_blocksize(inode);
- }
return 1; /* use the iomap defaults */
}
@@ -6170,11 +6167,7 @@ int ext4_getattr(struct mnt_idmap *idmap, const struct path *path,
stat->btime.tv_nsec = ei->i_crtime.tv_nsec;
}
- /*
- * Return the DIO alignment restrictions if requested. We only return
- * this information when requested, since on encrypted files it might
- * take a fair bit of work to get if the file wasn't opened recently.
- */
+ /* Return the DIO alignment restrictions if requested. */
if ((request_mask & STATX_DIOALIGN) && S_ISREG(inode->i_mode)) {
u32 dio_align = ext4_dio_alignment(inode);