mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 18:43:33 -05:00
btrfs: simplify IS_ERR/PTR_ERR checks
IS_ERR(p) && PTR_ERR(p) == n is a weird way to spell p == ERR_PTR(n). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Reviewed-by: David Sterba <dsterba@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> [ update changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2e19f1f9d3
commit
8d9e220ca0
2 changed files with 3 additions and 4 deletions
|
@ -680,7 +680,7 @@ btrfs_attach_transaction_barrier(struct btrfs_root *root)
|
||||||
|
|
||||||
trans = start_transaction(root, 0, TRANS_ATTACH,
|
trans = start_transaction(root, 0, TRANS_ATTACH,
|
||||||
BTRFS_RESERVE_NO_FLUSH, true);
|
BTRFS_RESERVE_NO_FLUSH, true);
|
||||||
if (IS_ERR(trans) && PTR_ERR(trans) == -ENOENT)
|
if (trans == ERR_PTR(-ENOENT))
|
||||||
btrfs_wait_for_commit(root->fs_info, 0);
|
btrfs_wait_for_commit(root->fs_info, 0);
|
||||||
|
|
||||||
return trans;
|
return trans;
|
||||||
|
|
|
@ -2181,7 +2181,7 @@ again:
|
||||||
dir_key->offset,
|
dir_key->offset,
|
||||||
name, name_len, 0);
|
name, name_len, 0);
|
||||||
}
|
}
|
||||||
if (!log_di || (IS_ERR(log_di) && PTR_ERR(log_di) == -ENOENT)) {
|
if (!log_di || log_di == ERR_PTR(-ENOENT)) {
|
||||||
btrfs_dir_item_key_to_cpu(eb, di, &location);
|
btrfs_dir_item_key_to_cpu(eb, di, &location);
|
||||||
btrfs_release_path(path);
|
btrfs_release_path(path);
|
||||||
btrfs_release_path(log_path);
|
btrfs_release_path(log_path);
|
||||||
|
@ -5011,8 +5011,7 @@ again:
|
||||||
* we don't need to do more work nor fallback to
|
* we don't need to do more work nor fallback to
|
||||||
* a transaction commit.
|
* a transaction commit.
|
||||||
*/
|
*/
|
||||||
if (IS_ERR(other_inode) &&
|
if (other_inode == ERR_PTR(-ENOENT)) {
|
||||||
PTR_ERR(other_inode) == -ENOENT) {
|
|
||||||
goto next_key;
|
goto next_key;
|
||||||
} else if (IS_ERR(other_inode)) {
|
} else if (IS_ERR(other_inode)) {
|
||||||
err = PTR_ERR(other_inode);
|
err = PTR_ERR(other_inode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue