From: Diego Calleja <diegocg@gmail.com>
To: Chris Mason <chris.mason@oracle.com>
Cc: "linux-btrfs" <linux-btrfs@vger.kernel.org>
Subject: [PATCH] Remove code duplication in comp_keys
Date: Fri, 24 Jul 2009 00:54:53 +0200 [thread overview]
Message-ID: <200907240054.53667.diegocg@gmail.com> (raw)
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);
}
/*
next reply other threads:[~2009-07-23 22:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 22:54 Diego Calleja [this message]
2009-07-24 15:10 ` [PATCH] Remove code duplication in comp_keys Chris Mason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907240054.53667.diegocg@gmail.com \
--to=diegocg@gmail.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox