Filipe David Borba Manana
2013-Oct-07 20:20 UTC
[PATCH] Btrfs: remove unnecessary key copy when logging inode
The btrfs_insert_empty_item() function doesn''t modify its
key argument.
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
---
fs/btrfs/tree-log.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 964c583..2a1f690 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3167,11 +3167,10 @@ static int log_inode_item(struct btrfs_trans_handle
*trans,
struct inode *inode)
{
struct btrfs_inode_item *inode_item;
- struct btrfs_key key;
int ret;
- memcpy(&key, &BTRFS_I(inode)->location, sizeof(key));
- ret = btrfs_insert_empty_item(trans, log, path, &key,
+ ret = btrfs_insert_empty_item(trans, log, path,
+ &BTRFS_I(inode)->location,
sizeof(*inode_item));
if (ret && ret != -EEXIST)
return ret;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Zach Brown
2013-Oct-07 21:57 UTC
Re: [PATCH] Btrfs: remove unnecessary key copy when logging inode
On Mon, Oct 07, 2013 at 09:20:44PM +0100, Filipe David Borba Manana wrote:> The btrfs_insert_empty_item() function doesn''t modify its > key argument.Looks reasonable to me. Reviewed-by: Zach Brown <zab@redhat.com> - z -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html