ANDROID: sdcardfs: add parent pointer into dentry name hash
authorAmit Pundir <amit.pundir@linaro.org>
Thu, 4 Aug 2016 15:34:31 +0000 (21:04 +0530)
committerDaniel Rosenberg <drosen@google.com>
Tue, 30 Jan 2018 03:40:02 +0000 (19:40 -0800)
Fix following sdcardfs compilation error introduced in code
refactoring by upstream commit 8387ff2577eb ("vfs: make the
string hashes salt the hash").

  CC [M]  fs/sdcardfs/dentry.o
In file included from ./include/linux/dcache.h:13:0,
                 from fs/sdcardfs/sdcardfs.h:29,
                 from fs/sdcardfs/dentry.c:21:
fs/sdcardfs/dentry.c: In function ‘sdcardfs_hash_ci’:
./include/linux/stringhash.h:38:51: error: expected expression before ‘)’ token
 #define init_name_hash(salt)  (unsigned long)(salt)
                                                   ^
fs/sdcardfs/dentry.c:138:9: note: in expansion of macro ‘init_name_hash’
  hash = init_name_hash();
         ^

Change-Id: I9feb6c075a7e953726954f5746fc009202d3121c
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
fs/sdcardfs/dentry.c
fs/sdcardfs/lookup.c

index 971928ab6c216eeea41db43fd47566001329ab65..e4156a6fa8c8f2b70cff734f585fda2254773d1b 100644 (file)
@@ -135,7 +135,7 @@ static int sdcardfs_hash_ci(const struct dentry *dentry,
        //len = vfat_striptail_len(qstr);
        len = qstr->len;
 
-       hash = init_name_hash();
+       hash = init_name_hash(dentry);
        while (len--)
                //hash = partial_name_hash(nls_tolower(t, *name++), hash);
                hash = partial_name_hash(tolower(*name++), hash);
index d9d46308ef94ba7d2d1594c5ff9d39604439e980..d271617290eeb2fc7fe6972490f2836096533dce 100644 (file)
@@ -309,7 +309,7 @@ static struct dentry *__sdcardfs_lookup(struct dentry *dentry,
        /* instatiate a new negative dentry */
        this.name = name;
        this.len = strlen(name);
-       this.hash = full_name_hash(this.name, this.len);
+       this.hash = full_name_hash(dentry, this.name, this.len);
        lower_dentry = d_lookup(lower_dir_dentry, &this);
        if (lower_dentry)
                goto setup_lower;