0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "hpfs_fn.h"
0011
0012
0013
0014
0015
0016 static int hpfs_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
0017 {
0018 unsigned long hash;
0019 int i;
0020 unsigned l = qstr->len;
0021
0022 if (l == 1) if (qstr->name[0]=='.') goto x;
0023 if (l == 2) if (qstr->name[0]=='.' || qstr->name[1]=='.') goto x;
0024 hpfs_adjust_length(qstr->name, &l);
0025
0026
0027
0028 x:
0029
0030 hash = init_name_hash(dentry);
0031 for (i = 0; i < l; i++)
0032 hash = partial_name_hash(hpfs_upcase(hpfs_sb(dentry->d_sb)->sb_cp_table,qstr->name[i]), hash);
0033 qstr->hash = end_name_hash(hash);
0034
0035 return 0;
0036 }
0037
0038 static int hpfs_compare_dentry(const struct dentry *dentry,
0039 unsigned int len, const char *str, const struct qstr *name)
0040 {
0041 unsigned al = len;
0042 unsigned bl = name->len;
0043
0044 hpfs_adjust_length(str, &al);
0045
0046
0047
0048
0049
0050
0051
0052 if (hpfs_chk_name(name->name, &bl))
0053 return 1;
0054 if (hpfs_compare_names(dentry->d_sb, str, al, name->name, bl, 0))
0055 return 1;
0056 return 0;
0057 }
0058
0059 const struct dentry_operations hpfs_dentry_operations = {
0060 .d_hash = hpfs_hash_dentry,
0061 .d_compare = hpfs_compare_dentry,
0062 };