Skip to content

Commit

Permalink
hfsplus: remove unused routine hfsplus_attr_build_key_uni
Browse files Browse the repository at this point in the history
The directory/file catalog b-tree 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 <[email protected]>
Cc: Sougata Santra <[email protected]>
Cc: Anton Altaparmakov <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
HinTak authored and torvalds committed Jun 6, 2014
1 parent bf29e88 commit 7f2fc81
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
25 changes: 0 additions & 25 deletions fs/hfsplus/attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions fs/hfsplus/hfsplus_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7f2fc81

Please sign in to comment.