From 2179d372d9f8b5fc5c189c89bc6a565a42151b23 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Wed, 18 Jan 2006 17:43:08 -0800 Subject: [PATCH] hfs: add HFSX support Add support for HFSX, which allows for case-sensitive filenames. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/hfsplus/catalog.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'fs/hfsplus/catalog.c') diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index 074451f1d95f..662d176856d8 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c @@ -13,7 +13,8 @@ #include "hfsplus_fs.h" #include "hfsplus_raw.h" -int hfsplus_cat_cmp_key(hfsplus_btree_key *k1, hfsplus_btree_key *k2) +int hfsplus_cat_case_cmp_key(const hfsplus_btree_key *k1, + const hfsplus_btree_key *k2) { __be32 k1p, k2p; @@ -22,7 +23,20 @@ int hfsplus_cat_cmp_key(hfsplus_btree_key *k1, hfsplus_btree_key *k2) if (k1p != k2p) return be32_to_cpu(k1p) < be32_to_cpu(k2p) ? -1 : 1; - return hfsplus_unistrcmp(&k1->cat.name, &k2->cat.name); + return hfsplus_strcasecmp(&k1->cat.name, &k2->cat.name); +} + +int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1, + const hfsplus_btree_key *k2) +{ + __be32 k1p, k2p; + + k1p = k1->cat.parent; + k2p = k2->cat.parent; + if (k1p != k2p) + return be32_to_cpu(k1p) < be32_to_cpu(k2p) ? -1 : 1; + + return hfsplus_strcmp(&k1->cat.name, &k2->cat.name); } void hfsplus_cat_build_key(struct super_block *sb, hfsplus_btree_key *key, -- cgit v1.2.3