linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs
@ 2015-05-18 17:24 Fabian Frederick
  2015-05-18 17:24 ` [PATCH 2/2 linux-next] btrfs: use swap() in merge_ref() Fabian Frederick
  2015-05-19  9:21 ` [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Fabian Frederick @ 2015-05-18 17:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Chris Mason, Josef Bacik, David Sterba, linux-btrfs

Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/btrfs/backref.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 9de772e..01abe4c 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -530,7 +530,6 @@ static void __merge_refs(struct list_head *head, int mode)
 		for (pos2 = pos1->next, n2 = pos2->next; pos2 != head;
 		     pos2 = n2, n2 = pos2->next) {
 			struct __prelim_ref *ref2;
-			struct __prelim_ref *xchg;
 			struct extent_inode_elem *eie;
 
 			ref2 = list_entry(pos2, struct __prelim_ref, list);
@@ -538,11 +537,8 @@ static void __merge_refs(struct list_head *head, int mode)
 			if (mode == 1) {
 				if (!ref_for_same_block(ref1, ref2))
 					continue;
-				if (!ref1->parent && ref2->parent) {
-					xchg = ref1;
-					ref1 = ref2;
-					ref2 = xchg;
-				}
+				if (!ref1->parent && ref2->parent)
+					swap(ref1, ref2);
 			} else {
 				if (ref1->parent != ref2->parent)
 					continue;
-- 
2.4.0


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

* [PATCH 2/2 linux-next] btrfs: use swap() in merge_ref()
  2015-05-18 17:24 [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs Fabian Frederick
@ 2015-05-18 17:24 ` Fabian Frederick
  2015-05-19  9:21   ` David Sterba
  2015-05-19  9:21 ` [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs David Sterba
  1 sibling, 1 reply; 4+ messages in thread
From: Fabian Frederick @ 2015-05-18 17:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Chris Mason, Josef Bacik, David Sterba, linux-btrfs

Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/btrfs/delayed-ref.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 8f8ed7d..97c5a19 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -301,11 +301,7 @@ static int merge_ref(struct btrfs_trans_handle *trans,
 			mod = next->ref_mod;
 		} else {
 			if (ref->ref_mod < next->ref_mod) {
-				struct btrfs_delayed_ref_node *tmp;
-
-				tmp = ref;
-				ref = next;
-				next = tmp;
+				swap(ref, next);
 				done = 1;
 			}
 			mod = -next->ref_mod;
-- 
2.4.0


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

* Re: [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs
  2015-05-18 17:24 [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs Fabian Frederick
  2015-05-18 17:24 ` [PATCH 2/2 linux-next] btrfs: use swap() in merge_ref() Fabian Frederick
@ 2015-05-19  9:21 ` David Sterba
  1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-05-19  9:21 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Chris Mason, Josef Bacik, linux-btrfs

On Mon, May 18, 2015 at 07:24:12PM +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Reviewed-by: David Sterba <dsterba@suse.cz>

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

* Re: [PATCH 2/2 linux-next] btrfs: use swap() in merge_ref()
  2015-05-18 17:24 ` [PATCH 2/2 linux-next] btrfs: use swap() in merge_ref() Fabian Frederick
@ 2015-05-19  9:21   ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-05-19  9:21 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Chris Mason, Josef Bacik, linux-btrfs

On Mon, May 18, 2015 at 07:24:13PM +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Reviewed-by: David Sterba <dsterba@suse.cz>

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

end of thread, other threads:[~2015-05-19  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 17:24 [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs Fabian Frederick
2015-05-18 17:24 ` [PATCH 2/2 linux-next] btrfs: use swap() in merge_ref() Fabian Frederick
2015-05-19  9:21   ` David Sterba
2015-05-19  9:21 ` [PATCH 1/2 linux-next] btrfs: use swap() in __merge_refs David Sterba

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).