]> git.hungrycats.org Git - linux/commit
btrfs: cleanup and rename submit_extent_folio()
authorQu Wenruo <wqu@suse.com>
Sun, 13 Sep 2026 11:29:15 +0000 (20:59 +0930)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Sep 2026 13:22:05 +0000 (15:22 +0200)
commit448c6f99ce61d5dc258823e9b834dbfeafddd7c5
tree69af9f8b4dab370b1d049eb78d5d8176dee4bd41
parent6d55b4bf99d73c0bc7180c1b88f3930410ab1591
btrfs: cleanup and rename submit_extent_folio()

Cleanup submit_extent_folio() by:

- Remove @size parameter
  Since commit b2e743927fdd ("btrfs: make btrfs_do_readpage() to do
  block-by-block read"), all callers are passing sectorsize as @size,
  so there is no need for such parameter.

  Furthermore since we only write one block at a time, there is no need
  for a while() loop, nor the advance of various local variables.

- Update the comments on the parameter list
  * @disk_bytenr is shared for both read and write
  * rename @page to @folio

- Update the return value to return 0 or error
  Since we won't queue multiple blocks anyway, there is no point in
  returning the queued bytes.
  It makes more sense to return an error code, although the only error
  code will be -EUCLEAN for writes.

- Rename submit_extent_folio() to submit_one_block()

- Rename submit_one_sector() to submit_write_sector()

- Update the error message to utilize the new returned error code inside
  submit_write_sector()

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c