aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/dir.c2
-rw-r--r--fs/hfsplus/hfsplus_fs.h9
-rw-r--r--fs/hfsplus/super.c12
-rw-r--r--fs/hfsplus/unicode.c19
4 files changed, 28 insertions, 14 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index f611d55c9f5e..f896dc843026 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -37,7 +37,7 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry,
37 37
38 sb = dir->i_sb; 38 sb = dir->i_sb;
39 39
40 dentry->d_op = &hfsplus_dentry_operations; 40 d_set_d_op(dentry, &hfsplus_dentry_operations);
41 dentry->d_fsdata = NULL; 41 dentry->d_fsdata = NULL;
42 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); 42 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
43 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, &dentry->d_name); 43 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, &dentry->d_name);
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index f7cbdf89ac9b..d6857523336d 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -426,9 +426,12 @@ int hfsplus_uni2asc(struct super_block *,
426 const struct hfsplus_unistr *, char *, int *); 426 const struct hfsplus_unistr *, char *, int *);
427int hfsplus_asc2uni(struct super_block *, 427int hfsplus_asc2uni(struct super_block *,
428 struct hfsplus_unistr *, const char *, int); 428 struct hfsplus_unistr *, const char *, int);
429int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str); 429int hfsplus_hash_dentry(const struct dentry *dentry,
430int hfsplus_compare_dentry(struct dentry *dentry, 430 const struct inode *inode, struct qstr *str);
431 struct qstr *s1, struct qstr *s2); 431int hfsplus_compare_dentry(const struct dentry *parent,
432 const struct inode *pinode,
433 const struct dentry *dentry, const struct inode *inode,
434 unsigned int len, const char *str, const struct qstr *name);
432 435
433/* wrapper.c */ 436/* wrapper.c */
434int hfsplus_read_wrapper(struct super_block *); 437int hfsplus_read_wrapper(struct super_block *);
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 3c9f30e9cd36..6ee6ad20acf2 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -450,7 +450,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
450 err = -ENOMEM; 450 err = -ENOMEM;
451 goto cleanup; 451 goto cleanup;
452 } 452 }
453 sb->s_root->d_op = &hfsplus_dentry_operations; 453 d_set_d_op(sb->s_root, &hfsplus_dentry_operations);
454 454
455 str.len = sizeof(HFSP_HIDDENDIR_NAME) - 1; 455 str.len = sizeof(HFSP_HIDDENDIR_NAME) - 1;
456 str.name = HFSP_HIDDENDIR_NAME; 456 str.name = HFSP_HIDDENDIR_NAME;
@@ -516,11 +516,19 @@ static struct inode *hfsplus_alloc_inode(struct super_block *sb)
516 return i ? &i->vfs_inode : NULL; 516 return i ? &i->vfs_inode : NULL;
517} 517}
518 518
519static void hfsplus_destroy_inode(struct inode *inode) 519static void hfsplus_i_callback(struct rcu_head *head)
520{ 520{
521 struct inode *inode = container_of(head, struct inode, i_rcu);
522
523 INIT_LIST_HEAD(&inode->i_dentry);
521 kmem_cache_free(hfsplus_inode_cachep, HFSPLUS_I(inode)); 524 kmem_cache_free(hfsplus_inode_cachep, HFSPLUS_I(inode));
522} 525}
523 526
527static void hfsplus_destroy_inode(struct inode *inode)
528{
529 call_rcu(&inode->i_rcu, hfsplus_i_callback);
530}
531
524#define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info) 532#define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info)
525 533
526static struct dentry *hfsplus_mount(struct file_system_type *fs_type, 534static struct dentry *hfsplus_mount(struct file_system_type *fs_type,
diff --git a/fs/hfsplus/unicode.c b/fs/hfsplus/unicode.c
index 7dd90a540546..a3f0bfcc881e 100644
--- a/fs/hfsplus/unicode.c
+++ b/fs/hfsplus/unicode.c
@@ -324,7 +324,8 @@ int hfsplus_asc2uni(struct super_block *sb, struct hfsplus_unistr *ustr,
324 * Composed unicode characters are decomposed and case-folding is performed 324 * Composed unicode characters are decomposed and case-folding is performed
325 * if the appropriate bits are (un)set on the superblock. 325 * if the appropriate bits are (un)set on the superblock.
326 */ 326 */
327int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str) 327int hfsplus_hash_dentry(const struct dentry *dentry, const struct inode *inode,
328 struct qstr *str)
328{ 329{
329 struct super_block *sb = dentry->d_sb; 330 struct super_block *sb = dentry->d_sb;
330 const char *astr; 331 const char *astr;
@@ -367,10 +368,12 @@ int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str)
367 * Composed unicode characters are decomposed and case-folding is performed 368 * Composed unicode characters are decomposed and case-folding is performed
368 * if the appropriate bits are (un)set on the superblock. 369 * if the appropriate bits are (un)set on the superblock.
369 */ 370 */
370int hfsplus_compare_dentry(struct dentry *dentry, 371int hfsplus_compare_dentry(const struct dentry *parent,
371 struct qstr *s1, struct qstr *s2) 372 const struct inode *pinode,
373 const struct dentry *dentry, const struct inode *inode,
374 unsigned int len, const char *str, const struct qstr *name)
372{ 375{
373 struct super_block *sb = dentry->d_sb; 376 struct super_block *sb = parent->d_sb;
374 int casefold, decompose, size; 377 int casefold, decompose, size;
375 int dsize1, dsize2, len1, len2; 378 int dsize1, dsize2, len1, len2;
376 const u16 *dstr1, *dstr2; 379 const u16 *dstr1, *dstr2;
@@ -380,10 +383,10 @@ int hfsplus_compare_dentry(struct dentry *dentry,
380 383
381 casefold = test_bit(HFSPLUS_SB_CASEFOLD, &HFSPLUS_SB(sb)->flags); 384 casefold = test_bit(HFSPLUS_SB_CASEFOLD, &HFSPLUS_SB(sb)->flags);
382 decompose = !test_bit(HFSPLUS_SB_NODECOMPOSE, &HFSPLUS_SB(sb)->flags); 385 decompose = !test_bit(HFSPLUS_SB_NODECOMPOSE, &HFSPLUS_SB(sb)->flags);
383 astr1 = s1->name; 386 astr1 = str;
384 len1 = s1->len; 387 len1 = len;
385 astr2 = s2->name; 388 astr2 = name->name;
386 len2 = s2->len; 389 len2 = name->len;
387 dsize1 = dsize2 = 0; 390 dsize1 = dsize2 = 0;
388 dstr1 = dstr2 = NULL; 391 dstr1 = dstr2 = NULL;
389 392