linux-yocto/fs/btrfs
Lorenzo Stoakes 2e3b37a7e4
fs: replace mmap hook with .mmap_prepare for simple mappings
Since commit c84bf6dd2b ("mm: introduce new .mmap_prepare() file
callback"), the f_op->mmap() hook has been deprecated in favour of
f_op->mmap_prepare().

This callback is invoked in the mmap() logic far earlier, so error handling
can be performed more safely without complicated and bug-prone state
unwinding required should an error arise.

This hook also avoids passing a pointer to a not-yet-correctly-established
VMA avoiding any issues with referencing this data structure.

It rather provides a pointer to the new struct vm_area_desc descriptor type
which contains all required state and allows easy setting of required
parameters without any consideration needing to be paid to locking or
reference counts.

Note that nested filesystems like overlayfs are compatible with an
.mmap_prepare() callback since commit bb666b7c27 ("mm: add mmap_prepare()
compatibility layer for nested file systems").

In this patch we apply this change to file systems with relatively simple
mmap() hook logic - exfat, ceph, f2fs, bcachefs, zonefs, btrfs, ocfs2,
orangefs, nilfs2, romfs, ramfs and aio.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Link: https://lore.kernel.org/f528ac4f35b9378931bd800920fee53fc0c5c74d.1750099179.git.lorenzo.stoakes@oracle.com
Acked-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-06-19 13:56:59 +02:00
..
tests btrfs: convert the buffer_radix to an xarray 2025-05-15 14:30:50 +02:00
accessors.c
accessors.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
acl.c
acl.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
async-thread.c btrfs: use list_first_entry() everywhere 2025-05-15 14:30:47 +02:00
async-thread.h
backref.c btrfs: use list_first_entry() everywhere 2025-05-15 14:30:47 +02:00
backref.h btrfs: use unsigned types for constants defined as bit shifts 2025-05-15 14:30:48 +02:00
bio.c btrfs: change return type of btrfs_alloc_dummy_sum() to int 2025-05-15 14:30:49 +02:00
bio.h btrfs: pass a physical address to btrfs_repair_io_failure() 2025-05-15 14:30:46 +02:00
block-group.c btrfs: use boolean for delalloc argument to btrfs_free_reserved_bytes() 2025-05-15 14:30:56 +02:00
block-group.h btrfs: use boolean for delalloc argument to btrfs_free_reserved_bytes() 2025-05-15 14:30:56 +02:00
block-rsv.c btrfs: add block reserve for treelog 2025-05-15 14:30:53 +02:00
block-rsv.h btrfs: add block reserve for treelog 2025-05-15 14:30:53 +02:00
btrfs_inode.h btrfs: handle unaligned EOF truncation correctly for subpage cases 2025-05-15 14:30:55 +02:00
compression.c btrfs: rename ret2 to ret in btrfs_submit_compressed_read() 2025-05-15 14:30:49 +02:00
compression.h btrfs: prepare compression paths for large data folios 2025-05-15 14:30:45 +02:00
ctree.c btrfs: avoid redundant path slot assignment in btrfs_search_forward() 2025-03-18 20:35:52 +01:00
ctree.h btrfs: move misplaced comment of btrfs_path::keep_locks 2025-05-17 21:15:08 +02:00
defrag.c btrfs: defrag: use list_last_entry() at defrag_collect_targets() 2025-05-15 14:30:55 +02:00
defrag.h btrfs: pass struct btrfs_inode to btrfs_defrag_file() 2025-03-18 20:35:43 +01:00
delalloc-space.c btrfs: add block reserve for treelog 2025-05-15 14:30:53 +02:00
delalloc-space.h btrfs: pass struct btrfs_inode to btrfs_free_reserved_data_space_noquota() 2025-05-15 14:30:52 +02:00
delayed-inode.c btrfs: simplify extracting delayed node at btrfs_first_prepared_delayed_node() 2025-05-15 14:30:55 +02:00
delayed-inode.h btrfs: pass struct btrfs_inode to btrfs_fill_inode() 2025-03-18 20:35:43 +01:00
delayed-ref.c btrfs: simplify return logic from btrfs_delayed_ref_init() 2025-05-15 14:30:46 +02:00
delayed-ref.h btrfs: remove BTRFS_REF_LAST from enum btrfs_ref_type 2025-05-15 14:30:47 +02:00
dev-replace.c btrfs: trivial conversion to return bool instead of int 2025-05-15 14:30:49 +02:00
dev-replace.h btrfs: trivial conversion to return bool instead of int 2025-05-15 14:30:49 +02:00
dir-item.c btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_check_dir_item_collision() 2025-03-18 20:35:47 +01:00
dir-item.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
direct-io.c btrfs: remove superfluous return value check at btrfs_dio_iomap_begin() 2025-05-15 14:30:57 +02:00
direct-io.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
discard.c btrfs: use verbose assert at peek_discard_list() 2025-05-15 14:30:55 +02:00
discard.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
disk-io.c btrfs: log error codes during failures when writing super blocks 2025-05-15 14:30:57 +02:00
disk-io.h btrfs: get rid of btrfs_read_dev_super() 2025-05-15 14:30:50 +02:00
export.c btrfs: make btrfs_iget() return a btrfs inode instead 2025-03-18 20:35:50 +01:00
export.h
extent_io.c btrfs: don't drop a reference if btrfs_check_write_meta_pointer() fails 2025-05-27 13:39:15 +02:00
extent_io.h btrfs: use buffer xarray for extent buffer writeback operations 2025-05-15 14:30:50 +02:00
extent_map.c btrfs: rename __tree_search() to remove double underscore prefix 2025-05-15 14:30:45 +02:00
extent_map.h btrfs: rename remaining exported extent map functions 2025-05-15 14:30:45 +02:00
extent-io-tree.c btrfs: make extent unpinning more efficient when committing transaction 2025-05-15 14:30:52 +02:00
extent-io-tree.h btrfs: make extent unpinning more efficient when committing transaction 2025-05-15 14:30:52 +02:00
extent-tree.c btrfs: fix harmless race getting delayed ref head count when running delayed refs 2025-05-15 14:30:57 +02:00
extent-tree.h btrfs: use boolean for delalloc argument to btrfs_free_reserved_extent() 2025-05-15 14:30:56 +02:00
fiemap.c btrfs: rename free_extent_state() to include a btrfs prefix 2025-05-15 14:30:44 +02:00
fiemap.h
file-item.c btrfs: change return type of btrfs_alloc_dummy_sum() to int 2025-05-15 14:30:49 +02:00
file-item.h btrfs: change return type of btrfs_alloc_dummy_sum() to int 2025-05-15 14:30:49 +02:00
file.c fs: replace mmap hook with .mmap_prepare for simple mappings 2025-06-19 13:56:59 +02:00
file.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
free-space-cache.c btrfs: return real error from __filemap_get_folio() calls 2025-05-15 14:30:57 +02:00
free-space-cache.h
free-space-tree.c btrfs: move transaction aborts to the error site in add_to_free_space_tree() 2025-05-15 14:30:54 +02:00
free-space-tree.h
fs.c btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
fs.h btrfs: add block reserve for treelog 2025-05-15 14:30:53 +02:00
inode-item.c btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_insert_inode_extref() 2025-05-15 14:30:42 +02:00
inode-item.h
inode.c btrfs: return real error from __filemap_get_folio() calls 2025-05-15 14:30:57 +02:00
ioctl.c for-6.16-tag 2025-05-26 12:24:43 -07:00
ioctl.h btrfs: pass struct btrfs_inode to btrfs_sync_inode_flags_to_i_flags() 2025-03-18 20:35:49 +01:00
Kconfig btrfs: update Kconfig option descriptions 2025-05-15 14:30:56 +02:00
locking.c btrfs: trivial conversion to return bool instead of int 2025-05-15 14:30:49 +02:00
locking.h btrfs: trivial conversion to return bool instead of int 2025-05-15 14:30:49 +02:00
lru_cache.c
lru_cache.h
lzo.c btrfs: prepare compression paths for large data folios 2025-05-15 14:30:45 +02:00
Makefile
messages.c
messages.h btrfs: add debug build only WARN 2025-05-15 14:30:47 +02:00
misc.h
ordered-data.c btrfs: fold error checks when allocating ordered extent and update comments 2025-05-15 14:30:56 +02:00
ordered-data.h btrfs: introduce a read path dedicated extent lock helper 2025-03-18 20:35:48 +01:00
orphan.c
orphan.h
print-tree.c
print-tree.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
props.c btrfs: props: switch prop_handler::extract to struct btrfs_inode 2025-03-18 20:35:44 +01:00
props.h btrfs: pass struct btrfs_inode to btrfs_inode_inherit_props() 2025-03-18 20:35:44 +01:00
qgroup.c btrfs: convert WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG)) to DEBUG_WARN 2025-05-15 14:30:47 +02:00
qgroup.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid-stripe-tree.c btrfs: don't use btrfs_set_item_key_safe on RAID stripe-extents 2025-01-14 15:52:22 +01:00
raid-stripe-tree.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid56.c btrfs: raid56: use list_last_entry() at cache_rbio() 2025-05-15 14:30:54 +02:00
raid56.h
rcu-string.h
ref-verify.c
ref-verify.h
reflink.c btrfs: return real error from __filemap_get_folio() calls 2025-05-15 14:30:57 +02:00
reflink.h
relocation.c btrfs: pass struct btrfs_inode to btrfs_free_reserved_data_space_noquota() 2025-05-15 14:30:52 +02:00
relocation.h
root-tree.c btrfs: root-tree: remove unnecessary calls to btrfs_mark_buffer_dirty() 2025-01-13 14:53:20 +01:00
root-tree.h
scrub.c for-6.16-tag 2025-05-26 12:24:43 -07:00
scrub.h
send.c btrfs: send: remove btrfs_debug() calls 2025-05-15 14:30:56 +02:00
send.h btrfs: pass btrfs_root pointers to send ioctl parameters 2025-03-18 20:35:49 +01:00
space-info.c btrfs: add support for reclaiming from sub-space space_info 2025-05-15 14:30:54 +02:00
space-info.h btrfs: introduce tree-log sub-space_info 2025-05-15 14:30:53 +02:00
subpage.c btrfs: subpage: prepare for large data folios 2025-05-15 14:30:42 +02:00
subpage.h btrfs: replace PAGE_SIZE with folio_size for subpage.[ch] 2025-03-18 20:35:52 +01:00
super.c btrfs: remove standalone "nologreplay" mount option 2025-05-16 19:16:22 +02:00
super.h
sysfs.c btrfs: introduce tree-log sub-space_info 2025-05-15 14:30:53 +02:00
sysfs.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
transaction.c btrfs: simplify cow only root list extraction during transaction commit 2025-05-15 14:30:54 +02:00
transaction.h
tree-checker.c btrfs: convert WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG)) to DEBUG_WARN 2025-05-15 14:30:47 +02:00
tree-checker.h btrfs: validate system chunk array at btrfs_validate_super() 2025-01-13 14:53:18 +01:00
tree-log.c btrfs: use list_first_entry() everywhere 2025-05-15 14:30:47 +02:00
tree-log.h
tree-mod-log.c
tree-mod-log.h
ulist.c
ulist.h
uuid-tree.c btrfs: uuid-tree: remove unnecessary call to btrfs_mark_buffer_dirty() 2025-01-13 14:53:20 +01:00
uuid-tree.h
verity.c btrfs: pass struct btrfs_inode to btrfs_sync_inode_flags_to_i_flags() 2025-03-18 20:35:49 +01:00
verity.h
volumes.c btrfs: add space_info parameter for block group creation 2025-05-15 14:30:53 +02:00
volumes.h btrfs: add space_info parameter for block group creation 2025-05-15 14:30:53 +02:00
xattr.c btrfs: xattr: remove unnecessary call to btrfs_mark_buffer_dirty() 2025-01-13 14:53:20 +01:00
xattr.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
zlib.c btrfs: prepare compression paths for large data folios 2025-05-15 14:30:45 +02:00
zoned.c btrfs: convert the buffer_radix to an xarray 2025-05-15 14:30:50 +02:00
zoned.h
zstd.c btrfs: use unsigned types for constants defined as bit shifts 2025-05-15 14:30:48 +02:00