提交 b0afd8e5 编写于 作者: A Al Viro

isofs: don't bother with ->d_op for normal case

we only need it for joliet and case-insensitive mounts
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 f643ff55
...@@ -29,13 +29,9 @@ ...@@ -29,13 +29,9 @@
#define BEQUIET #define BEQUIET
static int isofs_hashi(const struct dentry *parent, struct qstr *qstr); static int isofs_hashi(const struct dentry *parent, struct qstr *qstr);
static int isofs_hash(const struct dentry *parent, struct qstr *qstr);
static int isofs_dentry_cmpi(const struct dentry *parent, static int isofs_dentry_cmpi(const struct dentry *parent,
const struct dentry *dentry, const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name); unsigned int len, const char *str, const struct qstr *name);
static int isofs_dentry_cmp(const struct dentry *parent,
const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name);
#ifdef CONFIG_JOLIET #ifdef CONFIG_JOLIET
static int isofs_hashi_ms(const struct dentry *parent, struct qstr *qstr); static int isofs_hashi_ms(const struct dentry *parent, struct qstr *qstr);
...@@ -134,10 +130,6 @@ static const struct super_operations isofs_sops = { ...@@ -134,10 +130,6 @@ static const struct super_operations isofs_sops = {
static const struct dentry_operations isofs_dentry_ops[] = { static const struct dentry_operations isofs_dentry_ops[] = {
{
.d_hash = isofs_hash,
.d_compare = isofs_dentry_cmp,
},
{ {
.d_hash = isofs_hashi, .d_hash = isofs_hashi,
.d_compare = isofs_dentry_cmpi, .d_compare = isofs_dentry_cmpi,
...@@ -257,25 +249,12 @@ static int isofs_dentry_cmp_common( ...@@ -257,25 +249,12 @@ static int isofs_dentry_cmp_common(
return 1; return 1;
} }
static int
isofs_hash(const struct dentry *dentry, struct qstr *qstr)
{
return isofs_hash_common(qstr, 0);
}
static int static int
isofs_hashi(const struct dentry *dentry, struct qstr *qstr) isofs_hashi(const struct dentry *dentry, struct qstr *qstr)
{ {
return isofs_hashi_common(qstr, 0); return isofs_hashi_common(qstr, 0);
} }
static int
isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name)
{
return isofs_dentry_cmp_common(len, str, name, 0, 0);
}
static int static int
isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry, isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name) unsigned int len, const char *str, const struct qstr *name)
...@@ -930,7 +909,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) ...@@ -930,7 +909,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
if (opt.check == 'r') if (opt.check == 'r')
table++; table++;
s->s_d_op = &isofs_dentry_ops[table]; if (table)
s->s_d_op = &isofs_dentry_ops[table - 1];
/* get the root dentry */ /* get the root dentry */
s->s_root = d_make_root(inode); s->s_root = d_make_root(inode);
......
...@@ -20,6 +20,8 @@ isofs_cmp(struct dentry *dentry, const char *compare, int dlen) ...@@ -20,6 +20,8 @@ isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
struct qstr qstr; struct qstr qstr;
qstr.name = compare; qstr.name = compare;
qstr.len = dlen; qstr.len = dlen;
if (likely(!dentry->d_op))
return dentry->d_name.len != dlen || memcmp(dentry->d_name.name, compare, dlen);
return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr); return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册