mbox series

[v2,0/2] btrfs: clean up btrfs_iget, btrfs_iget_path usage

Message ID cover.1724184314.git.loemra.dev@gmail.com (mailing list archive)
Headers show
Series btrfs: clean up btrfs_iget, btrfs_iget_path usage | expand

Message

Leo Martins Aug. 20, 2024, 8:13 p.m. UTC
The first patch moves the path allocation from inside
btrfs_read_locked_inode to btrfs_iget. This makes the code easier to
reason about as it is clear where the allocation occurs and who is in
charge of freeing the path.

The second patch moves the clean up code from btrfs_iget_path into
btrfs_read_locked_inode simplifyiung btrfs_iget_path.

Version 2 includes the modifications suggested by David Sterba:
Patch 1/2:
	- Added an ASSERT(path) to make sure that btrfs_read_locked_inode is
	never called with a null path.
	- Fixed btrfs_iget to more closely match btrfs standards.
	  Contiguous declaration at the top, with no non-trivial
	  assignments.

Leo Martins (2):
  btrfs: remove conditional path allocation from read_locked_inode, add
    path allocation to iget
  btrfs: move clean up code from btrfs_iget_path to
    btrfs_read_locked_inode

 fs/btrfs/inode.c | 128 +++++++++++++++++++++++------------------------
 1 file changed, 64 insertions(+), 64 deletions(-)