Commit d26d16a
btrfs: simplify cow only root list extraction during transaction commit
There's no need to keep a local variable to extract the first member of
the list and then do a list_entry() call, we can use list_first_entry()
instead, removing the need for the temporary variable and extracting the
first element in a single step.
Also, there's no need to do a list_del_init() followed by list_add_tail(),
instead we can use list_move_tail(). We are in transaction commit critical
section where we don't need to worry about concurrency and that's why we
don't take any locks and can use list_move_tail() (we do assert early at
commit_cowonly_roots() that we are in the critical section, that the
transaction's state is TRANS_STATE_COMMIT_DOING).
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 a20f732 commit d26d16a
1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1327 | 1327 | | |
1328 | 1328 | | |
1329 | 1329 | | |
1330 | | - | |
1331 | 1330 | | |
1332 | 1331 | | |
1333 | 1332 | | |
| |||
1363 | 1362 | | |
1364 | 1363 | | |
1365 | 1364 | | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
1369 | 1368 | | |
| 1369 | + | |
| 1370 | + | |
1370 | 1371 | | |
1371 | | - | |
1372 | | - | |
1373 | 1372 | | |
1374 | 1373 | | |
1375 | 1374 | | |
| |||
0 commit comments