Skip to contentSkip to conversation

Btrfs: remove unnecessary key copy when logging inode

PATCH In review Filipe David Borba Manana 2 participants 2 messages Oct 7, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: remove unnecessary key copy when logging inode

The btrfs_insert_empty_item() function doesn't modify its key argument.

---
 fs/btrfs/tree-log.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/btrfs/tree-log.c +2 -3
index 964c583..2a1f690 100644
@@ -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;
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Filipe David Borba Manana

The btrfs_insert_empty_item() function doesn't modify its key argument.

Looks reasonable to me.

- z