diff options
author | Nikolay Borisov <nborisov@suse.com> | 2017-12-01 10:19:40 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-01-22 16:08:15 +0100 |
commit | 5c9a702ed1724f1c856c7299fe1faf9b3b5b4eb0 (patch) | |
tree | 29ada08bb11ed4d199b474dd448a4ee1b1dcc266 /fs/btrfs/inode.c | |
parent | btrfs: tree-checker: use %zu format string for size_t (diff) | |
download | linux-5c9a702ed1724f1c856c7299fe1faf9b3b5b4eb0.tar.xz linux-5c9a702ed1724f1c856c7299fe1faf9b3b5b4eb0.zip |
btrfs: Remove unused variable in btrfs_get_extent
trans was statically assigned to NULL and this never changed over the
course of btrfs_get_extent. So remove any code which checks whether
trans != NULL and just hardcode the fact trans is always NULL.
Resolves-coverity-id: 112806
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/inode.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e87ec11c0986..8b6c59a068d2 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6948,7 +6948,6 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct extent_map *em = NULL; struct extent_map_tree *em_tree = &inode->extent_tree; struct extent_io_tree *io_tree = &inode->io_tree; - struct btrfs_trans_handle *trans = NULL; const bool new_inline = !page || create; read_lock(&em_tree->lock); @@ -6989,8 +6988,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, path->reada = READA_FORWARD; } - ret = btrfs_lookup_file_extent(trans, root, path, - objectid, start, trans != NULL); + ret = btrfs_lookup_file_extent(NULL, root, path, objectid, start, 0); if (ret < 0) { err = ret; goto out; @@ -7186,11 +7184,6 @@ out: trace_btrfs_get_extent(root, inode, em); btrfs_free_path(path); - if (trans) { - ret = btrfs_end_transaction(trans); - if (!err) - err = ret; - } if (err) { free_extent_map(em); return ERR_PTR(err); |