]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
fs: rely on ->iterate_shared to determine f_pos locking
authorChristian Brauner <brauner@kernel.org>
Sun, 6 Aug 2023 12:49:35 +0000 (14:49 +0200)
committerChristian Brauner <brauner@kernel.org>
Sun, 6 Aug 2023 13:08:36 +0000 (15:08 +0200)
commit7d84d1b9af6366aa9df1b523bdb7e002372e38d0
tree450616a5bc325b21b528fa6928294e69f8ffe733
parent3e3271549670783be20e233a2b78a87a0b04c715
fs: rely on ->iterate_shared to determine f_pos locking

Now that we removed ->iterate we don't need to check for either
->iterate or ->iterate_shared in file_needs_f_pos_lock(). Simply check
for ->iterate_shared instead. This will tell us whether we need to
unconditionally take the lock. Not just does it allow us to avoid
checking f_inode's mode it also actually clearly shows that we're
locking because of readdir.

Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/file.c