]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/f2fs/hash.c
Merge tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux.git] / fs / f2fs / hash.c
index 71b7206c431ea00f937e5b1e59b5f90999091d2a..eb2e031ea887bed43229f63e9923986bc14f3955 100644 (file)
@@ -70,7 +70,8 @@ static void str2hashbuf(const unsigned char *msg, size_t len,
                *buf++ = pad;
 }
 
-f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info)
+f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info,
+                               struct fscrypt_name *fname)
 {
        __u32 hash;
        f2fs_hash_t f2fs_hash;
@@ -79,6 +80,10 @@ f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info)
        const unsigned char *name = name_info->name;
        size_t len = name_info->len;
 
+       /* encrypted bigname case */
+       if (fname && !fname->disk_name.name)
+               return cpu_to_le32(fname->hash);
+
        if (is_dot_dotdot(name_info))
                return 0;