diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-28 18:40:11 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-31 06:33:17 -0400 |
| commit | b0afd8e5db7b11aa9078e82e7f9abc30dc35a3c1 (patch) | |
| tree | 699707a904ddabdd6efbae1b5bef18ba2506ceec | |
| parent | f643ff550afbc82a2bc7026f4a6d64427e4fbc99 (diff) | |
isofs: don't bother with ->d_op for normal case
we only need it for joliet and case-insensitive mounts
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| -rw-r--r-- | fs/isofs/inode.c | 24 | ||||
| -rw-r--r-- | fs/isofs/namei.c | 2 |
2 files changed, 4 insertions, 22 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 881b3bd0143f..fe839b915116 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 | }, |
| @@ -258,25 +250,12 @@ static int isofs_dentry_cmp_common( | |||
| 258 | } | 250 | } |
| 259 | 251 | ||
| 260 | static int | 252 | 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) | 253 | isofs_hashi(const struct dentry *dentry, struct qstr *qstr) |
| 268 | { | 254 | { |
| 269 | return isofs_hashi_common(qstr, 0); | 255 | return isofs_hashi_common(qstr, 0); |
| 270 | } | 256 | } |
| 271 | 257 | ||
| 272 | static int | 258 | static int |
| 273 | isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry, | ||
| 274 | unsigned int len, const char *str, const struct qstr *name) | ||
| 275 | { | ||
| 276 | return isofs_dentry_cmp_common(len, str, name, 0, 0); | ||
| 277 | } | ||
| 278 | |||
| 279 | static int | ||
| 280 | isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry, | 259 | isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry, |
| 281 | unsigned int len, const char *str, const struct qstr *name) | 260 | unsigned int len, const char *str, const struct qstr *name) |
| 282 | { | 261 | { |
| @@ -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); |
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c index 6f6dd0c6429f..7b543e6b6526 100644 --- a/fs/isofs/namei.c +++ b/fs/isofs/namei.c | |||
| @@ -20,6 +20,8 @@ isofs_cmp(struct dentry *dentry, const char *compare, int dlen) | |||
| 20 | struct qstr qstr; | 20 | struct qstr qstr; |
| 21 | qstr.name = compare; | 21 | qstr.name = compare; |
| 22 | qstr.len = dlen; | 22 | qstr.len = dlen; |
| 23 | if (likely(!dentry->d_op)) | ||
| 24 | return dentry->d_name.len != dlen || memcmp(dentry->d_name.name, compare, dlen); | ||
| 23 | return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr); | 25 | return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr); |
| 24 | } | 26 | } |
| 25 | 27 | ||
