hash.c (cdd38c5f1ce4398ec58fec95904b75824daab7b5) hash.c (5298d4bfe80f6ae6ae2777bcd1357b0022d98573)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/hash.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 *
8 * Portions of this code from linux/fs/ext3/hash.c

--- 91 unchanged lines hidden (view full) ---

100
101 WARN_ON_ONCE(!name);
102
103 if (is_dot_dotdot(name, len)) {
104 fname->hash = 0;
105 return;
106 }
107
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/hash.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 *
8 * Portions of this code from linux/fs/ext3/hash.c

--- 91 unchanged lines hidden (view full) ---

100
101 WARN_ON_ONCE(!name);
102
103 if (is_dot_dotdot(name, len)) {
104 fname->hash = 0;
105 return;
106 }
107
108#ifdef CONFIG_UNICODE
108#if IS_ENABLED(CONFIG_UNICODE)
109 if (IS_CASEFOLDED(dir)) {
110 /*
111 * If the casefolded name is provided, hash it instead of the
112 * on-disk name. If the casefolded name is *not* provided, that
113 * should only be because the name wasn't valid Unicode, so fall
114 * back to treating the name as an opaque byte sequence. Note
115 * that to handle encrypted directories, the fallback must use
116 * usr_fname (plaintext) rather than disk_name (ciphertext).

--- 20 unchanged lines hidden ---
109 if (IS_CASEFOLDED(dir)) {
110 /*
111 * If the casefolded name is provided, hash it instead of the
112 * on-disk name. If the casefolded name is *not* provided, that
113 * should only be because the name wasn't valid Unicode, so fall
114 * back to treating the name as an opaque byte sequence. Note
115 * that to handle encrypted directories, the fallback must use
116 * usr_fname (plaintext) rather than disk_name (ciphertext).

--- 20 unchanged lines hidden ---