Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cifs, msdos, vfat, hfs+: don't bother with parent in ->d_compare()

dentry->d_sb is just as good as parent->d_sb

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro d3fe1985 e0b3f595

+5 -5
+1 -1
fs/cifs/dir.c
··· 906 906 static int cifs_ci_compare(const struct dentry *parent, const struct dentry *dentry, 907 907 unsigned int len, const char *str, const struct qstr *name) 908 908 { 909 - struct nls_table *codepage = CIFS_SB(parent->d_sb)->local_nls; 909 + struct nls_table *codepage = CIFS_SB(dentry->d_sb)->local_nls; 910 910 wchar_t c1, c2; 911 911 int i, l1, l2; 912 912
+1 -1
fs/fat/namei_msdos.c
··· 165 165 static int msdos_cmp(const struct dentry *parent, const struct dentry *dentry, 166 166 unsigned int len, const char *str, const struct qstr *name) 167 167 { 168 - struct fat_mount_options *options = &MSDOS_SB(parent->d_sb)->options; 168 + struct fat_mount_options *options = &MSDOS_SB(dentry->d_sb)->options; 169 169 unsigned char a_msdos_name[MSDOS_NAME], b_msdos_name[MSDOS_NAME]; 170 170 int error; 171 171
+1 -1
fs/fat/namei_vfat.c
··· 141 141 static int vfat_cmpi(const struct dentry *parent, const struct dentry *dentry, 142 142 unsigned int len, const char *str, const struct qstr *name) 143 143 { 144 - struct nls_table *t = MSDOS_SB(parent->d_sb)->nls_io; 144 + struct nls_table *t = MSDOS_SB(dentry->d_sb)->nls_io; 145 145 unsigned int alen, blen; 146 146 147 147 /* A filename cannot end in '.' or we treat it like it has none */
+1 -1
fs/hfsplus/unicode.c
··· 388 388 int hfsplus_compare_dentry(const struct dentry *parent, const struct dentry *dentry, 389 389 unsigned int len, const char *str, const struct qstr *name) 390 390 { 391 - struct super_block *sb = parent->d_sb; 391 + struct super_block *sb = dentry->d_sb; 392 392 int casefold, decompose, size; 393 393 int dsize1, dsize2, len1, len2; 394 394 const u16 *dstr1, *dstr2;
+1 -1
fs/hpfs/dentry.c
··· 50 50 51 51 if (hpfs_chk_name(name->name, &bl)) 52 52 return 1; 53 - if (hpfs_compare_names(parent->d_sb, str, al, name->name, bl, 0)) 53 + if (hpfs_compare_names(dentry->d_sb, str, al, name->name, bl, 0)) 54 54 return 1; 55 55 return 0; 56 56 }