linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: remove unnecessary key copy when logging inode
@ 2013-10-07 20:20 Filipe David Borba Manana
  2013-10-07 21:57 ` Zach Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Filipe David Borba Manana @ 2013-10-07 20:20 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Filipe David Borba Manana

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Btrfs: remove unnecessary key copy when logging inode
  2013-10-07 20:20 [PATCH] Btrfs: remove unnecessary key copy when logging inode Filipe David Borba Manana
@ 2013-10-07 21:57 ` Zach Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Zach Brown @ 2013-10-07 21:57 UTC (permalink / raw)
  To: Filipe David Borba Manana; +Cc: linux-btrfs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-07 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07 20:20 [PATCH] Btrfs: remove unnecessary key copy when logging inode Filipe David Borba Manana
2013-10-07 21:57 ` Zach Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).