aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r--fs/isofs/inode.c64
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
31static int isofs_hashi(const struct dentry *parent, struct qstr *qstr); 31static int isofs_hashi(const struct dentry *parent, struct qstr *qstr);
32static int isofs_hash(const struct dentry *parent, struct qstr *qstr);
33static int isofs_dentry_cmpi(const struct dentry *parent, 32static 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);
36static 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
41static int isofs_hashi_ms(const struct dentry *parent, struct qstr *qstr); 37static int isofs_hashi_ms(const struct dentry *parent, struct qstr *qstr);
@@ -135,10 +131,6 @@ static const struct super_operations isofs_sops = {
135 131
136static const struct dentry_operations isofs_dentry_ops[] = { 132static 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 */
184static int 176static int
185isofs_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 */
205static int
206isofs_hashi_common(struct qstr *qstr, int ms) 177isofs_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
260static int 231static int
261isofs_hash(const struct dentry *dentry, struct qstr *qstr)
262{
263 return isofs_hash_common(qstr, 0);
264}
265
266static int
267isofs_hashi(const struct dentry *dentry, struct qstr *qstr) 232isofs_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
272static int 237static int
273isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry, 238isofs_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 */
279static int 248static int
280isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry, 249isofs_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
287static int 266static int
288isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr) 267isofs_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);