From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hin-Tak Leung Subject: [PATCH 3/4] hfsplus: remove unused routine hfsplus_attr_build_key_uni Date: Tue, 15 Apr 2014 05:20:11 +0100 Message-ID: <1397535612-24058-3-git-send-email-HinTak.Leung@gmail.com> References: <1397535612-24058-1-git-send-email-HinTak.Leung@gmail.com> Cc: Vyacheslav Dubeyko , Al Viro , Christoph Hellwig , Anton Altaparmakov , Hin-Tak Leung To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-wi0-f181.google.com ([209.85.212.181]:35521 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbaDOEVd (ORCPT ); Tue, 15 Apr 2014 00:21:33 -0400 Received: by mail-wi0-f181.google.com with SMTP id hm4so5023653wib.2 for ; Mon, 14 Apr 2014 21:21:32 -0700 (PDT) In-Reply-To: <1397535612-24058-1-git-send-email-HinTak.Leung@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Hin-Tak Leung The directory/file catalog equivalent, hfsplus_build_key_uni(), is used by hfsplus_find_cat() for internal referencing between catalog records. There is no corresponding usage for attributes - attribute records do not refer to one another. Signed-off-by: Hin-Tak Leung --- fs/hfsplus/attributes.c | 25 ------------------------- fs/hfsplus/hfsplus_fs.h | 3 --- 2 files changed, 28 deletions(-) diff --git a/fs/hfsplus/attributes.c b/fs/hfsplus/attributes.c index f3345c0..e5b221d 100644 --- a/fs/hfsplus/attributes.c +++ b/fs/hfsplus/attributes.c @@ -79,31 +79,6 @@ int hfsplus_attr_build_key(struct super_block *sb, hfsplus_btree_key *key, return 0; } -void hfsplus_attr_build_key_uni(hfsplus_btree_key *key, - u32 cnid, - struct hfsplus_attr_unistr *name) -{ - int ustrlen; - - memset(key, 0, sizeof(struct hfsplus_attr_key)); - ustrlen = be16_to_cpu(name->length); - key->attr.cnid = cpu_to_be32(cnid); - key->attr.key_name.length = cpu_to_be16(ustrlen); - ustrlen *= 2; - memcpy(key->attr.key_name.unicode, name->unicode, ustrlen); - - /* The length of the key, as stored in key_len field, does not include - * the size of the key_len field itself. - * So, offsetof(hfsplus_attr_key, key_name) is a trick because - * it takes into consideration key_len field (__be16) of - * hfsplus_attr_key structure instead of length field (__be16) of - * hfsplus_attr_unistr structure. - */ - key->key_len = - cpu_to_be16(offsetof(struct hfsplus_attr_key, key_name) + - ustrlen); -} - hfsplus_attr_entry *hfsplus_alloc_attr_entry(void) { return kmem_cache_alloc(hfsplus_attr_tree_cachep, GFP_KERNEL); diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 83dc292..6c08ff6 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -375,9 +375,6 @@ int hfsplus_attr_bin_cmp_key(const hfsplus_btree_key *, const hfsplus_btree_key *); int hfsplus_attr_build_key(struct super_block *, hfsplus_btree_key *, u32, const char *); -void hfsplus_attr_build_key_uni(hfsplus_btree_key *key, - u32 cnid, - struct hfsplus_attr_unistr *name); int hfsplus_find_attr(struct super_block *, u32, const char *, struct hfs_find_data *); int hfsplus_attr_exists(struct inode *inode, const char *name); -- 1.9.0