summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-03-26 15:03:38 +0100
committerChristian Brauner <brauner@kernel.org>2026-03-26 15:03:38 +0100
commit6e22726900ea54d72cbc6f053c0fa581de023de6 (patch)
treecd8cda66cc4ee4a6671c96b6d0851ff6309bb096 /include/linux/fs.h
parent1f318b96cc84d7c2ab792fcc0bfd42a7ca890681 (diff)
parentf219798ce294e346031022a85670f68eb2dec10e (diff)
downloadlinux-next-6e22726900ea54d72cbc6f053c0fa581de023de6.tar.gz
linux-next-6e22726900ea54d72cbc6f053c0fa581de023de6.zip
Merge patch series "fs: Move metadata bh tracking from address_space"
Jan Kara <jack@suse.cz> says: This patch series cleans up the mess that has accumulated over the years in metadata buffer_head tracking for inodes, moves the tracking into dedicated structure in filesystem-private part of the inode (so that we don't use private_list, private_data, and private_lock in struct address_space), and also moves couple other users of private_data and private_list so these are removed from struct address_space saving 3 longs in struct inode for 99% of inodes. I would like to get rid of private_lock in struct address_space as well however the locking changes for buffer_heads are non-trivial there and the patch series is long enough as is. So let's leave that for another time. * patches from https://patch.msgid.link/20260326082428.31660-1-jack@suse.cz: (42 commits) fs: Drop i_private_list from address_space fs: Drop mapping_metadata_bhs from address space ext4: Track metadata bhs in fs-private inode part minix: Track metadata bhs in fs-private inode part udf: Track metadata bhs in fs-private inode part fat: Track metadata bhs in fs-private inode part bfs: Track metadata bhs in fs-private inode part affs: Track metadata bhs in fs-private inode part ext2: Track metadata bhs in fs-private inode part fs: Provide functions for handling mapping_metadata_bhs directly fs: Switch inode_has_buffers() to take mapping_metadata_bhs fs: Make bhs point to mapping_metadata_bhs fs: Move metadata bhs tracking to a separate struct fs: Fold fsync_buffers_list() into sync_mapping_buffers() fs: Drop osync_buffers_list() kvm: Use private inode list instead of i_private_list fs: Remove i_private_data aio: Stop using i_private_data and i_private_lock hugetlbfs: Stop using i_private_data fs: Stop using i_private_data for metadata bh tracking ... Link: https://patch.msgid.link/20260326082428.31660-1-jack@suse.cz Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 8b3dd145b25e..a3bed26d066d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -445,6 +445,13 @@ struct address_space_operations {
extern const struct address_space_operations empty_aops;
+/* Structure for tracking metadata buffer heads associated with the mapping */
+struct mapping_metadata_bhs {
+ struct address_space *mapping; /* Mapping bhs are associated with */
+ spinlock_t lock; /* Lock protecting bh list */
+ struct list_head list; /* The list of bhs (b_assoc_buffers) */
+};
+
/**
* struct address_space - Contents of a cacheable, mappable object.
* @host: Owner, either the inode or the block_device.
@@ -464,8 +471,6 @@ extern const struct address_space_operations empty_aops;
* @flags: Error bits and flags (AS_*).
* @wb_err: The most recent error which has occurred.
* @i_private_lock: For use by the owner of the address_space.
- * @i_private_list: For use by the owner of the address_space.
- * @i_private_data: For use by the owner of the address_space.
*/
struct address_space {
struct inode *host;
@@ -484,9 +489,7 @@ struct address_space {
unsigned long flags;
errseq_t wb_err;
spinlock_t i_private_lock;
- struct list_head i_private_list;
struct rw_semaphore i_mmap_rwsem;
- void * i_private_data;
} __attribute__((aligned(sizeof(long)))) __randomize_layout;
/*
* On most architectures that alignment is already the case; but
@@ -3295,8 +3298,8 @@ void simple_offset_destroy(struct offset_ctx *octx);
extern const struct file_operations simple_offset_dir_operations;
-extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
-extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
+extern int simple_fsync_noflush(struct file *, loff_t, loff_t, int);
+extern int simple_fsync(struct file *, loff_t, loff_t, int);
extern int generic_check_addressable(unsigned, u64);