Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: remove f_version

Now that detecting concurrent seeks is done by the filesystems that
require it we can remove f_version and free up 8 bytes for future
extensions.

Link: https://lore.kernel.org/r/20240830-vfs-file-f_version-v1-20-6d3e4816aa7b@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+5 -8
+4 -5
fs/read_write.c
··· 62 62 63 63 if (offset != file->f_pos) { 64 64 file->f_pos = offset; 65 - *cookie = 0; 65 + if (cookie) 66 + *cookie = 0; 66 67 } 67 68 return offset; 68 69 } ··· 82 81 */ 83 82 loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize) 84 83 { 85 - return vfs_setpos_cookie(file, offset, maxsize, &file->f_version); 84 + return vfs_setpos_cookie(file, offset, maxsize, NULL); 86 85 } 87 86 EXPORT_SYMBOL(vfs_setpos); 88 87 ··· 365 364 } 366 365 retval = -EINVAL; 367 366 if (offset >= 0 || unsigned_offsets(file)) { 368 - if (offset != file->f_pos) { 367 + if (offset != file->f_pos) 369 368 file->f_pos = offset; 370 - file->f_version = 0; 371 - } 372 369 retval = offset; 373 370 } 374 371 out:
+1 -3
include/linux/fs.h
··· 1003 1003 * @f_pos_lock: lock protecting file position 1004 1004 * @f_pipe: specific to pipes 1005 1005 * @f_pos: file position 1006 - * @f_version: file version 1007 1006 * @f_security: LSM security context of this file 1008 1007 * @f_owner: file owner 1009 1008 * @f_wb_err: writeback error ··· 1033 1034 u64 f_pipe; 1034 1035 }; 1035 1036 loff_t f_pos; 1036 - u64 f_version; 1037 - /* --- cacheline 2 boundary (128 bytes) --- */ 1038 1037 #ifdef CONFIG_SECURITY 1039 1038 void *f_security; 1040 1039 #endif 1040 + /* --- cacheline 2 boundary (128 bytes) --- */ 1041 1041 struct fown_struct *f_owner; 1042 1042 errseq_t f_wb_err; 1043 1043 errseq_t f_sb_err;