- Really final white space cleanups.
- Use generic_ffs() instead of ffs() in logfile.c which allows the
log_page_size variable to be optimized by gcc into a constant.
+ - Rename uchar_t to ntfschar everywhere as uchar_t is unsigned 1-byte
+ char as defined by POSIX and as found on some systems.
2.1.10 - Force read-only (re)mounting of volumes with unsupported volume flags.
* Warning: Never use @val when looking for attribute types which can be
* non-resident as this most likely will result in a crash!
*/
-BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
+BOOL find_attr(const ATTR_TYPES type, const ntfschar *name, const u32 name_len,
const IGNORE_CASE_BOOL ic, const u8 *val, const u32 val_len,
attr_search_context *ctx)
{
ATTR_RECORD *a;
ntfs_volume *vol;
- uchar_t *upcase;
+ ntfschar *upcase;
u32 upcase_len;
if (ic == IGNORE_CASE) {
if (a->name_length)
return FALSE;
} else if (!ntfs_are_names_equal(name, name_len,
- (uchar_t*)((u8*)a + le16_to_cpu(a->name_offset)),
+ (ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)),
a->name_length, ic, upcase, upcase_len)) {
register int rc;
rc = ntfs_collate_names(name, name_len,
- (uchar_t*)((u8*)a +
+ (ntfschar*)((u8*)a +
le16_to_cpu(a->name_offset)),
a->name_length, 1, IGNORE_CASE,
upcase, upcase_len);
if (rc)
continue;
rc = ntfs_collate_names(name, name_len,
- (uchar_t*)((u8*)a +
+ (ntfschar*)((u8*)a +
le16_to_cpu(a->name_offset)),
a->name_length, 1, CASE_SENSITIVE,
upcase, upcase_len);
* and if there is not enough space, the attribute should be placed in an
* extent mft record.
*/
-static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
+static BOOL find_external_attr(const ATTR_TYPES type, const ntfschar *name,
const u32 name_len, const IGNORE_CASE_BOOL ic,
const VCN lowest_vcn, const u8 *val, const u32 val_len,
attr_search_context *ctx)
ATTR_LIST_ENTRY *al_entry, *next_al_entry;
u8 *al_start, *al_end;
ATTR_RECORD *a;
- uchar_t *al_name;
+ ntfschar *al_name;
u32 al_name_len;
ni = ctx->ntfs_ino;
* missing, assume we want an unnamed attribute.
*/
al_name_len = al_entry->name_length;
- al_name = (uchar_t*)((u8*)al_entry + al_entry->name_offset);
+ al_name = (ntfschar*)((u8*)al_entry + al_entry->name_offset);
if (!name) {
if (al_name_len)
goto not_found;
sle64_to_cpu(lowest_vcn) &&
next_al_entry->type == al_entry->type &&
next_al_entry->name_length == al_name_len &&
- ntfs_are_names_equal((uchar_t*)((u8*)
+ ntfs_are_names_equal((ntfschar*)((u8*)
next_al_entry +
next_al_entry->name_offset),
next_al_entry->name_length,
if (name) {
if (a->name_length != al_name_len)
continue;
- if (!ntfs_are_names_equal((uchar_t*)((u8*)a +
+ if (!ntfs_are_names_equal((ntfschar*)((u8*)a +
le16_to_cpu(a->name_offset)),
a->name_length, al_name, al_name_len,
CASE_SENSITIVE, vol->upcase,
* being searched for, i.e. if one wants to add the attribute to the mft
* record this is the correct place to insert it into.
*/
-BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
- const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
- const u32 val_len, attr_search_context *ctx)
+BOOL lookup_attr(const ATTR_TYPES type, const ntfschar *name,
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const VCN lowest_vcn, const u8 *val, const u32 val_len,
+ attr_search_context *ctx)
{
ntfs_inode *base_ni;
extern LCN vcn_to_lcn(const run_list_element *rl, const VCN vcn);
-extern BOOL find_attr(const ATTR_TYPES type, const uchar_t *name,
+extern BOOL find_attr(const ATTR_TYPES type, const ntfschar *name,
const u32 name_len, const IGNORE_CASE_BOOL ic, const u8 *val,
const u32 val_len, attr_search_context *ctx);
-BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
- const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
- const u32 val_len, attr_search_context *ctx);
+BOOL lookup_attr(const ATTR_TYPES type, const ntfschar *name,
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const VCN lowest_vcn, const u8 *val, const u32 val_len,
+ attr_search_context *ctx);
extern int load_attribute_list(ntfs_volume *vol, run_list *rl, u8 *al_start,
const s64 size, const s64 initialized_size);
/**
* The little endian Unicode string $I30 as a global constant.
*/
-uchar_t I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
+ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
const_cpu_to_le16('3'), const_cpu_to_le16('0'),
const_cpu_to_le16(0) };
* work but we don't care for how quickly one can access them. This also fixes
* the dcache aliasing issues.
*/
-MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
+MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
const int uname_len, ntfs_name **res)
{
ntfs_volume *vol = dir_ni->vol;
* returning.
*/
if (ntfs_are_names_equal(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length,
CASE_SENSITIVE, vol->upcase, vol->upcase_len)) {
found_it:
if (!NVolCaseSensitive(vol) &&
ie->key.file_name.file_name_type &&
ntfs_are_names_equal(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length,
IGNORE_CASE, vol->upcase, vol->upcase_len)) {
int name_size = sizeof(ntfs_name);
}
if (type != FILE_NAME_DOS)
- name_size += len * sizeof(uchar_t);
+ name_size += len * sizeof(ntfschar);
name = kmalloc(name_size, GFP_NOFS);
if (!name) {
err = -ENOMEM;
if (type != FILE_NAME_DOS) {
name->len = len;
memcpy(name->name, ie->key.file_name.file_name,
- len * sizeof(uchar_t));
+ len * sizeof(ntfschar));
} else
name->len = 0;
*res = name;
* know which way in the B+tree we have to go.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
IGNORE_CASE, vol->upcase, vol->upcase_len);
/*
* collation.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
CASE_SENSITIVE, vol->upcase, vol->upcase_len);
if (rc == -1)
* returning.
*/
if (ntfs_are_names_equal(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length,
CASE_SENSITIVE, vol->upcase, vol->upcase_len)) {
found_it2:
if (!NVolCaseSensitive(vol) &&
ie->key.file_name.file_name_type &&
ntfs_are_names_equal(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length,
IGNORE_CASE, vol->upcase, vol->upcase_len)) {
int name_size = sizeof(ntfs_name);
}
if (type != FILE_NAME_DOS)
- name_size += len * sizeof(uchar_t);
+ name_size += len * sizeof(ntfschar);
name = kmalloc(name_size, GFP_NOFS);
if (!name) {
err = -ENOMEM;
if (type != FILE_NAME_DOS) {
name->len = len;
memcpy(name->name, ie->key.file_name.file_name,
- len * sizeof(uchar_t));
+ len * sizeof(ntfschar));
} else
name->len = 0;
*res = name;
* know which way in the B+tree we have to go.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
IGNORE_CASE, vol->upcase, vol->upcase_len);
/*
* collation.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
CASE_SENSITIVE, vol->upcase, vol->upcase_len);
if (rc == -1)
*
* Note, @uname_len does not include the (optional) terminating NULL character.
*/
-u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
+u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
const int uname_len)
{
ntfs_volume *vol = dir_ni->vol;
* convert it to cpu format before returning.
*/
if (ntfs_are_names_equal(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, ic,
vol->upcase, vol->upcase_len)) {
found_it:
* know which way in the B+tree we have to go.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
IGNORE_CASE, vol->upcase, vol->upcase_len);
/*
* collation.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
CASE_SENSITIVE, vol->upcase, vol->upcase_len);
if (rc == -1)
* convert it to cpu format before returning.
*/
if (ntfs_are_names_equal(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, ic,
vol->upcase, vol->upcase_len)) {
found_it2:
* know which way in the B+tree we have to go.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
IGNORE_CASE, vol->upcase, vol->upcase_len);
/*
* collation.
*/
rc = ntfs_collate_names(uname, uname_len,
- (uchar_t*)&ie->key.file_name.file_name,
+ (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, 1,
CASE_SENSITIVE, vol->upcase, vol->upcase_len);
if (rc == -1)
ntfs_debug("Skipping system file.");
return 0;
}
- name_len = ntfs_ucstonls(vol, (uchar_t*)&ie->key.file_name.file_name,
+ name_len = ntfs_ucstonls(vol, (ntfschar*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, &name,
NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1);
if (name_len <= 0) {
MFT_REF mref;
FILE_NAME_TYPE_FLAGS type;
u8 len;
- uchar_t name[0];
+ ntfschar name[0];
} __attribute__ ((__packed__)) ntfs_name;
/* The little endian Unicode string $I30 as a global constant. */
-extern uchar_t I30[5];
+extern ntfschar I30[5];
extern MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni,
- const uchar_t *uname, const int uname_len, ntfs_name **res);
+ const ntfschar *uname, const int uname_len, ntfs_name **res);
#endif /* _LINUX_NTFS_FS_DIR_H */
if (ni->name_len != na->name_len)
return 0;
if (na->name_len && memcmp(ni->name, na->name,
- na->name_len * sizeof(uchar_t)))
+ na->name_len * sizeof(ntfschar)))
return 0;
}
/* Match! */
if (na->name && na->name_len && na->name != I30) {
unsigned int i;
- i = na->name_len * sizeof(uchar_t);
- ni->name = (uchar_t*)kmalloc(i + sizeof(uchar_t), GFP_ATOMIC);
+ i = na->name_len * sizeof(ntfschar);
+ ni->name = (ntfschar*)kmalloc(i + sizeof(ntfschar), GFP_ATOMIC);
if (!ni->name)
return -ENOMEM;
memcpy(ni->name, na->name, i);
* obtained from PTR_ERR().
*/
struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
- uchar_t *name, u32 name_len)
+ ntfschar *name, u32 name_len)
{
struct inode *vi;
ntfs_attr na;
* name_len = 4 for directories.
*/
ATTR_TYPES type; /* Attribute type of this fake inode. */
- uchar_t *name; /* Attribute name of this fake inode. */
+ ntfschar *name; /* Attribute name of this fake inode. */
u32 name_len; /* Attribute name length of this fake inode. */
run_list run_list; /* If state has the NI_NonResident bit set,
the run list of the unnamed data attribute
*/
typedef struct {
unsigned long mft_no;
- uchar_t *name;
+ ntfschar *name;
u32 name_len;
ATTR_TYPES type;
} ntfs_attr;
extern struct inode *ntfs_iget(struct super_block *sb, unsigned long mft_no);
extern struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
- uchar_t *name, u32 name_len);
+ ntfschar *name, u32 name_len);
extern struct inode *ntfs_alloc_big_inode(struct super_block *sb);
extern void ntfs_destroy_big_inode(struct inode *inode);
*/
typedef struct {
/*hex ofs*/
-/* 0*/ uchar_t name[0x40]; /* Unicode name of the attribute. Zero
+/* 0*/ ntfschar name[0x40]; /* Unicode name of the attribute. Zero
terminated. */
/* 80*/ ATTR_TYPES type; /* Type of the attribute. */
/* 84*/ u32 display_rule; /* Default display rule.
attribute value. */
/* 24*/ u16 instance; /* If lowest_vcn = 0, the instance of the
attribute being referenced; otherwise 0. */
-/* 26*/ uchar_t name[0]; /* Use when creating only. When reading use
+/* 26*/ ntfschar name[0]; /* Use when creating only. When reading use
name_offset to determine the location of the
name. */
/* sizeof() = 26 + (attribute_name_length * 2) bytes */
/* 40*/ u8 file_name_length; /* Length of file name in
(Unicode) characters. */
/* 41*/ FILE_NAME_TYPE_FLAGS file_name_type; /* Namespace of the file name.*/
-/* 42*/ uchar_t file_name[0]; /* File name in Unicode. */
+/* 42*/ ntfschar file_name[0]; /* File name in Unicode. */
} __attribute__ ((__packed__)) FILE_NAME_ATTR;
/*
* NOTE: Present only in FILE_Volume.
*/
typedef struct {
- uchar_t name[0]; /* The name of the volume in Unicode. */
+ ntfschar name[0]; /* The name of the volume in Unicode. */
} __attribute__ ((__packed__)) VOLUME_NAME;
/*
/* 22*/ u8 reserved[6]; /* Reserved/alignment. */
/* 28*/ u32 client_name_length; /* Length of client name in bytes. Should
always be 8. */
-/* 32*/ uchar_t client_name[64];/* Name of the client in Unicode. Should
+/* 32*/ ntfschar client_name[64];/* Name of the client in Unicode. Should
always be "NTFS" with the remaining bytes
set to 0. */
/* sizeof() = 160 (0xa0) bytes */
{
ntfs_volume *vol = NTFS_SB(dir_ino->i_sb);
struct inode *dent_inode;
- uchar_t *uname;
+ ntfschar *uname;
ntfs_name *name = NULL;
MFT_REF mref;
unsigned long dent_ino;
nls_name.name = NULL;
if (name->type != FILE_NAME_DOS) { /* Case 2. */
nls_name.len = (unsigned)ntfs_ucstonls(vol,
- (uchar_t*)&name->name, name->len,
+ (ntfschar*)&name->name, name->len,
(unsigned char**)&nls_name.name, 0);
kfree(name);
} else /* if (name->type == FILE_NAME_DOS) */ { /* Case 3. */
goto eio_err_out;
fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + le16_to_cpu(
ctx->attr->data.resident.value_offset));
- if ((u32)(fn->file_name_length * sizeof(uchar_t) +
+ if ((u32)(fn->file_name_length * sizeof(ntfschar) +
sizeof(FILE_NAME_ATTR)) > val_len)
goto eio_err_out;
} while (fn->file_name_type != FILE_NAME_WIN32);
/* Convert the found WIN32 name to current NLS code page. */
nls_name.len = (unsigned)ntfs_ucstonls(vol,
- (uchar_t*)&fn->file_name, fn->file_name_length,
+ (ntfschar*)&fn->file_name, fn->file_name_length,
(unsigned char**)&nls_name.name, 0);
put_attr_search_ctx(ctx);
extern void post_write_mst_fixup(NTFS_RECORD *b);
/* From fs/ntfs/unistr.c */
-extern BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
- const uchar_t *s2, size_t s2_len,
+extern BOOL ntfs_are_names_equal(const ntfschar *s1, size_t s1_len,
+ const ntfschar *s2, size_t s2_len,
const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_size);
-extern int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
- const uchar_t *name2, const u32 name2_len,
+ const ntfschar *upcase, const u32 upcase_size);
+extern int ntfs_collate_names(const ntfschar *name1, const u32 name1_len,
+ const ntfschar *name2, const u32 name2_len,
const int err_val, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_len);
-extern int ntfs_ucsncmp(const uchar_t *s1, const uchar_t *s2, size_t n);
-extern int ntfs_ucsncasecmp(const uchar_t *s1, const uchar_t *s2, size_t n,
- const uchar_t *upcase, const u32 upcase_size);
-extern void ntfs_upcase_name(uchar_t *name, u32 name_len,
- const uchar_t *upcase, const u32 upcase_len);
+ const ntfschar *upcase, const u32 upcase_len);
+extern int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n);
+extern int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n,
+ const ntfschar *upcase, const u32 upcase_size);
+extern void ntfs_upcase_name(ntfschar *name, u32 name_len,
+ const ntfschar *upcase, const u32 upcase_len);
extern void ntfs_file_upcase_value(FILE_NAME_ATTR *file_name_attr,
- const uchar_t *upcase, const u32 upcase_len);
+ const ntfschar *upcase, const u32 upcase_len);
extern int ntfs_file_compare_values(FILE_NAME_ATTR *file_name_attr1,
FILE_NAME_ATTR *file_name_attr2,
const int err_val, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_len);
+ const ntfschar *upcase, const u32 upcase_len);
extern int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
- const int ins_len, uchar_t **outs);
-extern int ntfs_ucstonls(const ntfs_volume *vol, const uchar_t *ins,
+ const int ins_len, ntfschar **outs);
+extern int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins,
const int ins_len, unsigned char **outs, int outs_len);
/* From fs/ntfs/upcase.c */
-extern uchar_t *generate_default_upcase(void);
+extern ntfschar *generate_default_upcase(void);
#endif /* _LINUX_NTFS_H */
}
/*
* The upcase size must not be above 64k Unicode characters, must not
- * be zero and must be a multiple of sizeof(uchar_t).
+ * be zero and must be a multiple of sizeof(ntfschar).
*/
- if (!ino->i_size || ino->i_size & (sizeof(uchar_t) - 1) ||
- ino->i_size > 64ULL * 1024 * sizeof(uchar_t))
+ if (!ino->i_size || ino->i_size & (sizeof(ntfschar) - 1) ||
+ ino->i_size > 64ULL * 1024 * sizeof(ntfschar))
goto iput_upcase_failed;
- vol->upcase = (uchar_t*)ntfs_malloc_nofs(ino->i_size);
+ vol->upcase = (ntfschar*)ntfs_malloc_nofs(ino->i_size);
if (!vol->upcase)
goto iput_upcase_failed;
index = 0;
}
vol->upcase_len = ino->i_size >> UCHAR_T_SIZE_BITS;
ntfs_debug("Read %llu bytes from $UpCase (expected %u bytes).",
- ino->i_size, 64 * 1024 * sizeof(uchar_t));
+ ino->i_size, 64 * 1024 * sizeof(ntfschar));
iput(ino);
down(&ntfs_lock);
if (!default_upcase) {
}
ntfs_name_cache = kmem_cache_create(ntfs_name_cache_name,
- (NTFS_MAX_NAME_LEN+1) * sizeof(uchar_t), 0,
+ (NTFS_MAX_NAME_LEN+1) * sizeof(ntfschar), 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if (!ntfs_name_cache) {
printk(KERN_CRIT "NTFS: Failed to create %s!\n",
#define _LINUX_NTFS_TYPES_H
/* 2-byte Unicode character type. */
-typedef u16 uchar_t;
+typedef u16 ntfschar;
#define UCHAR_T_SIZE_BITS 1
/*
* identical, or FALSE (0) if they are not identical. If @ic is IGNORE_CASE,
* the @upcase table is used to performa a case insensitive comparison.
*/
-BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
- const uchar_t *s2, size_t s2_len, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_size)
+BOOL ntfs_are_names_equal(const ntfschar *s1, size_t s1_len,
+ const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic,
+ const ntfschar *upcase, const u32 upcase_size)
{
if (s1_len != s2_len)
return FALSE;
*
* The following characters are considered invalid: '"', '*', '<', '>' and '?'.
*/
-int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
- const uchar_t *name2, const u32 name2_len,
+int ntfs_collate_names(const ntfschar *name1, const u32 name1_len,
+ const ntfschar *name2, const u32 name2_len,
const int err_val, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_len)
+ const ntfschar *upcase, const u32 upcase_len)
{
u32 cnt, min_len;
- uchar_t c1, c2;
+ ntfschar c1, c2;
min_len = name1_len;
if (name1_len > name2_len)
* if @s1 (or the first @n Unicode characters thereof) is found, respectively,
* to be less than, to match, or be greater than @s2.
*/
-int ntfs_ucsncmp(const uchar_t *s1, const uchar_t *s2, size_t n)
+int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n)
{
- uchar_t c1, c2;
+ ntfschar c1, c2;
size_t i;
for (i = 0; i < n; ++i) {
* if @s1 (or the first @n Unicode characters thereof) is found, respectively,
* to be less than, to match, or be greater than @s2.
*/
-int ntfs_ucsncasecmp(const uchar_t *s1, const uchar_t *s2, size_t n,
- const uchar_t *upcase, const u32 upcase_size)
+int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n,
+ const ntfschar *upcase, const u32 upcase_size)
{
- uchar_t c1, c2;
+ ntfschar c1, c2;
size_t i;
for (i = 0; i < n; ++i) {
return 0;
}
-void ntfs_upcase_name(uchar_t *name, u32 name_len, const uchar_t *upcase,
+void ntfs_upcase_name(ntfschar *name, u32 name_len, const ntfschar *upcase,
const u32 upcase_len)
{
u32 i;
- uchar_t u;
+ ntfschar u;
for (i = 0; i < name_len; i++)
if ((u = le16_to_cpu(name[i])) < upcase_len)
}
void ntfs_file_upcase_value(FILE_NAME_ATTR *file_name_attr,
- const uchar_t *upcase, const u32 upcase_len)
+ const ntfschar *upcase, const u32 upcase_len)
{
- ntfs_upcase_name((uchar_t*)&file_name_attr->file_name,
+ ntfs_upcase_name((ntfschar*)&file_name_attr->file_name,
file_name_attr->file_name_length, upcase, upcase_len);
}
int ntfs_file_compare_values(FILE_NAME_ATTR *file_name_attr1,
FILE_NAME_ATTR *file_name_attr2,
const int err_val, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_len)
+ const ntfschar *upcase, const u32 upcase_len)
{
- return ntfs_collate_names((uchar_t*)&file_name_attr1->file_name,
+ return ntfs_collate_names((ntfschar*)&file_name_attr1->file_name,
file_name_attr1->file_name_length,
- (uchar_t*)&file_name_attr2->file_name,
+ (ntfschar*)&file_name_attr2->file_name,
file_name_attr2->file_name_length,
err_val, ic, upcase, upcase_len);
}
* This might look a bit odd due to fast path optimization...
*/
int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
- const int ins_len, uchar_t **outs)
+ const int ins_len, ntfschar **outs)
{
struct nls_table *nls = vol->nls_map;
- uchar_t *ucs;
+ ntfschar *ucs;
wchar_t wc;
int i, o, wc_len;
/* We don't trust outside sources. */
if (ins) {
- ucs = (uchar_t*)kmem_cache_alloc(ntfs_name_cache, SLAB_NOFS);
+ ucs = (ntfschar*)kmem_cache_alloc(ntfs_name_cache, SLAB_NOFS);
if (ucs) {
for (i = o = 0; i < ins_len; i += wc_len) {
wc_len = nls->char2uni(ins + i, ins_len - i,
*
* This might look a bit odd due to fast path optimization...
*/
-int ntfs_ucstonls(const ntfs_volume *vol, const uchar_t *ins,
+int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins,
const int ins_len, unsigned char **outs, int outs_len)
{
struct nls_table *nls = vol->nls_map;
#include "ntfs.h"
-uchar_t *generate_default_upcase(void)
+ntfschar *generate_default_upcase(void)
{
static const int uc_run_table[][3] = { /* Start, End, Add */
{0x0061, 0x007B, -32}, {0x0451, 0x045D, -80}, {0x1F70, 0x1F72, 74},
};
int i, r;
- uchar_t *uc;
+ ntfschar *uc;
- uc = ntfs_malloc_nofs(default_upcase_len * sizeof(uchar_t));
+ uc = ntfs_malloc_nofs(default_upcase_len * sizeof(ntfschar));
if (!uc)
return uc;
- memset(uc, 0, default_upcase_len * sizeof(uchar_t));
+ memset(uc, 0, default_upcase_len * sizeof(ntfschar));
for (i = 0; i < default_upcase_len; i++)
uc[i] = cpu_to_le16(i);
for (r = 0; uc_run_table[r][0]; r++)
u64 serial_no; /* The volume serial number. */
/* Mount specific NTFS information. */
u32 upcase_len; /* Number of entries in upcase[]. */
- uchar_t *upcase; /* The upcase table. */
+ ntfschar *upcase; /* The upcase table. */
LCN mft_zone_start; /* First cluster of the mft zone. */
LCN mft_zone_end; /* First cluster beyond the mft zone. */
struct inode *mft_ino; /* The VFS inode of $MFT. */