]> www.infradead.org Git - users/dwmw2/linux.git/commit
btrfs: cleanup duplicated parameters related to btrfs_alloc_ordered_extent
authorQu Wenruo <wqu@suse.com>
Fri, 3 May 2024 03:19:57 +0000 (12:49 +0930)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:21 +0000 (15:33 +0200)
commite9ea31fb5c1f90a006dccb6972664086447f4911
tree74fc012bbde9bb7114aa79401f5965e7cc6bf851
parentcdc627e65c7eb8d105f0b9e9695106e54eea1a6e
btrfs: cleanup duplicated parameters related to btrfs_alloc_ordered_extent

All parameters after @filepos of btrfs_alloc_ordered_extent() can be
replaced with btrfs_file_extent structure.

This patch does the cleanup, meanwhile some points to note:

- Move btrfs_file_extent structure to ordered-data.h
  The structure is needed by both btrfs_alloc_ordered_extent() and
  can_nocow_extent(), but since btrfs_inode.h includes
  ordered-data.h, so we need to move the structure to ordered-data.h.

- Move the special handling of NOCOW/PREALLOC into
  btrfs_alloc_ordered_extent()
  This is to allow btrfs_split_ordered_extent() to properly split them
  for DIO.
  For now just move the handling into btrfs_alloc_ordered_extent() to
  simplify the callers.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c
fs/btrfs/ordered-data.c
fs/btrfs/ordered-data.h