diff options
| author | Filipe Manana <fdmanana@suse.com> | 2026-01-20 20:03:45 +0000 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-02-03 07:56:22 +0100 |
| commit | 610ff1c9df5499aed83d6a1ca2e9e9a2aefecc13 (patch) | |
| tree | 1959eb3cb202173c38eefa166acf65a063577020 | |
| parent | cc27540dd09571938cf8e9c80a311b403ac073c4 (diff) | |
btrfs: remove out label in btrfs_mark_extent_written()
There is no point in having the label since all it does is return the
value in the 'ret' variable. Instead make every goto return directly
and remove the label.
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>
| -rw-r--r-- | fs/btrfs/file.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 1759776d2d57..56ece1109832 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -565,7 +565,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, int del_nr = 0; int del_slot = 0; int recow; - int ret = 0; + int ret; u64 ino = btrfs_ino(inode); path = btrfs_alloc_path(); @@ -580,7 +580,7 @@ again: ret = btrfs_search_slot(trans, root, &key, path, -1, 1); if (ret < 0) - goto out; + return ret; if (ret > 0 && path->slots[0] > 0) path->slots[0]--; @@ -589,20 +589,20 @@ again: if (unlikely(key.objectid != ino || key.type != BTRFS_EXTENT_DATA_KEY)) { ret = -EINVAL; btrfs_abort_transaction(trans, ret); - goto out; + return ret; } fi = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); if (unlikely(btrfs_file_extent_type(leaf, fi) != BTRFS_FILE_EXTENT_PREALLOC)) { ret = -EINVAL; btrfs_abort_transaction(trans, ret); - goto out; + return ret; } extent_end = key.offset + btrfs_file_extent_num_bytes(leaf, fi); if (unlikely(key.offset > start || extent_end < end)) { ret = -EINVAL; btrfs_abort_transaction(trans, ret); - goto out; + return ret; } bytenr = btrfs_file_extent_disk_bytenr(leaf, fi); @@ -632,7 +632,7 @@ again: trans->transid); btrfs_set_file_extent_num_bytes(leaf, fi, end - other_start); - goto out; + return 0; } } @@ -660,7 +660,7 @@ again: other_end - start); btrfs_set_file_extent_offset(leaf, fi, start - orig_offset); - goto out; + return 0; } } @@ -676,7 +676,7 @@ again: } if (unlikely(ret < 0)) { btrfs_abort_transaction(trans, ret); - goto out; + return ret; } leaf = path->nodes[0]; @@ -704,7 +704,7 @@ again: ret = btrfs_inc_extent_ref(trans, &ref); if (unlikely(ret)) { btrfs_abort_transaction(trans, ret); - goto out; + return ret; } if (split == start) { @@ -713,7 +713,7 @@ again: if (unlikely(start != key.offset)) { ret = -EINVAL; btrfs_abort_transaction(trans, ret); - goto out; + return ret; } path->slots[0]--; extent_end = end; @@ -744,7 +744,7 @@ again: ret = btrfs_free_extent(trans, &ref); if (unlikely(ret)) { btrfs_abort_transaction(trans, ret); - goto out; + return ret; } } other_start = 0; @@ -762,7 +762,7 @@ again: ret = btrfs_free_extent(trans, &ref); if (unlikely(ret)) { btrfs_abort_transaction(trans, ret); - goto out; + return ret; } } if (del_nr == 0) { @@ -783,11 +783,11 @@ again: ret = btrfs_del_items(trans, root, path, del_slot, del_nr); if (unlikely(ret < 0)) { btrfs_abort_transaction(trans, ret); - goto out; + return ret; } } -out: - return ret; + + return 0; } /* |
