diff options
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/dentry.c | 27 | ||||
-rw-r--r-- | fs/hpfs/namei.c | 2 | ||||
-rw-r--r-- | fs/hpfs/super.c | 9 |
3 files changed, 26 insertions, 12 deletions
diff --git a/fs/hpfs/dentry.c b/fs/hpfs/dentry.c index 67d9d36b3d5f..32c13a94e1e9 100644 --- a/fs/hpfs/dentry.c +++ b/fs/hpfs/dentry.c | |||
@@ -12,7 +12,8 @@ | |||
12 | * Note: the dentry argument is the parent dentry. | 12 | * Note: the dentry argument is the parent dentry. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | static int hpfs_hash_dentry(struct dentry *dentry, struct qstr *qstr) | 15 | static int hpfs_hash_dentry(const struct dentry *dentry, const struct inode *inode, |
16 | struct qstr *qstr) | ||
16 | { | 17 | { |
17 | unsigned long hash; | 18 | unsigned long hash; |
18 | int i; | 19 | int i; |
@@ -34,19 +35,25 @@ static int hpfs_hash_dentry(struct dentry *dentry, struct qstr *qstr) | |||
34 | return 0; | 35 | return 0; |
35 | } | 36 | } |
36 | 37 | ||
37 | static int hpfs_compare_dentry(struct dentry *dentry, struct qstr *a, struct qstr *b) | 38 | static int hpfs_compare_dentry(const struct dentry *parent, |
39 | const struct inode *pinode, | ||
40 | const struct dentry *dentry, const struct inode *inode, | ||
41 | unsigned int len, const char *str, const struct qstr *name) | ||
38 | { | 42 | { |
39 | unsigned al=a->len; | 43 | unsigned al = len; |
40 | unsigned bl=b->len; | 44 | unsigned bl = name->len; |
41 | hpfs_adjust_length(a->name, &al); | 45 | |
46 | hpfs_adjust_length(str, &al); | ||
42 | /*hpfs_adjust_length(b->name, &bl);*/ | 47 | /*hpfs_adjust_length(b->name, &bl);*/ |
43 | /* 'a' is the qstr of an already existing dentry, so the name | 48 | |
44 | * must be valid. 'b' must be validated first. | 49 | /* |
50 | * 'str' is the nane of an already existing dentry, so the name | ||
51 | * must be valid. 'name' must be validated first. | ||
45 | */ | 52 | */ |
46 | 53 | ||
47 | if (hpfs_chk_name(b->name, &bl)) | 54 | if (hpfs_chk_name(name->name, &bl)) |
48 | return 1; | 55 | return 1; |
49 | if (hpfs_compare_names(dentry->d_sb, a->name, al, b->name, bl, 0)) | 56 | if (hpfs_compare_names(parent->d_sb, str, al, name->name, bl, 0)) |
50 | return 1; | 57 | return 1; |
51 | return 0; | 58 | return 0; |
52 | } | 59 | } |
@@ -58,5 +65,5 @@ static const struct dentry_operations hpfs_dentry_operations = { | |||
58 | 65 | ||
59 | void hpfs_set_dentry_operations(struct dentry *dentry) | 66 | void hpfs_set_dentry_operations(struct dentry *dentry) |
60 | { | 67 | { |
61 | dentry->d_op = &hpfs_dentry_operations; | 68 | d_set_d_op(dentry, &hpfs_dentry_operations); |
62 | } | 69 | } |
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 11c2b4080f65..f4ad9e31ddc4 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
@@ -419,7 +419,7 @@ again: | |||
419 | unlock_kernel(); | 419 | unlock_kernel(); |
420 | return -ENOSPC; | 420 | return -ENOSPC; |
421 | } | 421 | } |
422 | if (generic_permission(inode, MAY_WRITE, NULL) || | 422 | if (generic_permission(inode, MAY_WRITE, 0, NULL) || |
423 | !S_ISREG(inode->i_mode) || | 423 | !S_ISREG(inode->i_mode) || |
424 | get_write_access(inode)) { | 424 | get_write_access(inode)) { |
425 | d_rehash(dentry); | 425 | d_rehash(dentry); |
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 6c5f01597c3a..49935ba78db8 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c | |||
@@ -177,11 +177,18 @@ static struct inode *hpfs_alloc_inode(struct super_block *sb) | |||
177 | return &ei->vfs_inode; | 177 | return &ei->vfs_inode; |
178 | } | 178 | } |
179 | 179 | ||
180 | static void hpfs_destroy_inode(struct inode *inode) | 180 | static void hpfs_i_callback(struct rcu_head *head) |
181 | { | 181 | { |
182 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
183 | INIT_LIST_HEAD(&inode->i_dentry); | ||
182 | kmem_cache_free(hpfs_inode_cachep, hpfs_i(inode)); | 184 | kmem_cache_free(hpfs_inode_cachep, hpfs_i(inode)); |
183 | } | 185 | } |
184 | 186 | ||
187 | static void hpfs_destroy_inode(struct inode *inode) | ||
188 | { | ||
189 | call_rcu(&inode->i_rcu, hpfs_i_callback); | ||
190 | } | ||
191 | |||
185 | static void init_once(void *foo) | 192 | static void init_once(void *foo) |
186 | { | 193 | { |
187 | struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo; | 194 | struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo; |