Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv5724/libntfs
Modified Files:
attrib.c attrib_RE.c bootsect.c dir.c disk_io.c inode.c mft.c
mst.c unistr.c volume.c
Log Message:
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/attrib.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -U2 -r1.47 -r1.48
--- attrib.c 1 Jul 2002 23:43:53 -0000 1.47
+++ attrib.c 2 Jul 2002 23:47:10 -0000 1.48
@@ -42,5 +42,5 @@
* set_ntfs_volume_flags
*/
-int set_ntfs_volume_flags(ntfs_volume *v, MFT_RECORD *b, const __u16 flags)
+int set_ntfs_volume_flags(ntfs_volume *v, MFT_RECORD *b, const u16 flags)
{
ATTR_RECORD *r;
@@ -94,5 +94,5 @@
* get_attribute_value_length
*/
-__s64 get_attribute_value_length(const ATTR_RECORD *a)
+s64 get_attribute_value_length(const ATTR_RECORD *a)
{
if (!a) {
@@ -104,5 +104,5 @@
return sle64_to_cpu(a->data_size);
else
- return (__s64)le32_to_cpu(a->value_length);
+ return (s64)le32_to_cpu(a->value_length);
errno = EINVAL;
return 0;
@@ -112,6 +112,6 @@
* get_attribute_value
*/
-__s64 get_attribute_value(const ntfs_volume *vol, const MFT_RECORD *m,
- const ATTR_RECORD *a, __u8 *b)
+s64 get_attribute_value(const ntfs_volume *vol, const MFT_RECORD *m,
+ const ATTR_RECORD *a, u8 *b)
{
/* Sanity checks. */
@@ -136,8 +136,8 @@
le32_to_cpu(a->value_length));
errno = 0;
- return (__s64)le32_to_cpu(a->value_length);
+ return (s64)le32_to_cpu(a->value_length);
} else { /* Attribute is not resident. */
run_list *rl;
- __s64 total, r;
+ s64 total, r;
int i;
@@ -278,5 +278,5 @@
*/
int set_attribute_value(ntfs_volume *vol, ATTR_RECORD *a,
- const __u8 *b, __s64 l)
+ const u8 *b, s64 l)
{
/* Sanity check. */
@@ -310,5 +310,5 @@
} else { /* Attribute is not resident. */
run_list *rl;
- __s64 total, w;
+ s64 total, w;
int i;
@@ -390,5 +390,5 @@
*/
static __inline__ void __ntfs_attr_init(ntfs_attr *na, ntfs_inode *ni,
- const ATTR_TYPES type, uchar_t *name, const __u32 name_len)
+ const ATTR_TYPES type, uchar_t *name, const u32 name_len)
{
na->rl = NULL;
@@ -416,7 +416,7 @@
void ntfs_attr_init(ntfs_attr *na, const BOOL non_resident,
const BOOL compressed, const BOOL encrypted, const BOOL sparse,
- const __s64 allocated_size, const __s64 data_size,
- const __s64 initialized_size, const __s64 compressed_size,
- const __u8 compression_unit)
+ const s64 allocated_size, const s64 data_size,
+ const s64 initialized_size, const s64 compressed_size,
+ const u8 compression_unit)
{
if (!NAttrInitialized(na)) {
@@ -461,5 +461,5 @@
*/
ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
- uchar_t *name, const __u32 name_len)
+ uchar_t *name, const u32 name_len)
{
ntfs_attr_search_ctx *ctx;
@@ -501,5 +501,5 @@
cs ? a->compression_unit : 0);
} else {
- __s64 l = le32_to_cpu(a->value_length);
+ s64 l = le32_to_cpu(a->value_length);
if (a->flags & (ATTR_COMPRESSION_MASK | ATTR_IS_ENCRYPTED |
ATTR_IS_SPARSE)) {
@@ -771,5 +771,5 @@
disc = (src[0].vcn > 0);
else {
- __s64 merged_length;
+ s64 merged_length;
left = ntfs_are_rl_mergeable(dst + loc - 1, src);
@@ -1173,5 +1173,5 @@
drl[ds].vcn = marker_vcn;
drl[ds].lcn = (LCN)LCN_ENOENT;
- drl[ds].length = (__s64)0;
+ drl[ds].length = (s64)0;
}
}
@@ -1224,12 +1224,12 @@
VCN vcn; /* Current vcn. */
LCN lcn; /* Current lcn. */
- __s64 deltaxcn; /* Change in [vl]cn. */
+ s64 deltaxcn; /* Change in [vl]cn. */
run_list_element *rl; /* The output run list. */
- __u8 *buf; /* Current position in mapping pairs array. */
- __u8 *attr_end; /* End of attribute. */
+ u8 *buf; /* Current position in mapping pairs array. */
+ u8 *attr_end; /* End of attribute. */
int rlsize; /* Size of run list buffer. */
- __u16 rlpos; /* Current run list position in units of
+ u16 rlpos; /* Current run list position in units of
run_list_elements. */
- __u8 b; /* Current byte offset in buf. */
+ u8 b; /* Current byte offset in buf. */
Dprintf(__FUNCTION__ "(): Entering for attr 0x%x.\n",
@@ -1245,7 +1245,7 @@
lcn = 0;
/* Get start of the mapping pairs array. */
- buf = (__u8*)attr + le16_to_cpu(attr->mapping_pairs_offset);
- attr_end = (__u8*)attr + le32_to_cpu(attr->length);
- if (buf < (__u8*)attr || buf > attr_end) {
+ buf = (u8*)attr + le16_to_cpu(attr->mapping_pairs_offset);
+ attr_end = (u8*)attr + le32_to_cpu(attr->length);
+ if (buf < (u8*)attr || buf > attr_end) {
Dputs("Corrupt attribute.");
errno = EIO;
@@ -1296,9 +1296,9 @@
if (buf + b > attr_end)
goto io_error;
- for (deltaxcn = (__s8)buf[b--]; b; b--)
+ for (deltaxcn = (s8)buf[b--]; b; b--)
deltaxcn = (deltaxcn << 8) + buf[b];
} else { /* The length entry is compulsory. */
Dputs("Missing length entry in mapping pairs array.");
- deltaxcn = (__s64)-1;
+ deltaxcn = (s64)-1;
}
/*
@@ -1326,9 +1326,9 @@
else {
/* Get the lcn change which really can be negative. */
- __u8 b2 = *buf & 0xf;
+ u8 b2 = *buf & 0xf;
b = b2 + ((*buf >> 4) & 0xf);
if (buf + b > attr_end)
goto io_error;
- for (deltaxcn = (__s8)buf[b--]; b > b2; b--)
+ for (deltaxcn = (s8)buf[b--]; b > b2; b--)
deltaxcn = (deltaxcn << 8) + buf[b];
/* Change the current lcn to it's new value. */
@@ -1409,5 +1409,5 @@
/* Setup terminating run_list element. */
rl[rlpos].vcn = vcn;
- rl[rlpos].length = (__s64)0;
+ rl[rlpos].length = (s64)0;
/* If no existing run list was specified, we are done. */
if (!old_rl) {
@@ -1669,7 +1669,7 @@
* arguments.
*/
-__s64 ntfs_attr_pread(ntfs_attr *na, const __s64 pos, __s64 count, void *b)
+s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
{
- __s64 br, to_read, ofs, total, total2;
+ s64 br, to_read, ofs, total, total2;
ntfs_volume *vol;
run_list_element *rl;
@@ -1702,5 +1702,5 @@
// TODO: Implement reading compressed attributes! (AIA)
// return ntfs_attr_pread_compressed(ntfs_attr *na,
- // const __s64 pos, __s64 count, void *b);
+ // const s64 pos, s64 count, void *b);
errno = ENOTSUP;
return -1;
@@ -1804,5 +1804,5 @@
}
/* If the syscall was interrupted, try again. */
- if (br == (__s64)-1 && errno == EINTR)
+ if (br == (s64)-1 && errno == EINTR)
goto retry;
if (total)
@@ -1843,7 +1843,7 @@
* Thus if such a change is requested we return -1 with errno set to ENOTSUP.
*/
-__s64 ntfs_attr_pwrite(ntfs_attr *na, const __s64 pos, __s64 count, void *b)
+s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, void *b)
{
- __s64 written, to_write, ofs, total, old_initialized_size;
+ s64 written, to_write, ofs, total, old_initialized_size;
ntfs_volume *vol;
ntfs_attr_search_ctx *ctx = NULL;
@@ -1879,5 +1879,5 @@
// TODO: Implement writing compressed attributes! (AIA)
// return ntfs_attr_pwrite_compressed(ntfs_attr *na,
- // const __s64 pos, __s64 count, void *b);
+ // const s64 pos, s64 count, void *b);
errno = ENOTSUP;
return -1;
@@ -1998,5 +1998,5 @@
}
if (rl->lcn < (LCN)0) {
- __s64 t;
+ s64 t;
int cnt;
@@ -2022,5 +2022,5 @@
if (cnt && !eo) {
int i;
- __u8 *b2;
+ u8 *b2;
b2 = b + (to_write &
@@ -2058,5 +2058,5 @@
}
/* If the syscall was interrupted, try again. */
- if (written == (__s64)-1 && errno == EINTR)
+ if (written == (s64)-1 && errno == EINTR)
goto retry;
if (!written)
@@ -2151,8 +2151,8 @@
* errors can be repaired.
*/
-__s64 ntfs_attr_mst_pread(ntfs_attr *na, const __s64 pos, const __s64 bk_cnt,
- const __u32 bk_size, void *b)
+s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos, const s64 bk_cnt,
+ const u32 bk_size, void *b)
{
- __s64 br;
+ s64 br;
void *end;
@@ -2204,8 +2204,8 @@
* achieved.
*/
-__s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const __s64 pos, __s64 bk_cnt,
- const __u32 bk_size, void *b)
+s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, s64 bk_cnt,
+ const u32 bk_size, void *b)
{
- __s64 written, i;
+ s64 written, i;
Dprintf(__FUNCTION__ "(): Entering for inode 0x%Lx, attr type 0x%x, "
@@ -2294,11 +2294,11 @@
*/
static int ntfs_find_attr(const ATTR_TYPES type, const uchar_t *name,
- const __u32 name_len, const IGNORE_CASE_BOOL ic,
- const __u8 *val, const __u32 val_len, ntfs_attr_search_ctx *ctx)
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const u8 *val, const u32 val_len, ntfs_attr_search_ctx *ctx)
{
ATTR_RECORD *a;
ntfs_volume *vol;
uchar_t *upcase;
- __u32 upcase_len;
+ u32 upcase_len;
if (!ctx || !ctx->mrec || !ctx->attr) {
@@ -2401,5 +2401,5 @@
*/
if (!rc) {
- register __u32 avl;
+ register u32 avl;
avl = le32_to_cpu(a->value_length);
if (val_len == avl)
@@ -2471,6 +2471,6 @@
*/
static int ntfs_find_external_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,
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const VCN lowest_vcn, const u8 *val, const u32 val_len,
ntfs_attr_search_ctx *ctx)
{
@@ -2481,5 +2481,5 @@
ATTR_RECORD *a;
uchar_t *al_name;
- __u32 al_name_len;
+ u32 al_name_len;
ni = ctx->ntfs_ino;
@@ -2511,5 +2511,5 @@
for (;; al_entry = next_al_entry) {
/* Out of bounds check. */
- if ((__u8*)al_entry < base_ni->attr_list ||
+ if ((u8*)al_entry < base_ni->attr_list ||
(char*)al_entry > al_end)
break; /* Inode is corrupt. */
@@ -2744,6 +2744,6 @@
*/
int ntfs_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,
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const VCN lowest_vcn, const u8 *val, const u32 val_len,
ntfs_attr_search_ctx *ctx)
{
Index: attrib_RE.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/attrib_RE.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- attrib_RE.c 22 Apr 2002 10:34:31 -0000 1.5
+++ attrib_RE.c 2 Jul 2002 23:47:10 -0000 1.6
@@ -34,21 +34,21 @@
*/
typedef struct {
- __u8 *base;
+ u8 *base;
MFT_RECORD *mrec;
ATTR_RECORD *attr;
- __u8 *alist_val_base;
+ u8 *alist_val_base;
MFT_RECORD *alist_mrec;
ATTR_RECORD *alist_attr;
ATTR_LIST_ENTRY *alist_val;
ATTR_LIST_ENTRY *alist_val_end;
- __u32 alist_val_len;
+ u32 alist_val_len;
IS_FIRST_BOOL is_first;
- __u8 *alist_old_base;
+ u8 *alist_old_base;
} attr_search_context;
BOOL find_attr(const ntfs_volume *vol, const ATTR_TYPES type,
- const wchar_t *name, const __u32 name_len,
- const IGNORE_CASE_BOOL ic, const __u8 *val, const __u32 val_len,
+ const wchar_t *name, const u32 name_len,
+ const IGNORE_CASE_BOOL ic, const u8 *val, const u32 val_len,
ntfs_attr_search_ctx *ctx)
{
@@ -94,5 +94,5 @@
continue searching as a matching attribute might follow. */
if (!rv) {
- register __u32 avl = le32_to_cpu(a->value_length);
+ register u32 avl = le32_to_cpu(a->value_length);
if (val_len == avl)
goto found_it;
@@ -136,17 +136,17 @@
BOOL lookup_external_attr(const ntfs_volume *vol, const MFT_REFERENCE mref,
const ATTR_TYPES type, const wchar_t *name,
- const __u32 name_len, const IGNORE_CASE_BOOL ic,
- const __s64 lowest_vcn, const __u8 *val,
- const __u32 val_len, ntfs_attr_search_ctx *ctx)
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const s64 lowest_vcn, const u8 *val,
+ const u32 val_len, ntfs_attr_search_ctx *ctx)
{
ATTR_LIST_ENTRY *al_pos, **al_val, *al_val_start, *al_next_pos;
ATTR_RECORD *attr_pos;
MFT_RECORD *mrec, *m;
- __u8 var1 = 0;
- __u8 var2 = 0;
- __u8 var3;
+ u8 var1 = 0;
+ u8 var2 = 0;
+ u8 var3;
int rc;
wchar_t *al_name;
- __u32 al_name_len;
+ u32 al_name_len;
al_val = &ctx->alist_val;
@@ -325,11 +325,11 @@
BOOL lookup_attr(const ntfs_volume *vol, const MFT_REFERENCE *mref,
const ATTR_TYPES type, const wchar_t *name,
- const __u32 name_len, const IGNORE_CASE_BOOL ic,
- const __s64 lowest_vcn, const __u8 *val, const __u32 val_len,
+ const u32 name_len, const IGNORE_CASE_BOOL ic,
+ const s64 lowest_vcn, const u8 *val, const u32 val_len,
ntfs_attr_search_ctx *ctx)
{
MFT_RECORD *m;
ATTR_RECORD *a;
- __s64 len;
+ s64 len;
if (!vol || !ctx) {
Index: bootsect.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/bootsect.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -U2 -r1.11 -r1.12
--- bootsect.c 6 Jun 2002 20:47:33 -0000 1.11
+++ bootsect.c 2 Jul 2002 23:47:10 -0000 1.12
@@ -46,5 +46,5 @@
BOOL is_boot_sector_ntfs(const NTFS_BOOT_SECTOR *b, const BOOL silent)
{
- __u32 i;
+ u32 i;
if (!silent)
@@ -52,10 +52,10 @@
/* Calculate the checksum. Note, this is just a simple addition of
- all __u32 values in the bootsector starting at the beginning and
+ all u32 values in the bootsector starting at the beginning and
finishing at the offset of the checksum itself (i.e. not including
the checksum...). */
if ((void*)b < (void*)&b->checksum) {
- __u32 *u = (__u32 *)b;
- __u32 *bi = (__u32 *)(&b->checksum);
+ u32 *u = (u32 *)b;
+ u32 *bi = (u32 *)(&b->checksum);
if (!silent)
@@ -104,5 +104,5 @@
if (!silent)
printf("Checking cluster size... ");
- if ((__u32)le16_to_cpu(b->bpb.bytes_per_sector) *
+ if ((u32)le16_to_cpu(b->bpb.bytes_per_sector) *
b->bpb.sectors_per_cluster > 0x10000)
goto not_ntfs;
@@ -126,6 +126,6 @@
if (!silent)
printf("Checking clusters per mft record... ");
- if ((__u8)b->clusters_per_mft_record < 0xe1 ||
- (__u8)b->clusters_per_mft_record > 0xf7) {
+ if ((u8)b->clusters_per_mft_record < 0xe1 ||
+ (u8)b->clusters_per_mft_record > 0xf7) {
switch (b->clusters_per_mft_record) {
case 1: case 2: case 4: case 8: case 0x10: case 0x20: case 0x40:
@@ -141,6 +141,6 @@
if (!silent)
printf("Checking clusters per index block... ");
- if ((__u8)b->clusters_per_index_record < 0xe1 ||
- (__u8)b->clusters_per_index_record > 0xf7) {
+ if ((u8)b->clusters_per_index_record < 0xe1 ||
+ (u8)b->clusters_per_index_record > 0xf7) {
switch (b->clusters_per_index_record) {
case 1: case 2: case 4: case 8: case 0x10: case 0x20: case 0x40:
@@ -180,6 +180,6 @@
int parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs)
{
- __u8 sectors_per_cluster;
- __s8 c;
+ u8 sectors_per_cluster;
+ s8 c;
/* We return -1 with errno = EINVAL on error. */
Index: dir.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/dir.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -U2 -r1.3 -r1.4
--- dir.c 8 Jun 2002 14:12:01 -0000 1.3
+++ dir.c 2 Jul 2002 23:47:10 -0000 1.4
@@ -65,10 +65,10 @@
* allow exact matches.
*/
-__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 uchar_t *uname,
const int uname_len)
{
VCN vcn;
- __u64 mref = 0;
- __s64 br;
+ u64 mref = 0;
+ s64 br;
ntfs_volume *vol = dir_ni->vol;
ntfs_attr_search_ctx *ctx;
@@ -76,9 +76,9 @@
INDEX_ENTRY *ie;
INDEX_ALLOCATION *ia;
- __u8 *index_end;
+ u8 *index_end;
ntfs_attr *ia_na;
int eo, rc;
- __u32 index_block_size, index_vcn_size;
- __u8 index_vcn_size_bits;
+ u32 index_block_size, index_vcn_size;
+ u8 index_vcn_size_bits;
if (!dir_ni || !dir_ni->mrec || !uname || uname_len <= 0) {
@@ -101,5 +101,5 @@
}
/* Get to the index root value. */
- ir = (INDEX_ROOT*)((__u8*)ctx->attr +
+ ir = (INDEX_ROOT*)((u8*)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
index_block_size = le32_to_cpu(ir->index_block_size);
@@ -109,7 +109,7 @@
goto put_err_out;
}
- index_end = (__u8*)&ir->index + le32_to_cpu(ir->index.index_length);
+ index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
- ie = (INDEX_ENTRY*)((__u8*)&ir->index +
+ ie = (INDEX_ENTRY*)((u8*)&ir->index +
le32_to_cpu(ir->index.entries_offset));
/*
@@ -117,9 +117,9 @@
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((__u8*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds checks. */
- if ((__u8*)ie < (__u8*)ctx->mrec || (__u8*)ie +
+ if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (__u8*)ie + le16_to_cpu(ie->key_length) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end)
goto put_err_out;
@@ -254,5 +254,5 @@
/* Get the starting vcn of the index_block holding the child node. */
- vcn = sle64_to_cpup((__u8*)ie + le16_to_cpu(ie->length) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
descend_into_child_node:
@@ -286,6 +286,6 @@
goto close_err_out;
}
- index_end = (__u8*)&ia->index + le32_to_cpu(ia->index.index_length);
- if (index_end > (__u8*)ia + index_block_size) {
+ index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
+ if (index_end > (u8*)ia + index_block_size) {
Dprintf("Size of index buffer (VCN 0x%Lx) of directory inode "
"0x%Lx exceeds maximum size.\n", (long long)vcn,
@@ -296,5 +296,5 @@
/* The first index entry. */
- ie = (INDEX_ENTRY*)((__u8*)&ia->index +
+ ie = (INDEX_ENTRY*)((u8*)&ia->index +
le32_to_cpu(ia->index.entries_offset));
/*
@@ -303,9 +303,9 @@
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((__u8*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds check. */
- if ((__u8*)ie < (__u8*)ia || (__u8*)ie +
+ if ((u8*)ie < (u8*)ia || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (__u8*)ie + le16_to_cpu(ie->key_length) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end) {
Dprintf("Index entry out of bounds in directory inode "
@@ -417,5 +417,5 @@
}
/* Child node present, descend into it. */
- vcn = sle64_to_cpup((__u8*)ie + le16_to_cpu(ie->length) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
if (vcn >= 0)
goto descend_into_child_node;
@@ -477,5 +477,5 @@
* callback.
*/
-static inline int ntfs_filldir(ntfs_inode *dir_ni, __s64 *pos, __u8 ivcn_bits,
+static inline int ntfs_filldir(ntfs_inode *dir_ni, s64 *pos, u8 ivcn_bits,
const INDEX_TYPE index_type, index_union iu, INDEX_ENTRY *ie,
void *dirent, ntfs_filldir_t filldir)
@@ -486,9 +486,9 @@
/* Advance the position even if going to skip the entry. */
if (index_type == INDEX_TYPE_ALLOCATION)
- *pos = (__u8*)ie - (__u8*)iu.ia + (sle64_to_cpu(
+ *pos = (u8*)ie - (u8*)iu.ia + (sle64_to_cpu(
iu.ia->index_block_vcn) << ivcn_bits) +
dir_ni->vol->mft_record_size;
else /* if (index_type == INDEX_TYPE_ROOT) */
- *pos = (__u8*)ie - (__u8*)iu.ir;
+ *pos = (u8*)ie - (u8*)iu.ir;
/* Skip root directory self reference entry. */
if (MREF_LE(ie->indexed_file) == FILE_root)
@@ -549,8 +549,8 @@
goto io_err_out;
}
- fn = (FILE_NAME_ATTR*)((__u8*)ctx->attr +
+ fn = (FILE_NAME_ATTR*)((u8*)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
- if ((__u8*)fn + le32_to_cpu(ctx->attr->value_length) >
- (__u8*)ctx->attr + le32_to_cpu(ctx->attr->length)) {
+ if ((u8*)fn + le32_to_cpu(ctx->attr->value_length) >
+ (u8*)ctx->attr + le32_to_cpu(ctx->attr->length)) {
Dprintf("Corrupt file name attribute in inode 0x%Lx.\n",
(unsigned long long)ni->mft_no);
@@ -592,18 +592,18 @@
* that the directory entries are not returned sorted.
*/
-int ntfs_readdir(ntfs_inode *dir_ni, __s64 *pos,
+int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos,
void *dirent, ntfs_filldir_t filldir)
{
- __s64 i_size, br, ia_pos, bmp_pos, ia_start;
+ s64 i_size, br, ia_pos, bmp_pos, ia_start;
ntfs_volume *vol;
ntfs_attr *ia_na, *bmp_na = NULL;
ntfs_attr_search_ctx *ctx = NULL;
- __u8 *index_end, *bmp;
+ u8 *index_end, *bmp;
INDEX_ROOT *ir;
INDEX_ENTRY *ie;
INDEX_ALLOCATION *ia;
int rc, ir_pos, bmp_buf_size, bmp_buf_pos, eo;
- __u32 index_block_size, index_vcn_size;
- __u8 index_block_size_bits, index_vcn_size_bits;
+ u32 index_block_size, index_vcn_size;
+ u8 index_block_size_bits, index_vcn_size_bits;
if (!dir_ni || !pos || !filldir) {
@@ -678,5 +678,5 @@
}
/* Get to the index root value. */
- ir = (INDEX_ROOT*)((__u8*)ctx->attr +
+ ir = (INDEX_ROOT*)((u8*)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
@@ -704,7 +704,7 @@
}
- index_end = (__u8*)&ir->index + le32_to_cpu(ir->index.index_length);
+ index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
- ie = (INDEX_ENTRY*)((__u8*)&ir->index +
+ ie = (INDEX_ENTRY*)((u8*)&ir->index +
le32_to_cpu(ir->index.entries_offset));
/*
@@ -713,10 +713,10 @@
* or signals an error (both covered by the rc test).
*/
- for (;; ie = (INDEX_ENTRY*)((__u8*)ie + le16_to_cpu(ie->length))) {
- Dprintf("In index root, offset 0x%x.\n", (__u8*)ie - (__u8*)ir);
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
+ Dprintf("In index root, offset 0x%x.\n", (u8*)ie - (u8*)ir);
/* Bounds checks. */
- if ((__u8*)ie < (__u8*)ctx->mrec || (__u8*)ie +
+ if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (__u8*)ie + le16_to_cpu(ie->key_length) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end)
goto dir_err_out;
@@ -725,5 +725,5 @@
break;
/* Skip index root entry if continuing previous readdir. */
- if (ir_pos > (__u8*)ie - (__u8*)ir)
+ if (ir_pos > (u8*)ie - (u8*)ir)
continue;
/*
@@ -777,5 +777,5 @@
bmp_buf_size = min(bmp_na->data_size - (bmp_pos >> 3), 4096);
- bmp = (__u8*)malloc(bmp_buf_size);
+ bmp = (u8*)malloc(bmp_buf_size);
if (!bmp) {
Dperror("Failed to allocate bitmap buffer");
@@ -827,5 +827,5 @@
}
- ia_start = ia_pos & ~(__s64)(index_block_size - 1);
+ ia_start = ia_pos & ~(s64)(index_block_size - 1);
if (sle64_to_cpu(ia->index_block_vcn) != ia_start >>
index_vcn_size_bits) {
@@ -847,6 +847,6 @@
goto dir_err_out;
}
- index_end = (__u8*)&ia->index + le32_to_cpu(ia->index.index_length);
- if (index_end > (__u8*)ia + index_block_size) {
+ index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
+ if (index_end > (u8*)ia + index_block_size) {
Dprintf("Size of index buffer (VCN 0x%Lx) of directory inode "
"0x%Lx exceeds maximum size.\n",
@@ -856,5 +856,5 @@
}
/* The first index entry. */
- ie = (INDEX_ENTRY*)((__u8*)&ia->index +
+ ie = (INDEX_ENTRY*)((u8*)&ia->index +
le32_to_cpu(ia->index.entries_offset));
/*
@@ -863,11 +863,11 @@
* enough or signals an error (both covered by the rc test).
*/
- for (;; ie = (INDEX_ENTRY*)((__u8*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
Dprintf("In index allocation, offset 0x%Lx.\n",
- (long long)ia_start + ((__u8*)ie - (__u8*)ia));
+ (long long)ia_start + ((u8*)ie - (u8*)ia));
/* Bounds checks. */
- if ((__u8*)ie < (__u8*)ia || (__u8*)ie +
+ if ((u8*)ie < (u8*)ia || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (__u8*)ie + le16_to_cpu(ie->key_length) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end) {
Dprintf("Index entry out of bounds in directory inode "
@@ -880,5 +880,5 @@
break;
/* Skip index entry if continuing previous readdir. */
- if (ia_pos - ia_start > (__u8*)ie - (__u8*)ia)
+ if (ia_pos - ia_start > (u8*)ie - (u8*)ia)
continue;
/*
Index: disk_io.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/disk_io.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -U2 -r1.27 -r1.28
--- disk_io.c 5 Jun 2002 20:32:53 -0000 1.27
+++ disk_io.c 2 Jul 2002 23:47:10 -0000 1.28
@@ -52,7 +52,7 @@
* invalid arguments.
*/
-__s64 ntfs_pread(const int fd, const __s64 pos, __s64 count, const void *b)
+s64 ntfs_pread(const int fd, const s64 pos, s64 count, const void *b)
{
- __s64 br, total;
+ s64 br, total;
Dprintf(__FUNCTION__ "(): Entering for pos 0x%Lx, count 0x%Lx.\n",
@@ -105,7 +105,7 @@
* to EINVAL in case of invalid arguments.
*/
-__s64 ntfs_pwrite(const int fd, const __s64 pos, __s64 count, const void *b)
+s64 ntfs_pwrite(const int fd, const s64 pos, s64 count, const void *b)
{
- __s64 written, total;
+ s64 written, total;
Dprintf(__FUNCTION__ "(): Entering for pos 0x%Lx, count 0x%Lx.\n",
@@ -173,8 +173,8 @@
* the magic being "BAAD".
*/
-__s64 ntfs_mst_pread(const int fd, const __s64 pos, __s64 count,
- const __u32 bksize, const void *b)
+s64 ntfs_mst_pread(const int fd, const s64 pos, s64 count,
+ const u32 bksize, const void *b)
{
- __s64 br, i;
+ s64 br, i;
if (bksize & (bksize - 1) || bksize % NTFS_SECTOR_SIZE) {
@@ -230,8 +230,8 @@
* achieved.
*/
-__s64 ntfs_mst_pwrite(const int fd, const __s64 pos, __s64 count,
- const __u32 bksize, const void *b)
+s64 ntfs_mst_pwrite(const int fd, const s64 pos, s64 count,
+ const u32 bksize, const void *b)
{
- __s64 written, i;
+ s64 written, i;
if (count < 0 || bksize % NTFS_SECTOR_SIZE) {
@@ -277,8 +277,8 @@
* with errno set to the error code.
*/
-__s64 ntfs_read_clusters(const ntfs_volume *vol, const __s64 lcn,
- const __s64 count, const void *b)
+s64 ntfs_read_clusters(const ntfs_volume *vol, const s64 lcn,
+ const s64 count, const void *b)
{
- __s64 br;
+ s64 br;
if (!vol || lcn < 0 || count < 0) {
@@ -310,8 +310,8 @@
* error, with errno set to the error code.
*/
-__s64 ntfs_write_clusters(const ntfs_volume *vol, const __s64 lcn,
- const __s64 count, const void *b)
+s64 ntfs_write_clusters(const ntfs_volume *vol, const s64 lcn,
+ const s64 count, const void *b)
{
- __s64 bw;
+ s64 bw;
if (!vol || lcn < 0 || count < 0) {
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/inode.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- inode.c 1 Jun 2002 00:41:45 -0000 1.9
+++ inode.c 2 Jul 2002 23:47:10 -0000 1.10
@@ -88,5 +88,5 @@
ntfs_inode *ntfs_open_inode(ntfs_volume *vol, const MFT_REF mref)
{
- __s64 l;
+ s64 l;
ntfs_inode *ni;
ntfs_attr_search_ctx *ctx;
@@ -223,5 +223,5 @@
ntfs_inode *ntfs_open_extent_inode(ntfs_inode *base_ni, const MFT_REF mref)
{
- __u64 mft_no = MREF_LE(mref);
+ u64 mft_no = MREF_LE(mref);
ntfs_inode *ni;
ntfs_inode **extent_nis;
@@ -239,5 +239,5 @@
extent_nis = base_ni->extent_nis;
for (i = 0; i < base_ni->nr_extents; i++) {
- __u16 seq_no;
+ u16 seq_no;
ni = extent_nis[i];
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/mft.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -U2 -r1.28 -r1.29
--- mft.c 8 Jun 2002 14:12:01 -0000 1.28
+++ mft.c 2 Jul 2002 23:47:10 -0000 1.29
@@ -50,7 +50,7 @@
*/
int ntfs_read_mft_records(const ntfs_volume *vol, const MFT_REF mref,
- const __s64 count, MFT_RECORD *b)
+ const s64 count, MFT_RECORD *b)
{
- __s64 br;
+ s64 br;
VCN m;
@@ -100,7 +100,7 @@
*/
int ntfs_write_mft_records(const ntfs_volume *vol, const MFT_REF mref,
- const __s64 count, MFT_RECORD *b)
+ const s64 count, MFT_RECORD *b)
{
- __s64 bw;
+ s64 bw;
VCN m;
void *bmirr = NULL;
Index: mst.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/mst.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -U2 -r1.4 -r1.5
--- mst.c 30 Jun 2002 17:02:41 -0000 1.4
+++ mst.c 2 Jul 2002 23:47:10 -0000 1.5
@@ -40,8 +40,8 @@
* record in @b will have been set to "BAAD".
*/
-int ntfs_post_read_mst_fixup(NTFS_RECORD *b, const __u32 size)
+int ntfs_post_read_mst_fixup(NTFS_RECORD *b, const u32 size)
{
- __u16 usa_ofs, usa_count, usn;
- __u16 *usa_pos, *data_pos;
+ u16 usa_ofs, usa_count, usn;
+ u16 *usa_pos, *data_pos;
/* Setup the variables. */
@@ -57,8 +57,8 @@
}
/* Position of usn in update sequence array. */
- usa_pos = (__u16*)b + usa_ofs/sizeof(__u16);
+ usa_pos = (u16*)b + usa_ofs/sizeof(u16);
/*
* The update sequence number which has to be equal to each of the
- * __u16 values before they are fixed up. Note no need to care for
+ * u16 values before they are fixed up. Note no need to care for
* endianness since we are comparing and moving data for on disk
* structures which means the data is consistent. - If it is
@@ -67,7 +67,7 @@
usn = *usa_pos;
/*
- * Position in protected data of first __u16 that needs fixing up.
+ * Position in protected data of first u16 that needs fixing up.
*/
- data_pos = (__u16*)b + NTFS_SECTOR_SIZE/sizeof(__u16) - 1;
+ data_pos = (u16*)b + NTFS_SECTOR_SIZE/sizeof(u16) - 1;
/*
* Check for incomplete multi sector transfer(s).
@@ -84,9 +84,9 @@
return -1;
}
- data_pos += NTFS_SECTOR_SIZE/sizeof(__u16);
+ data_pos += NTFS_SECTOR_SIZE/sizeof(u16);
}
/* Re-setup the variables. */
usa_count = le16_to_cpu(b->usa_count) - 1;
- data_pos = (__u16*)b + NTFS_SECTOR_SIZE/sizeof(__u16) - 1;
+ data_pos = (u16*)b + NTFS_SECTOR_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
@@ -97,5 +97,5 @@
*data_pos = *(++usa_pos);
/* Increment position in data as well. */
- data_pos += NTFS_SECTOR_SIZE/sizeof(__u16);
+ data_pos += NTFS_SECTOR_SIZE/sizeof(u16);
}
return 0;
@@ -122,8 +122,8 @@
* position at that time).
*/
-int ntfs_pre_write_mst_fixup(NTFS_RECORD *b, const __u32 size)
+int ntfs_pre_write_mst_fixup(NTFS_RECORD *b, const u32 size)
{
- __u16 usa_ofs, usa_count, usn;
- __u16 *usa_pos, *data_pos;
+ u16 usa_ofs, usa_count, usn;
+ u16 *usa_pos, *data_pos;
/* Sanity check + only fixup if it makes sense. */
@@ -144,5 +144,5 @@
}
/* Position of usn in update sequence array. */
- usa_pos = (__u16*)((__u8*)b + usa_ofs);
+ usa_pos = (u16*)((u8*)b + usa_ofs);
/*
* Cyclically increment the update sequence number
@@ -154,6 +154,6 @@
usn = cpu_to_le16(usn);
*usa_pos = usn;
- /* Position in data of first __u16 that needs fixing up. */
- data_pos = (__u16*)b + NTFS_SECTOR_SIZE/sizeof(__u16) - 1;
+ /* Position in data of first u16 that needs fixing up. */
+ data_pos = (u16*)b + NTFS_SECTOR_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
@@ -166,5 +166,5 @@
*data_pos = usn;
/* Increment position in data as well. */
- data_pos += NTFS_SECTOR_SIZE/sizeof(__u16);
+ data_pos += NTFS_SECTOR_SIZE/sizeof(u16);
}
return 0;
@@ -182,14 +182,14 @@
void ntfs_post_write_mst_fixup(NTFS_RECORD *b)
{
- __u16 *usa_pos, *data_pos;
+ u16 *usa_pos, *data_pos;
- __u16 usa_ofs = le16_to_cpu(b->usa_ofs);
- __u16 usa_count = le16_to_cpu(b->usa_count) - 1;
+ u16 usa_ofs = le16_to_cpu(b->usa_ofs);
+ u16 usa_count = le16_to_cpu(b->usa_count) - 1;
/* Position of usn in update sequence array. */
- usa_pos = (__u16*)b + usa_ofs/sizeof(__u16);
+ usa_pos = (u16*)b + usa_ofs/sizeof(u16);
- /* Position in protected data of first __u16 that needs fixing up. */
- data_pos = (__u16*)b + NTFS_SECTOR_SIZE/sizeof(__u16) - 1;
+ /* Position in protected data of first u16 that needs fixing up. */
+ data_pos = (u16*)b + NTFS_SECTOR_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
@@ -202,5 +202,5 @@
/* Increment position in data as well. */
- data_pos += NTFS_SECTOR_SIZE/sizeof(__u16);
+ data_pos += NTFS_SECTOR_SIZE/sizeof(u16);
}
}
Index: unistr.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/unistr.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -U2 -r1.15 -r1.16
--- unistr.c 29 Apr 2002 01:53:55 -0000 1.15
+++ unistr.c 2 Jul 2002 23:47:10 -0000 1.16
@@ -44,5 +44,5 @@
* characters are (in)valid.
*/
-const __u8 legal_ansi_char_array[0x40] = {
+const u8 legal_ansi_char_array[0x40] = {
0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
@@ -75,5 +75,5 @@
const uchar_t *s2, size_t s2_len,
const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const __u32 upcase_size)
+ const uchar_t *upcase, const u32 upcase_size)
{
if (s1_len != s2_len)
@@ -103,10 +103,10 @@
* 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 uchar_t *name1, const u32 name1_len,
+ const uchar_t *name2, const u32 name2_len,
const int err_val, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const __u32 upcase_len)
+ const uchar_t *upcase, const u32 upcase_len)
{
- __u32 cnt;
+ u32 cnt;
uchar_t c1, c2;
@@ -202,5 +202,5 @@
*/
int ntfs_ucsncasecmp(const uchar_t *s1, const uchar_t *s2, size_t n,
- const uchar_t *upcase, const __u32 upcase_size)
+ const uchar_t *upcase, const u32 upcase_size)
{
uchar_t c1, c2;
@@ -228,8 +228,8 @@
}
-void ntfs_upcase_name(uchar_t *name, __u32 name_len, const uchar_t *upcase,
- const __u32 upcase_len)
+void ntfs_upcase_name(uchar_t *name, u32 name_len, const uchar_t *upcase,
+ const u32 upcase_len)
{
- __u32 i;
+ u32 i;
uchar_t u;
@@ -240,5 +240,5 @@
void ntfs_file_upcase_value(FILE_NAME_ATTR *file_name_attr,
- const uchar_t *upcase, const __u32 upcase_len)
+ const uchar_t *upcase, const u32 upcase_len)
{
ntfs_upcase_name((uchar_t*)&file_name_attr->file_name,
@@ -249,5 +249,5 @@
FILE_NAME_ATTR *file_name_attr2,
const int err_val, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const __u32 upcase_len)
+ const uchar_t *upcase, const u32 upcase_len)
{
return ntfs_collate_names((uchar_t*)&file_name_attr1->file_name,
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/volume.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -U2 -r1.44 -r1.45
--- volume.c 7 Jun 2002 01:16:20 -0000 1.44
+++ volume.c 2 Jul 2002 23:47:10 -0000 1.45
@@ -99,5 +99,5 @@
{
VCN next_vcn, last_vcn, highest_vcn;
- __s64 l;
+ s64 l;
MFT_RECORD *mb = NULL;
ntfs_attr_search_ctx *ctx = NULL;
@@ -370,5 +370,5 @@
ntfs_volume *ntfs_startup_volume(const char *name, unsigned long rwflag)
{
- __s64 br;
+ s64 br;
const char *OK = "OK";
const char *FAILED = "FAILED";
@@ -481,9 +481,9 @@
ntfs_volume *ntfs_mount(const char *name, unsigned long rwflag)
{
- __s64 l;
+ s64 l;
const char *OK = "OK";
const char *FAILED = "FAILED";
ntfs_volume *vol;
- __u8 *m = NULL, *m2 = NULL;
+ u8 *m = NULL, *m2 = NULL;
ntfs_attr_search_ctx *ctx = NULL;
ntfs_inode *ni;
@@ -493,5 +493,5 @@
uchar_t *vname;
int i, j, eo;
- __u32 u;
+ u32 u;
if (!name) {
@@ -507,6 +507,6 @@
/* Load data from $MFT and $MFTMirr and compare the contents. */
- m = (__u8*)malloc(vol->mftmirr_size << vol->mft_record_size_bits);
- m2 = (__u8*)malloc(vol->mftmirr_size << vol->mft_record_size_bits);
+ m = (u8*)malloc(vol->mftmirr_size << vol->mft_record_size_bits);
+ m2 = (u8*)malloc(vol->mftmirr_size << vol->mft_record_size_bits);
if (!m || !m2) {
Dperror("Failed to allocate memory");
@@ -573,8 +573,8 @@
goto io_error_exit;
}
- if (memcmp((__u8*)m + i * vol->mft_record_size, (__u8*)m2 +
+ if (memcmp((u8*)m + i * vol->mft_record_size, (u8*)m2 +
i * vol->mft_record_size,
ntfs_get_mft_record_data_size((MFT_RECORD*)(
- (__u8*)m + i * vol->mft_record_size)))) {
+ (u8*)m + i * vol->mft_record_size)))) {
Dputs(FAILED);
Dputs("$MFTMirr does not match $MFT. Run chkdsk.");
|