Commit 7c855e1
btrfs: remove conditional path allocation in btrfs_read_locked_inode()
Remove conditional path allocation from btrfs_read_locked_inode(). Add
an ASSERT(path) to indicate it should never be called with a NULL path.
Call btrfs_read_locked_inode() directly from btrfs_iget(). This causes
code duplication between btrfs_iget() and btrfs_iget_path(), but I
think this is justifiable as it removes the need for conditionally
allocating the path inside of btrfs_read_locked_inode(). This makes the
code easier to reason about and makes it clear who has the
responsibility of allocating and freeing the path.
Signed-off-by: Leo Martins <loemra.dev@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 6967399 commit 7c855e1
1 file changed
+29
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3795 | 3795 | | |
3796 | 3796 | | |
3797 | 3797 | | |
3798 | | - | |
3799 | | - | |
| 3798 | + | |
3800 | 3799 | | |
3801 | 3800 | | |
3802 | | - | |
3803 | 3801 | | |
3804 | 3802 | | |
3805 | 3803 | | |
| |||
3819 | 3817 | | |
3820 | 3818 | | |
3821 | 3819 | | |
3822 | | - | |
3823 | | - | |
3824 | | - | |
3825 | | - | |
3826 | | - | |
| 3820 | + | |
3827 | 3821 | | |
3828 | 3822 | | |
3829 | 3823 | | |
3830 | 3824 | | |
3831 | 3825 | | |
3832 | | - | |
3833 | | - | |
3834 | 3826 | | |
3835 | 3827 | | |
3836 | 3828 | | |
| |||
3972 | 3964 | | |
3973 | 3965 | | |
3974 | 3966 | | |
3975 | | - | |
3976 | | - | |
3977 | 3967 | | |
3978 | 3968 | | |
3979 | 3969 | | |
| |||
5579 | 5569 | | |
5580 | 5570 | | |
5581 | 5571 | | |
5582 | | - | |
5583 | | - | |
5584 | | - | |
5585 | | - | |
| 5572 | + | |
| 5573 | + | |
5586 | 5574 | | |
5587 | 5575 | | |
5588 | 5576 | | |
| |||
5605 | 5593 | | |
5606 | 5594 | | |
5607 | 5595 | | |
| 5596 | + | |
| 5597 | + | |
| 5598 | + | |
5608 | 5599 | | |
5609 | 5600 | | |
5610 | | - | |
| 5601 | + | |
| 5602 | + | |
| 5603 | + | |
| 5604 | + | |
| 5605 | + | |
| 5606 | + | |
| 5607 | + | |
| 5608 | + | |
| 5609 | + | |
| 5610 | + | |
| 5611 | + | |
| 5612 | + | |
| 5613 | + | |
| 5614 | + | |
| 5615 | + | |
| 5616 | + | |
| 5617 | + | |
| 5618 | + | |
| 5619 | + | |
| 5620 | + | |
| 5621 | + | |
| 5622 | + | |
5611 | 5623 | | |
5612 | 5624 | | |
5613 | 5625 | | |
| |||
0 commit comments