unicode: pass a UNICODE_AGE() tripple to utf8_load
Don't bother with pointless string parsing when the caller can just pass the version in the format that the core expects. Also remove the fallback to the latest version that none of the callers actually uses. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
This commit is contained in:
committed by
Gabriel Krisman Bertazi
parent
f3a9c82396
commit
49bd03cc7e
@@ -5,6 +5,29 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/dcache.h>
|
||||
|
||||
#define UNICODE_MAJ_SHIFT 16
|
||||
#define UNICODE_MIN_SHIFT 8
|
||||
|
||||
#define UNICODE_AGE(MAJ, MIN, REV) \
|
||||
(((unsigned int)(MAJ) << UNICODE_MAJ_SHIFT) | \
|
||||
((unsigned int)(MIN) << UNICODE_MIN_SHIFT) | \
|
||||
((unsigned int)(REV)))
|
||||
|
||||
static inline u8 unicode_major(unsigned int age)
|
||||
{
|
||||
return (age >> UNICODE_MAJ_SHIFT) & 0xff;
|
||||
}
|
||||
|
||||
static inline u8 unicode_minor(unsigned int age)
|
||||
{
|
||||
return (age >> UNICODE_MIN_SHIFT) & 0xff;
|
||||
}
|
||||
|
||||
static inline u8 unicode_rev(unsigned int age)
|
||||
{
|
||||
return age & 0xff;
|
||||
}
|
||||
|
||||
struct unicode_map {
|
||||
unsigned int version;
|
||||
};
|
||||
@@ -29,7 +52,7 @@ int utf8_casefold(const struct unicode_map *um, const struct qstr *str,
|
||||
int utf8_casefold_hash(const struct unicode_map *um, const void *salt,
|
||||
struct qstr *str);
|
||||
|
||||
struct unicode_map *utf8_load(const char *version);
|
||||
struct unicode_map *utf8_load(unsigned int version);
|
||||
void utf8_unload(struct unicode_map *um);
|
||||
|
||||
#endif /* _LINUX_UNICODE_H */
|
||||
|
||||
Reference in New Issue
Block a user