Commit d887f03
btrfs: simplify getting and extracting previous transaction during commit
Instead of detecting if there is a previous transaction by comparing the
current transaction's list prev member to the head of the transaction
list (fs_info->trans_list), use the list_is_first() helper which contains
that logic and the naming makes sense since a new transaction is always
added to the end of the list fs_info->trans_list with list_add_tail().
And instead of extracting the previous transaction with the more generic
list_entry() helper against the current transaction's list prev member,
use the more specific list_prev_entry() helper, which makes it clear what
we are doing and is shorter.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 8c4cfa9 commit d887f03
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2271 | 2271 | | |
2272 | 2272 | | |
2273 | 2273 | | |
2274 | | - | |
| 2274 | + | |
2275 | 2275 | | |
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
2279 | 2279 | | |
2280 | | - | |
2281 | | - | |
| 2280 | + | |
2282 | 2281 | | |
2283 | 2282 | | |
2284 | 2283 | | |
| |||
0 commit comments