// SPDX-License-Identifier: GPL-2.0 /* * fs/f2fs/hash.c * * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * Portions of this code from linux/fs/ext3/hash.c * * Copyright (C) 2002 by Theodore Ts'o */ #include <linux/types.h> #include <linux/fs.h> #include <linux/f2fs_fs.h> #include <linux/pagemap.h> #include <linux/unicode.h> #include "f2fs.h" /* * Hashing code copied from ext3 */ #define DELTA … static void TEA_transform(unsigned int buf[4], unsigned int const in[]) { … } static void str2hashbuf(const unsigned char *msg, size_t len, unsigned int *buf, int num) { … } static u32 TEA_hash_name(const u8 *p, size_t len) { … } /* * Compute @fname->hash. For all directories, @fname->disk_name must be set. * For casefolded directories, @fname->usr_fname must be set, and also * @fname->cf_name if the filename is valid Unicode and is not "." or "..". */ void f2fs_hash_filename(const struct inode *dir, struct f2fs_filename *fname) { … }