]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
btrfs: don't use set/get token for single assignment in overwrite_item
authorDavid Sterba <dsterba@suse.com>
Wed, 29 Apr 2020 13:29:53 +0000 (15:29 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:32 +0000 (11:25 +0200)
The set/get token is supposed to cache the last page that was accessed
so it speeds up subsequential access to the eb. It does not make sense
to use that for just one change, which is the case of inode size in
overwrite_item.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c

index ee1c627bd618323a15a3a3e88ecf1e4761d495fc..60febf2082eea06a9189769a3bb3df9509ab5e78 100644 (file)
@@ -505,13 +505,8 @@ insert:
                         */
                        if (S_ISREG(btrfs_inode_mode(eb, src_item)) &&
                            S_ISREG(btrfs_inode_mode(dst_eb, dst_item)) &&
-                           ino_size != 0) {
-                               struct btrfs_map_token token;
-
-                               btrfs_init_map_token(&token, dst_eb);
-                               btrfs_set_token_inode_size(&token, dst_item,
-                                                          ino_size);
-                       }
+                           ino_size != 0)
+                               btrfs_set_inode_size(dst_eb, dst_item, ino_size);
                        goto no_copy;
                }