diff options
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r-- | fs/isofs/inode.c | 64 |
1 files changed, 22 insertions, 42 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 881b3bd0143f..d67a16f2a45d 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -29,13 +29,9 @@ | |||
29 | #define BEQUIET | 29 | #define BEQUIET |
30 | 30 | ||
31 | static int isofs_hashi(const struct dentry *parent, struct qstr *qstr); | 31 | static int isofs_hashi(const struct dentry *parent, struct qstr *qstr); |
32 | static int isofs_hash(const struct dentry *parent, struct qstr *qstr); | ||
33 | static int isofs_dentry_cmpi(const struct dentry *parent, | 32 | static int isofs_dentry_cmpi(const struct dentry *parent, |
34 | const struct dentry *dentry, | 33 | const struct dentry *dentry, |
35 | unsigned int len, const char *str, const struct qstr *name); | 34 | unsigned int len, const char *str, const struct qstr *name); |
36 | static int isofs_dentry_cmp(const struct dentry *parent, | ||
37 | const struct dentry *dentry, | ||
38 | unsigned int len, const char *str, const struct qstr *name); | ||
39 | 35 | ||
40 | #ifdef CONFIG_JOLIET | 36 | #ifdef CONFIG_JOLIET |
41 | static int isofs_hashi_ms(const struct dentry *parent, struct qstr *qstr); | 37 | static int isofs_hashi_ms(const struct dentry *parent, struct qstr *qstr); |
@@ -135,10 +131,6 @@ static const struct super_operations isofs_sops = { | |||
135 | 131 | ||
136 | static const struct dentry_operations isofs_dentry_ops[] = { | 132 | static const struct dentry_operations isofs_dentry_ops[] = { |
137 | { | 133 | { |
138 | .d_hash = isofs_hash, | ||
139 | .d_compare = isofs_dentry_cmp, | ||
140 | }, | ||
141 | { | ||
142 | .d_hash = isofs_hashi, | 134 | .d_hash = isofs_hashi, |
143 | .d_compare = isofs_dentry_cmpi, | 135 | .d_compare = isofs_dentry_cmpi, |
144 | }, | 136 | }, |
@@ -182,27 +174,6 @@ struct iso9660_options{ | |||
182 | * Compute the hash for the isofs name corresponding to the dentry. | 174 | * Compute the hash for the isofs name corresponding to the dentry. |
183 | */ | 175 | */ |
184 | static int | 176 | static int |
185 | isofs_hash_common(struct qstr *qstr, int ms) | ||
186 | { | ||
187 | const char *name; | ||
188 | int len; | ||
189 | |||
190 | len = qstr->len; | ||
191 | name = qstr->name; | ||
192 | if (ms) { | ||
193 | while (len && name[len-1] == '.') | ||
194 | len--; | ||
195 | } | ||
196 | |||
197 | qstr->hash = full_name_hash(name, len); | ||
198 | |||
199 | return 0; | ||
200 | } | ||
201 | |||
202 | /* | ||
203 | * Compute the hash for the isofs name corresponding to the dentry. | ||
204 | */ | ||
205 | static int | ||
206 | isofs_hashi_common(struct qstr *qstr, int ms) | 177 | isofs_hashi_common(struct qstr *qstr, int ms) |
207 | { | 178 | { |
208 | const char *name; | 179 | const char *name; |
@@ -258,32 +229,40 @@ static int isofs_dentry_cmp_common( | |||
258 | } | 229 | } |
259 | 230 | ||
260 | static int | 231 | static int |
261 | isofs_hash(const struct dentry *dentry, struct qstr *qstr) | ||
262 | { | ||
263 | return isofs_hash_common(qstr, 0); | ||
264 | } | ||
265 | |||
266 | static int | ||
267 | isofs_hashi(const struct dentry *dentry, struct qstr *qstr) | 232 | isofs_hashi(const struct dentry *dentry, struct qstr *qstr) |
268 | { | 233 | { |
269 | return isofs_hashi_common(qstr, 0); | 234 | return isofs_hashi_common(qstr, 0); |
270 | } | 235 | } |
271 | 236 | ||
272 | static int | 237 | static int |
273 | isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry, | 238 | isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry, |
274 | unsigned int len, const char *str, const struct qstr *name) | 239 | unsigned int len, const char *str, const struct qstr *name) |
275 | { | 240 | { |
276 | return isofs_dentry_cmp_common(len, str, name, 0, 0); | 241 | return isofs_dentry_cmp_common(len, str, name, 0, 1); |
277 | } | 242 | } |
278 | 243 | ||
244 | #ifdef CONFIG_JOLIET | ||
245 | /* | ||
246 | * Compute the hash for the isofs name corresponding to the dentry. | ||
247 | */ | ||
279 | static int | 248 | static int |
280 | isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry, | 249 | isofs_hash_common(struct qstr *qstr, int ms) |
281 | unsigned int len, const char *str, const struct qstr *name) | ||
282 | { | 250 | { |
283 | return isofs_dentry_cmp_common(len, str, name, 0, 1); | 251 | const char *name; |
252 | int len; | ||
253 | |||
254 | len = qstr->len; | ||
255 | name = qstr->name; | ||
256 | if (ms) { | ||
257 | while (len && name[len-1] == '.') | ||
258 | len--; | ||
259 | } | ||
260 | |||
261 | qstr->hash = full_name_hash(name, len); | ||
262 | |||
263 | return 0; | ||
284 | } | 264 | } |
285 | 265 | ||
286 | #ifdef CONFIG_JOLIET | ||
287 | static int | 266 | static int |
288 | isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr) | 267 | isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr) |
289 | { | 268 | { |
@@ -930,7 +909,8 @@ root_found: | |||
930 | if (opt.check == 'r') | 909 | if (opt.check == 'r') |
931 | table++; | 910 | table++; |
932 | 911 | ||
933 | s->s_d_op = &isofs_dentry_ops[table]; | 912 | if (table) |
913 | s->s_d_op = &isofs_dentry_ops[table - 1]; | ||
934 | 914 | ||
935 | /* get the root dentry */ | 915 | /* get the root dentry */ |
936 | s->s_root = d_make_root(inode); | 916 | s->s_root = d_make_root(inode); |