* [PATCH] Remove code duplication in comp_keys
@ 2009-07-23 22:54 Diego Calleja
2009-07-24 15:10 ` Chris Mason
0 siblings, 1 reply; 2+ messages in thread
From: Diego Calleja @ 2009-07-23 22:54 UTC (permalink / raw)
To: Chris Mason; +Cc: linux-btrfs
comp_keys is duplicating what is done in btrfs_comp_cpu_keys, so just
call it.
Signed-off-by: Diego Calleja <diegocg@gmail.com>
---
fs/btrfs/ctree.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
Index: linux/fs/btrfs/ctree.c
===================================================================
--- linux.orig/fs/btrfs/ctree.c 2009-07-24 00:47:20.936410297 +0200
+++ linux/fs/btrfs/ctree.c 2009-07-24 00:48:02.368160146 +0200
@@ -557,19 +557,7 @@ static int comp_keys(struct btrfs_disk_k
btrfs_disk_key_to_cpu(&k1, disk);
- if (k1.objectid > k2->objectid)
- return 1;
- if (k1.objectid < k2->objectid)
- return -1;
- if (k1.type > k2->type)
- return 1;
- if (k1.type < k2->type)
- return -1;
- if (k1.offset > k2->offset)
- return 1;
- if (k1.offset < k2->offset)
- return -1;
- return 0;
+ return btrfs_comp_cpu_keys(&k1, k2);
}
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove code duplication in comp_keys
2009-07-23 22:54 [PATCH] Remove code duplication in comp_keys Diego Calleja
@ 2009-07-24 15:10 ` Chris Mason
0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2009-07-24 15:10 UTC (permalink / raw)
To: Diego Calleja; +Cc: linux-btrfs
On Fri, Jul 24, 2009 at 12:54:53AM +0200, Diego Calleja wrote:
> comp_keys is duplicating what is done in btrfs_comp_cpu_keys, so just
> call it.
Ok, looks like gcc is doing the right thing and inlining properly so
I've queued this one up.
-chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-24 15:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 22:54 [PATCH] Remove code duplication in comp_keys Diego Calleja
2009-07-24 15:10 ` Chris Mason
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox