[PATCH] Remove code duplication in comp_keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



comp_keys is duplicating what is done in btrfs_comp_cpu_keys, so just
call it.

Signed-off-by: Diego Calleja <diegocg@xxxxxxxxx>
---
 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);
 }
 
 /*

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux