cifs, msdos, vfat, hfs+: don't bother with parent in ->d_compare()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 Jul 2016 22:23:59 +0000 (18:23 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 Jul 2016 22:27:51 +0000 (18:27 -0400)
dentry->d_sb is just as good as parent->d_sb

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/dir.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/hfsplus/unicode.c
fs/hpfs/dentry.c

index 4e53253..cf394da 100644 (file)
@@ -906,7 +906,7 @@ static int cifs_ci_hash(const struct dentry *dentry, struct qstr *q)
 static int cifs_ci_compare(const struct dentry *parent, const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
 {
-       struct nls_table *codepage = CIFS_SB(parent->d_sb)->local_nls;
+       struct nls_table *codepage = CIFS_SB(dentry->d_sb)->local_nls;
        wchar_t c1, c2;
        int i, l1, l2;
 
index 1337c0c..0f17712 100644 (file)
@@ -165,7 +165,7 @@ static int msdos_hash(const struct dentry *dentry, struct qstr *qstr)
 static int msdos_cmp(const struct dentry *parent, const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
 {
-       struct fat_mount_options *options = &MSDOS_SB(parent->d_sb)->options;
+       struct fat_mount_options *options = &MSDOS_SB(dentry->d_sb)->options;
        unsigned char a_msdos_name[MSDOS_NAME], b_msdos_name[MSDOS_NAME];
        int error;
 
index 6ccdf3f..e60a908 100644 (file)
@@ -141,7 +141,7 @@ static int vfat_hashi(const struct dentry *dentry, struct qstr *qstr)
 static int vfat_cmpi(const struct dentry *parent, const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
 {
-       struct nls_table *t = MSDOS_SB(parent->d_sb)->nls_io;
+       struct nls_table *t = MSDOS_SB(dentry->d_sb)->nls_io;
        unsigned int alen, blen;
 
        /* A filename cannot end in '.' or we treat it like it has none */
index c13c8a2..509d7e2 100644 (file)
@@ -388,7 +388,7 @@ int hfsplus_hash_dentry(const struct dentry *dentry, struct qstr *str)
 int hfsplus_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
 {
-       struct super_block *sb = parent->d_sb;
+       struct super_block *sb = dentry->d_sb;
        int casefold, decompose, size;
        int dsize1, dsize2, len1, len2;
        const u16 *dstr1, *dstr2;
index 60e6d33..a804300 100644 (file)
@@ -50,7 +50,7 @@ static int hpfs_compare_dentry(const struct dentry *parent, const struct dentry
 
        if (hpfs_chk_name(name->name, &bl))
                return 1;
-       if (hpfs_compare_names(parent->d_sb, str, al, name->name, bl, 0))
+       if (hpfs_compare_names(dentry->d_sb, str, al, name->name, bl, 0))
                return 1;
        return 0;
 }