linux/fs/btrfs
Qu Wenruo 37cc07cab7 btrfs: lzo: use folio_iter to handle lzo_decompress_bio()
Currently lzo_decompress_bio() is using
compressed_bio->compressed_folios[] array to grab each compressed folio.

This is making the code much easier to read, as we only need to maintain
a single iterator, @cur_in, and can easily grab any random folio using
@cur_in >> min_folio_shift as an index.

However lzo_decompress_bio() itself is ensured to only advance to the
next folio at one time, and compressed_folios[] is just a pointer to
each folio of the compressed bio, thus we have no real random access
requirement for lzo_decompress_bio().

Replace the compressed_folios[] access by a helper, get_current_folio(),
which uses folio_iter and an external folio counter to properly switch
the folio when needed.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
History 2026-02-03 07:56:17 +01:00
..
tests btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
accessors.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
accessors.h btrfs: allow mounting filesystems with remap-tree incompat flag 2026-02-03 07:54:35 +01:00
acl.c btrfs: apply the AUTO_K(V)FREE macros throughout the code 2025-11-24 22:34:51 +01:00
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 btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
backref.c btrfs: remove unreachable return after btrfs_backref_panic() in btrfs_backref_finish_upper_links() 2026-02-03 07:49:12 +01:00
backref.h btrfs: declare free_ipath() via DEFINE_FREE() 2025-11-24 22:34:51 +01:00
bio.c btrfs: move existing remaps before relocating block group 2026-02-03 07:54:35 +01:00
bio.h btrfs: move existing remaps before relocating block group 2026-02-03 07:54:35 +01:00
block-group.c btrfs: consolidate reclaim readiness checks in btrfs_should_reclaim() 2026-02-03 07:56:14 +01:00
block-group.h btrfs: populate fully_remapped_bgs_list on mount 2026-02-03 07:54:36 +01:00
block-rsv.c btrfs: add METADATA_REMAP chunk type 2026-02-03 07:54:27 +01:00
block-rsv.h btrfs: add METADATA_REMAP chunk type 2026-02-03 07:54:27 +01:00
btrfs_inode.h btrfs: make read verification handle bs > ps cases without large folios 2025-11-24 22:42:24 +01:00
compression.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
compression.h for-6.19-tag 2025-12-03 20:03:46 -08:00
ctree.c btrfs: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
ctree.h btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper 2026-02-03 06:38:32 +01:00
defrag.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
defrag.h btrfs: pass struct btrfs_inode to btrfs_defrag_file() 2025-03-18 20:35:43 +01:00
delalloc-space.c btrfs: remove fs_info argument from btrfs_reserve_metadata_bytes() 2025-11-24 21:59:11 +01: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: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
delayed-inode.h btrfs: fix delayed_node ref_tracker use after free 2025-10-22 09:40:04 +02:00
delayed-ref.c btrfs: remove fs_info argument from btrfs_reserve_metadata_bytes() 2025-11-24 21:59:11 +01:00
delayed-ref.h btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
dev-replace.c btrfs: use bool type for btrfs_path members used as booleans 2025-11-24 22:42:25 +01: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: remaining BTRFS_PATH_AUTO_FREE conversions 2025-11-25 01:53:33 +01:00
dir-item.h btrfs: rename inode number parameter passed to btrfs_check_dir_item_collision() 2025-07-22 00:05:00 +02:00
direct-io.c btrfs: enable direct IO for bs > ps cases 2026-02-03 06:38:32 +01:00
direct-io.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
discard.c btrfs: handle discarding fully-remapped block groups 2026-02-03 07:54:36 +01:00
discard.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
disk-io.c btrfs: populate fully_remapped_bgs_list on mount 2026-02-03 07:54:36 +01:00
disk-io.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
export.c btrfs: avoid potential out-of-bounds in btrfs_encode_fh() 2025-09-26 08:48:30 +02:00
export.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
extent-io-tree.c btrfs: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
extent-io-tree.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
extent-tree.c btrfs: use the btrfs_block_group_end() helper everywhere 2026-02-03 07:54:36 +01:00
extent-tree.h btrfs: add do_remap parameter to btrfs_discard_extent() 2026-02-03 07:54:35 +01:00
extent_io.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
extent_io.h btrfs: do not strictly require dirty metadata threshold for metadata writepages 2026-01-21 19:35:00 +01:00
extent_map.c for-6.18-tag 2025-09-30 08:14:49 -07:00
extent_map.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
fiemap.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
fiemap.h btrfs: move fiemap code into its own file 2024-07-11 15:33:20 +02:00
file-item.c btrfs: switch to library APIs for checksums 2026-02-03 06:38:32 +01:00
file-item.h btrfs: introduce btrfs_bio::async_csum 2025-11-24 22:42:21 +01:00
file.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
file.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
free-space-cache.c btrfs: don't pass io_ctl to __btrfs_write_out_cache() 2026-02-03 07:54:37 +01:00
free-space-cache.h btrfs: handle discarding fully-remapped block groups 2026-02-03 07:54:36 +01:00
free-space-tree.c btrfs: use the btrfs_block_group_end() helper everywhere 2026-02-03 07:54:36 +01:00
free-space-tree.h btrfs: handle setting up relocation of block group with remap-tree 2026-02-03 07:54:35 +01:00
fs.c btrfs: switch to library APIs for checksums 2026-02-03 06:38:32 +01:00
fs.h btrfs: handle deletions from remapped block group 2026-02-03 07:54:35 +01:00
inode-item.c btrfs: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
inode-item.h btrfs: remove unused parameters from btrfs_lookup_inode_extref() 2025-07-21 23:58:03 +02:00
inode.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
ioctl.c btrfs: move unlikely checks around btrfs_is_shutdown() into the helper 2026-02-03 07:49:12 +01:00
ioctl.h tree-wide: s/struct fileattr/struct file_kattr/g 2025-07-04 16:14:39 +02:00
Kconfig btrfs: allow mounting filesystems with remap-tree incompat flag 2026-02-03 07:54:35 +01:00
locking.c btrfs: add definitions and constants for remap-tree 2026-02-03 07:54:02 +01:00
locking.h btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
lru_cache.c btrfs: fix typos found by codespell 2023-12-15 23:00:04 +01:00
lru_cache.h btrfs: cleanup recursive include of the same header 2024-07-11 15:33:22 +02:00
lzo.c btrfs: lzo: use folio_iter to handle lzo_decompress_bio() 2026-02-03 07:56:17 +01:00
Makefile btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
messages.c btrfs: pass level to _btrfs_printk() to avoid parsing level from string 2026-02-03 07:49:10 +01:00
messages.h btrfs: remove ASSERT compatibility for gcc < 8.x 2026-02-03 07:49:10 +01:00
misc.h for-6.19-tag 2025-12-03 20:03:46 -08:00
ordered-data.c for-6.19-tag 2025-12-03 20:03:46 -08:00
ordered-data.h btrfs: introduce a read path dedicated extent lock helper 2025-03-18 20:35:48 +01:00
orphan.c btrfs: BTRFS_PATH_AUTO_FREE in orphan.c 2024-09-10 16:51:22 +02:00
orphan.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
print-tree.c btrfs: use the key format macros when printing keys 2025-11-24 22:03:02 +01:00
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: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
qgroup.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid-stripe-tree.c btrfs: use bool type for btrfs_path members used as booleans 2025-11-24 22:42:25 +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: remove the "_step" infix 2025-11-25 01:50:19 +01:00
raid56.h btrfs: raid56: introduce a new parameter to locate a sector 2025-11-25 01:46:58 +01:00
ref-verify.c btrfs: ref-verify: fix IS_ERR() vs NULL check in btrfs_build_ref_tree() 2025-10-22 09:40:07 +02:00
ref-verify.h btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
reflink.c btrfs: update comment for delalloc flush and oe wait in btrfs_clone_files() 2026-02-03 07:51:43 +01:00
reflink.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
relocation.c btrfs: populate fully_remapped_bgs_list on mount 2026-02-03 07:54:36 +01:00
relocation.h btrfs: handle setting up relocation of block group with remap-tree 2026-02-03 07:54:35 +01:00
root-tree.c btrfs: don't call btrfs_handle_fs_error() after failure to delete orphan item 2026-02-03 07:49:11 +01:00
root-tree.h btrfs: qgroup: fix qgroup prealloc rsv leak in subvolume operations 2024-04-02 19:18:23 +02:00
scrub.c btrfs: use the btrfs_block_group_end() helper everywhere 2026-02-03 07:54:36 +01:00
scrub.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
send.c for-6.19-rc5-tag 2026-01-17 19:29:32 -08:00
send.h btrfs: pass btrfs_root pointers to send ioctl parameters 2025-03-18 20:35:49 +01:00
space-info.c btrfs: fix periodic reclaim condition 2026-02-03 07:54:37 +01:00
space-info.h btrfs: move space_info_flag_to_str() to space-info.h 2026-02-03 07:49:12 +01:00
subpage.c for-6.19-tag 2025-12-03 20:03:46 -08:00
subpage.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
super.c btrfs: zoned: show statistics about zoned filesystems in mountstats 2026-02-03 07:49:12 +01:00
super.h btrfs: change BTRFS_MOUNT_* flags to 64bit type 2024-07-19 17:20:23 +02:00
sysfs.c btrfs: add METADATA_REMAP chunk type 2026-02-03 07:54:27 +01:00
sysfs.h btrfs: remove fs_info argument from btrfs_sysfs_add_space_info_type() 2025-11-24 22:02:30 +01:00
transaction.c btrfs: allow mounting filesystems with remap-tree incompat flag 2026-02-03 07:54:35 +01:00
transaction.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
tree-checker.c btrfs: add extended version of struct block_group_item 2026-02-03 07:54:34 +01:00
tree-checker.h btrfs: add definitions and constants for remap-tree 2026-02-03 07:54:02 +01:00
tree-log.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
tree-log.h btrfs: reduce arguments to btrfs_del_inode_ref_in_log() 2025-11-25 01:53:33 +01:00
tree-mod-log.c btrfs: reduce size of struct tree_mod_elem 2025-07-22 00:09:20 +02:00
tree-mod-log.h btrfs: drop unused parameter path from btrfs_tree_mod_log_rewind() 2024-11-11 14:34:15 +01:00
ulist.c btrfs: use rb_find_add() in ulist_rbtree_insert() 2025-07-21 23:53:25 +02:00
ulist.h btrfs: preallocate ulist memory for qgroup rsv 2024-07-11 15:33:26 +02:00
uuid-tree.c btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions 2025-11-24 21:59:11 +01:00
uuid-tree.h btrfs: move uuid tree related code to uuid-tree.[ch] 2024-09-10 16:51:12 +02:00
verity.c ARM: 2025-12-05 17:01:20 -08:00
verity.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
volumes.c btrfs: allow balancing remap tree 2026-02-03 07:54:36 +01:00
volumes.h btrfs: add do_remap parameter to btrfs_discard_extent() 2026-02-03 07:54:35 +01:00
xattr.c btrfs: remaining BTRFS_PATH_AUTO_FREE conversions 2025-11-25 01:53:33 +01:00
xattr.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
zlib.c btrfs: zlib: fix the folio leak on S390 hardware acceleration 2026-01-21 19:35:41 +01:00
zoned.c btrfs: use the btrfs_block_group_end() helper everywhere 2026-02-03 07:54:36 +01:00
zoned.h btrfs: zoned: show statistics about zoned filesystems in mountstats 2026-02-03 07:49:12 +01:00
zstd.c btrfs: add unlikely annotations to branches leading to EIO 2025-09-23 08:49:26 +02:00