diff options
author | Christian Brauner <brauner@kernel.org> | 2024-09-08 08:58:01 +0200 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-09-12 11:58:46 +0200 |
commit | 24a988f75c8a5f16ef935c51039700e985767eb9 (patch) | |
tree | d071e54a8009b45461848dc550e0ee4800297b92 /fs/tracefs | |
parent | mm: Removed @freeptr_offset to prevent doc warning (diff) | |
parent | fs: remove f_version (diff) | |
download | linux-24a988f75c8a5f16ef935c51039700e985767eb9.tar.xz linux-24a988f75c8a5f16ef935c51039700e985767eb9.zip |
Merge patch series "file: remove f_version"
Christian Brauner <brauner@kernel.org> says:
The f_version member in struct file isn't particularly well-defined. It
is mainly used as a cookie to detect concurrent seeks when iterating
directories. But it is also abused by some subsystems for completely
unrelated things.
It is mostly a directory specific thing that doesn't really need to live
in struct file and with its wonky semantics it really lacks a specific
function.
For pipes, f_version is (ab)used to defer poll notifications until a
write has happened. And struct pipe_inode_info is used by multiple
struct files in their ->private_data so there's no chance of pushing
that down into file->private_data without introducing another pointer
indirection.
But this should be a solvable problem. Only regular files with
FMODE_ATOMIC_POS and directories require f_pos_lock. Pipes and other
files don't. So this adds a union into struct file encompassing
f_pos_lock and a pipe specific f_pipe member that pipes can use. This
union of course can be extended to other file types and is similar to
what we do in struct inode already.
* patches from https://lore.kernel.org/r/20240830-vfs-file-f_version-v1-0-6d3e4816aa7b@kernel.org:
fs: remove f_version
pipe: use f_pipe
fs: add f_pipe
ubifs: store cookie in private data
ufs: store cookie in private data
udf: store cookie in private data
proc: store cookie in private data
ocfs2: store cookie in private data
input: remove f_version abuse
ext4: store cookie in private data
ext2: store cookie in private data
affs: store cookie in private data
fs: add generic_llseek_cookie()
fs: use must_set_pos()
fs: add must_set_pos()
fs: add vfs_setpos_cookie()
s390: remove unused f_version
ceph: remove unused f_version
adi: remove unused f_version
file: remove pointless comment
Link: https://lore.kernel.org/r/20240830-vfs-file-f_version-v1-0-6d3e4816aa7b@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/tracefs')
0 files changed, 0 insertions, 0 deletions