Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * collate.h - Defines for NTFS kernel collation handling.  Part of the
0004  *         Linux-NTFS project.
0005  *
0006  * Copyright (c) 2004 Anton Altaparmakov
0007  */
0008 
0009 #ifndef _LINUX_NTFS_COLLATE_H
0010 #define _LINUX_NTFS_COLLATE_H
0011 
0012 #include "types.h"
0013 #include "volume.h"
0014 
0015 static inline bool ntfs_is_collation_rule_supported(COLLATION_RULE cr) {
0016     int i;
0017 
0018     /*
0019      * FIXME:  At the moment we only support COLLATION_BINARY and
0020      * COLLATION_NTOFS_ULONG, so we return false for everything else for
0021      * now.
0022      */
0023     if (unlikely(cr != COLLATION_BINARY && cr != COLLATION_NTOFS_ULONG))
0024         return false;
0025     i = le32_to_cpu(cr);
0026     if (likely(((i >= 0) && (i <= 0x02)) ||
0027             ((i >= 0x10) && (i <= 0x13))))
0028         return true;
0029     return false;
0030 }
0031 
0032 extern int ntfs_collate(ntfs_volume *vol, COLLATION_RULE cr,
0033         const void *data1, const int data1_len,
0034         const void *data2, const int data2_len);
0035 
0036 #endif /* _LINUX_NTFS_COLLATE_H */