upcase.c (e8b8e97f91b80f08a2f1b7ea4f81e7af61b2cc2f) upcase.c (d3624466b56dd5b1886c1dff500525b544c19c83)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 *
4 * Copyright (C) 2019-2021 Paragon Software GmbH, All rights reserved.
5 *
6 */
7
8#include <linux/blkdev.h>

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

29 * ntfs_cmp_names
30 *
31 * Thanks Kari Argillander <kari.argillander@gmail.com> for idea and implementation 'bothcase'
32 *
33 * Straight way to compare names:
34 * - Case insensitive
35 * - If name equals and 'bothcases' then
36 * - Case sensitive
1// SPDX-License-Identifier: GPL-2.0
2/*
3 *
4 * Copyright (C) 2019-2021 Paragon Software GmbH, All rights reserved.
5 *
6 */
7
8#include <linux/blkdev.h>

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

29 * ntfs_cmp_names
30 *
31 * Thanks Kari Argillander <kari.argillander@gmail.com> for idea and implementation 'bothcase'
32 *
33 * Straight way to compare names:
34 * - Case insensitive
35 * - If name equals and 'bothcases' then
36 * - Case sensitive
37 * 'Straigth way' code scans input names twice in worst case.
37 * 'Straight way' code scans input names twice in worst case.
38 * Optimized code scans input names only once.
39 */
40int ntfs_cmp_names(const __le16 *s1, size_t l1, const __le16 *s2, size_t l2,
41 const u16 *upcase, bool bothcase)
42{
43 int diff1 = 0;
44 int diff2;
45 size_t len = min(l1, l2);

--- 63 unchanged lines hidden ---
38 * Optimized code scans input names only once.
39 */
40int ntfs_cmp_names(const __le16 *s1, size_t l1, const __le16 *s2, size_t l2,
41 const u16 *upcase, bool bothcase)
42{
43 int diff1 = 0;
44 int diff2;
45 size_t len = min(l1, l2);

--- 63 unchanged lines hidden ---