Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv5724/include
Modified Files:
attrib.h bitmap.h dir.h disk_io.h endians.h inode.h layout.h
logfile.h mft.h mst.h types.h unistr.h volume.h
Log Message:
Global replacement of __[su]{8,16,32,64} with [su]{8,16,32,64} and layout.h define it.
Index: attrib.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/attrib.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -U2 -r1.40 -r1.41
--- attrib.h 30 Jun 2002 12:52:25 -0000 1.40
+++ attrib.h 2 Jul 2002 23:47:10 -0000 1.41
@@ -78,6 +78,6 @@
extern 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);
@@ -157,34 +157,34 @@
ATTR_TYPES type;
uchar_t *name;
- __u32 name_len;
+ u32 name_len;
unsigned long state;
- __s64 allocated_size;
- __s64 data_size;
- __s64 initialized_size;
- __s64 compressed_size;
- __u32 compression_block_size;
- __u8 compression_block_size_bits;
- __u8 compression_block_clusters;
+ s64 allocated_size;
+ s64 data_size;
+ s64 initialized_size;
+ s64 compressed_size;
+ u32 compression_block_size;
+ u8 compression_block_size_bits;
+ u8 compression_block_clusters;
};
extern 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);
extern 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);
extern void ntfs_attr_close(ntfs_attr *na);
-extern __s64 ntfs_attr_pread(ntfs_attr *na, const __s64 pos, __s64 count,
+extern s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count,
void *b);
-extern __s64 ntfs_attr_pwrite(ntfs_attr *na, const __s64 pos, __s64 count,
+extern s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count,
void *b);
-extern __s64 ntfs_attr_mst_pread(ntfs_attr *na, const __s64 pos,
- const __s64 bk_cnt, const __u32 bk_size, void *dst);
-extern __s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const __s64 pos,
- __s64 bk_cnt, const __u32 bk_size, void *src);
+extern s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos,
+ const s64 bk_cnt, const u32 bk_size, void *dst);
+extern s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos,
+ s64 bk_cnt, const u32 bk_size, void *src);
extern run_list_element *ntfs_merge_run_lists(run_list_element *drl,
@@ -211,5 +211,5 @@
* Return 1 on success or 0 on error.
*/
-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);
/**
@@ -224,5 +224,5 @@
* FIXME: Describe possible errnos.
*/
-__s64 get_attribute_value_length(const ATTR_RECORD *a);
+s64 get_attribute_value_length(const ATTR_RECORD *a);
/**
@@ -240,6 +240,6 @@
* errno describes the error.
*/
-__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);
/**
@@ -262,5 +262,5 @@
*/
int set_attribute_value(ntfs_volume *vol, ATTR_RECORD *a,
- const __u8 *b, __s64 l);
+ const u8 *b, s64 l);
#endif /* defined ATTRIB_H */
Index: bitmap.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/bitmap.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- bitmap.h 14 Apr 2002 15:26:23 -0000 1.9
+++ bitmap.h 2 Jul 2002 23:47:10 -0000 1.10
@@ -45,6 +45,6 @@
* Set the bit @bit in the @bitmap to @new_value. Ignore all errors.
*/
-static __inline__ void ntfs_set_bit(__u8 *bitmap, const __u64 bit,
- const __u8 new_value)
+static __inline__ void ntfs_set_bit(u8 *bitmap, const u64 bit,
+ const u8 new_value)
{
// Dprintf("bitmap %p, bit 0x%Lx, new_value %i\n", bitmap, bit, new_value);
@@ -65,5 +65,5 @@
* Return -1 on error.
*/
-static __inline__ char ntfs_get_bit(const __u8 *bitmap, const __u64 bit)
+static __inline__ char ntfs_get_bit(const u8 *bitmap, const u64 bit)
{
if (!bitmap)
@@ -72,5 +72,5 @@
}
-static __inline__ void ntfs_change_bit(__u8 *bitmap, const __u64 bit)
+static __inline__ void ntfs_change_bit(u8 *bitmap, const u64 bit)
{
if (!bitmap)
@@ -88,8 +88,8 @@
* Return -1 on error.
*/
-static __inline__ char ntfs_get_and_set_bit(__u8 *bitmap, const __u64 bit,
- const __u8 new_value)
+static __inline__ char ntfs_get_and_set_bit(u8 *bitmap, const u64 bit,
+ const u8 new_value)
{
- register __u8 old_bit, shift;
+ register u8 old_bit, shift;
if (!bitmap || new_value > 1)
Index: dir.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/dir.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -U2 -r1.3 -r1.4
--- dir.h 8 Jun 2002 14:12:01 -0000 1.3
+++ dir.h 2 Jul 2002 23:47:10 -0000 1.4
@@ -30,5 +30,5 @@
extern uchar_t I30[5];
-extern __u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni,
+extern u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni,
const uchar_t *uname, const int uname_len);
@@ -53,8 +53,8 @@
*/
typedef int (*ntfs_filldir_t)(void *dirent, const uchar_t *name,
- const int name_len, const int name_type, const __s64 pos,
+ const int name_len, const int name_type, const s64 pos,
const MFT_REF mref, const unsigned dt_type);
-extern int ntfs_readdir(ntfs_inode *dir_ni, __s64 *pos,
+extern int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos,
void *dirent, ntfs_filldir_t filldir);
Index: disk_io.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/disk_io.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -U2 -r1.16 -r1.17
--- disk_io.h 4 Jun 2002 12:12:42 -0000 1.16
+++ disk_io.h 2 Jul 2002 23:47:10 -0000 1.17
@@ -27,18 +27,16 @@
#include "volume.h"
-extern __s64 ntfs_pread(const int fd, const __s64 pos, __s64 count,
- const void *b);
-extern __s64 ntfs_pwrite(const int fd, const __s64 pos, __s64 count,
- const void *b);
+extern s64 ntfs_pread(const int fd, const s64 pos, s64 count, const void *b);
+extern s64 ntfs_pwrite(const int fd, const s64 pos, s64 count, const void *b);
-extern __s64 ntfs_mst_pread(const int fd, const __s64 pos, __s64 count,
- const __u32 bksize, const void *b);
-extern __s64 ntfs_mst_pwrite(const int fd, const __s64 pos, __s64 count,
- const __u32 bksize, const void *b);
+extern s64 ntfs_mst_pread(const int fd, const s64 pos, s64 count,
+ const u32 bksize, const void *b);
+extern s64 ntfs_mst_pwrite(const int fd, const s64 pos, s64 count,
+ const u32 bksize, const void *b);
-extern __s64 ntfs_read_clusters(const ntfs_volume *vol, const __s64 lcn,
- const __s64 count, const void *b);
-extern __s64 ntfs_write_clusters(const ntfs_volume *vol, const __s64 lcn,
- const __s64 count, const void *b);
+extern s64 ntfs_read_clusters(const ntfs_volume *vol, const s64 lcn,
+ const s64 count, const void *b);
+extern s64 ntfs_write_clusters(const ntfs_volume *vol, const s64 lcn,
+ const s64 count, const void *b);
#endif /* defined DISK_IO_H */
Index: endians.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/endians.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- endians.h 20 Apr 2002 23:09:42 -0000 1.5
+++ endians.h 2 Jul 2002 23:47:10 -0000 1.6
@@ -40,41 +40,41 @@
/* Unsigned from LE to CPU conversion. */
-#define le16_to_cpu(x) (__u16)__le16_to_cpu((__u16)(x))
-#define le32_to_cpu(x) (__u32)__le32_to_cpu((__u32)(x))
-#define le64_to_cpu(x) (__u64)__le64_to_cpu((__u64)(x))
-
-#define le16_to_cpup(x) (__u16)__le16_to_cpu(*(__u16*)(x))
-#define le32_to_cpup(x) (__u32)__le32_to_cpu(*(__u32*)(x))
-#define le64_to_cpup(x) (__u64)__le64_to_cpu(*(__u64*)(x))
+#define le16_to_cpu(x) (u16)__le16_to_cpu((u16)(x))
+#define le32_to_cpu(x) (u32)__le32_to_cpu((u32)(x))
+#define le64_to_cpu(x) (u64)__le64_to_cpu((u64)(x))
+
+#define le16_to_cpup(x) (u16)__le16_to_cpu(*(u16*)(x))
+#define le32_to_cpup(x) (u32)__le32_to_cpu(*(u32*)(x))
+#define le64_to_cpup(x) (u64)__le64_to_cpu(*(u64*)(x))
/* Signed from LE to CPU conversion. */
-#define sle16_to_cpu(x) (__s16)__le16_to_cpu((__s16)(x))
-#define sle32_to_cpu(x) (__s32)__le32_to_cpu((__s32)(x))
-#define sle64_to_cpu(x) (__s64)__le64_to_cpu((__s64)(x))
-
-#define sle16_to_cpup(x) (__s16)__le16_to_cpu(*(__s16*)(x))
-#define sle32_to_cpup(x) (__s32)__le32_to_cpu(*(__s32*)(x))
-#define sle64_to_cpup(x) (__s64)__le64_to_cpu(*(__s64*)(x))
+#define sle16_to_cpu(x) (s16)__le16_to_cpu((s16)(x))
+#define sle32_to_cpu(x) (s32)__le32_to_cpu((s32)(x))
+#define sle64_to_cpu(x) (s64)__le64_to_cpu((s64)(x))
+
+#define sle16_to_cpup(x) (s16)__le16_to_cpu(*(s16*)(x))
+#define sle32_to_cpup(x) (s32)__le32_to_cpu(*(s32*)(x))
+#define sle64_to_cpup(x) (s64)__le64_to_cpu(*(s64*)(x))
/* Unsigned from CPU to LE conversion. */
-#define cpu_to_le16(x) (__u16)__cpu_to_le16((__u16)(x))
-#define cpu_to_le32(x) (__u32)__cpu_to_le32((__u32)(x))
-#define cpu_to_le64(x) (__u64)__cpu_to_le64((__u64)(x))
-
-#define cpu_to_le16p(x) (__u16)__cpu_to_le16(*(__u16*)(x))
-#define cpu_to_le32p(x) (__u32)__cpu_to_le32(*(__u32*)(x))
-#define cpu_to_le64p(x) (__u64)__cpu_to_le64(*(__u64*)(x))
+#define cpu_to_le16(x) (u16)__cpu_to_le16((u16)(x))
+#define cpu_to_le32(x) (u32)__cpu_to_le32((u32)(x))
+#define cpu_to_le64(x) (u64)__cpu_to_le64((u64)(x))
+
+#define cpu_to_le16p(x) (u16)__cpu_to_le16(*(u16*)(x))
+#define cpu_to_le32p(x) (u32)__cpu_to_le32(*(u32*)(x))
+#define cpu_to_le64p(x) (u64)__cpu_to_le64(*(u64*)(x))
/* Signed from CPU to LE conversion. */
-#define scpu_to_le16(x) (__s16)__cpu_to_le16((__s16)(x))
-#define scpu_to_le32(x) (__s32)__cpu_to_le32((__s32)(x))
-#define scpu_to_le64(x) (__s64)__cpu_to_le64((__s64)(x))
-
-#define scpu_to_le16p(x) (__s16)__cpu_to_le16(*(__s16*)(x))
-#define scpu_to_le32p(x) (__s32)__cpu_to_le32(*(__s32*)(x))
-#define scpu_to_le64p(x) (__s64)__cpu_to_le64(*(__s64*)(x))
+#define scpu_to_le16(x) (s16)__cpu_to_le16((s16)(x))
+#define scpu_to_le32(x) (s32)__cpu_to_le32((s32)(x))
+#define scpu_to_le64(x) (s64)__cpu_to_le64((s64)(x))
+
+#define scpu_to_le16p(x) (s16)__cpu_to_le16(*(s16*)(x))
+#define scpu_to_le32p(x) (s32)__cpu_to_le32(*(s32*)(x))
+#define scpu_to_le64p(x) (s64)__cpu_to_le64(*(s64*)(x))
/*
Index: inode.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/inode.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- inode.h 6 Jun 2002 20:47:31 -0000 1.9
+++ inode.h 2 Jul 2002 23:47:10 -0000 1.10
@@ -68,5 +68,5 @@
*/
struct _ntfs_inode {
- __u64 mft_no; /* Inode / mft record number. */
+ u64 mft_no; /* Inode / mft record number. */
MFT_RECORD *mrec; /* The actual mft record of the inode. */
ntfs_volume *vol; /* Pointer to the ntfs volume of this inode. */
@@ -79,8 +79,8 @@
* only valid if NI_AttrListNonResident is set.
*/
- __u32 attr_list_size; /* Length of attribute list value in bytes. */
- __u8 *attr_list; /* Attribute list value itself. */
+ u32 attr_list_size; /* Length of attribute list value in bytes. */
+ u8 *attr_list; /* Attribute list value itself. */
run_list *attr_list_rl; /* Run list for the attribute list value. */
- __s32 nr_extents; /* For a base mft record, the number of
+ s32 nr_extents; /* For a base mft record, the number of
attached extent inodes (0 if none), for
extent records this is -1. */
Index: layout.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/layout.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -U2 -r1.22 -r1.23
--- layout.h 30 Jun 2002 17:02:41 -0000 1.22
+++ layout.h 2 Jul 2002 23:47:10 -0000 1.23
@@ -25,12 +25,23 @@
#define LAYOUT_H
+#include <stdint.h>
#include <sys/types.h>
#include <linux/types.h>
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
+
#include "endians.h"
#include "support.h"
/* 2-byte Unicode character type. */
-typedef __u16 uchar_t;
+typedef u16 uchar_t;
#define UCHAR_T_SIZE_BITS 1
@@ -39,6 +50,6 @@
* and VCN, to allow for type checking and better code readability.
*/
-typedef __s64 VCN;
-typedef __s64 LCN;
+typedef s64 VCN;
+typedef s64 LCN;
/* The NTFS oem_id */
@@ -60,16 +71,16 @@
*/
typedef struct {
- __u16 bytes_per_sector; /* Size of a sector in bytes. */
- __u8 sectors_per_cluster; /* Size of a cluster in sectors. */
- __u16 reserved_sectors; /* zero */
- __u8 fats; /* zero */
- __u16 root_entries; /* zero */
- __u16 sectors; /* zero */
- __u8 media_type; /* 0xf8 = hard disk */
- __u16 sectors_per_fat; /* zero */
- __u16 sectors_per_track; /* irrelevant */
- __u16 heads; /* irrelevant */
- __u32 hidden_sectors; /* zero */
- __u32 large_sectors; /* zero */
+ u16 bytes_per_sector; /* Size of a sector in bytes. */
+ u8 sectors_per_cluster; /* Size of a cluster in sectors. */
+ u16 reserved_sectors; /* zero */
+ u8 fats; /* zero */
+ u16 root_entries; /* zero */
+ u16 sectors; /* zero */
+ u8 media_type; /* 0xf8 = hard disk */
+ u16 sectors_per_fat; /* zero */
+ u16 sectors_per_track; /* irrelevant */
+ u16 heads; /* irrelevant */
+ u32 hidden_sectors; /* zero */
+ u32 large_sectors; /* zero */
/* sizeof() = 25 (0x19) bytes */
} __attribute__ ((__packed__)) BIOS_PARAMETER_BLOCK;
@@ -79,30 +90,29 @@
*/
typedef struct {
- __u8 jump[3]; /* Irrelevant (jump to boot up code).*/
- __u64 oem_id; /* Magic "NTFS ". */
+ u8 jump[3]; /* Irrelevant (jump to boot up code).*/
+ u64 oem_id; /* Magic "NTFS ". */
BIOS_PARAMETER_BLOCK bpb; /* See BIOS_PARAMETER_BLOCK. */
- __u8 unused[4]; /* zero, NTFS diskedit.exe states that
+ u8 unused[4]; /* zero, NTFS diskedit.exe states that
this is actually:
- __u8 physical_drive; // 0x80
- __u8 current_head; // zero
- __u8 extended_boot_signature;
- // 0x80
- __u8 unused; // zero
+ u8 physical_drive; // 0x80
+ u8 current_head; // zero
+ u8 extended_boot_signature; // 0x80
+ u8 unused; // zero
*/
-/*0x28*/__s64 number_of_sectors; /* Number of sectors in volume. Gives
+/*0x28*/s64 number_of_sectors; /* Number of sectors in volume. Gives
maximum volume size of 2^63 sectors.
Assuming standard sector size of 512
bytes, the maximum byte size is
approx. 4.7x10^21 bytes. (-; */
- __s64 mft_lcn; /* Cluster location of mft data. */
- __s64 mftmirr_lcn; /* Cluster location of copy of mft. */
- __s8 clusters_per_mft_record; /* Mft record size in clusters. */
- __u8 reserved0[3]; /* zero */
- __s8 clusters_per_index_record;/* Index block size in clusters. */
- __u8 reserved1[3]; /* zero */
- __u64 volume_serial_number; /* Irrelevant (serial number). */
- __u32 checksum; /* Boot sector checksum. */
-/*0x54*/__u8 bootstrap[426]; /* Irrelevant (boot up code). */
- __u16 end_of_sector_marker; /* End of bootsector magic. Always is
+ s64 mft_lcn; /* Cluster location of mft data. */
+ s64 mftmirr_lcn; /* Cluster location of copy of mft. */
+ s8 clusters_per_mft_record; /* Mft record size in clusters. */
+ u8 reserved0[3]; /* zero */
+ s8 clusters_per_index_record; /* Index block size in clusters. */
+ u8 reserved1[3]; /* zero */
+ u64 volume_serial_number; /* Irrelevant (serial number). */
+ u32 checksum; /* Boot sector checksum. */
+/*0x54*/u8 bootstrap[426]; /* Irrelevant (boot up code). */
+ u16 end_of_sector_marker; /* End of bootsector magic. Always is
0xaa55 in little endian. */
/* sizeof() = 512 (0x200) bytes */
@@ -125,6 +135,6 @@
* operator! (-8
*/
-#define is_magic(x, m) ( (__u32)(x) == (__u32)magic_##m )
-#define is_magicp(p, m) ( *(__u32*)(p) == (__u32)magic_##m )
+#define is_magic(x, m) ( (u32)(x) == (u32)magic_##m )
+#define is_magicp(p, m) ( *(u32*)(p) == (u32)magic_##m )
/*
@@ -153,25 +163,25 @@
/*
- * The Update Sequence Array (usa) is an array of the __u16 values which belong
+ * The Update Sequence Array (usa) is an array of the u16 values which belong
* to the end of each sector protected by the update sequence record in which
* this array is contained. Note that the first entry is the Update Sequence
* Number (usn), a cyclic counter of how many times the protected record has
* been written to disk. The values 0 and -1 (ie. 0xffff) are not used. All
- * last __u16's of each sector have to be equal to the usn (during reading) or
+ * last u16's of each sector have to be equal to the usn (during reading) or
* are set to it (during writing). If they are not, an incomplete multi sector
* transfer has occured when the data was written.
* The maximum size for the update sequence array is fixed to:
* maximum size = usa_ofs + (usa_count * 2) = 510 bytes
- * The 510 bytes comes from the fact that the last __u16 in the array has to
- * (obviously) finish before the last __u16 of the first 512-byte sector.
+ * The 510 bytes comes from the fact that the last u16 in the array has to
+ * (obviously) finish before the last u16 of the first 512-byte sector.
* This formula can be used as a consistency check in that usa_ofs +
* (usa_count * 2) has to be less than or equal to 510.
*/
typedef struct {
- NTFS_RECORD_TYPES magic; /* A four-byte magic identifying the
- record type and/or status. */
- __u16 usa_ofs; /* Offset to the Update Sequence Array (usa)
+ NTFS_RECORD_TYPES magic;/* A four-byte magic identifying the
+ record type and/or status. */
+ u16 usa_ofs; /* Offset to the Update Sequence Array (usa)
from the start of the ntfs record. */
- __u16 usa_count; /* Number of __u16 sized entries in the usa
+ u16 usa_count; /* Number of u16 sized entries in the usa
including the Update Sequence Number (usn),
thus the number of fixups is the usa_count
@@ -284,17 +294,17 @@
} MFT_REF_CONSTS;
-typedef __u64 MFT_REF;
+typedef u64 MFT_REF;
#define MK_MREF(m, s) ((MFT_REF)(((MFT_REF)(s) << 48) | \
((MFT_REF)(m) & MFT_REF_MASK_CPU)))
-#define MREF(x) ((__u64)((x) & MFT_REF_MASK_CPU))
-#define MSEQNO(x) ((__u16)(((x) >> 48) & 0xffff))
-#define MREF_LE(x) ((__u64)(const_le64_to_cpu(x) & MFT_REF_MASK_CPU))
-#define MSEQNO_LE(x) ((__u16)((const_le64_to_cpu(x) >> 48) & 0xffff))
+#define MREF(x) ((u64)((x) & MFT_REF_MASK_CPU))
+#define MSEQNO(x) ((u16)(((x) >> 48) & 0xffff))
+#define MREF_LE(x) ((u64)(const_le64_to_cpu(x) & MFT_REF_MASK_CPU))
+#define MSEQNO_LE(x) ((u16)((const_le64_to_cpu(x) >> 48) & 0xffff))
#define IS_ERR_MREF(x) (((x) & 0x0000800000000000ULL) ? 1 : 0)
-#define ERR_MREF(x) ((__u64)((__s64)(x)))
-#define MREF_ERR(x) ((int)((__s64)(x)))
+#define ERR_MREF(x) ((u64)((s64)(x)))
+#define MREF_ERR(x) ((int)((s64)(x)))
/*
@@ -308,12 +318,12 @@
/*Ofs*/
/* 0*/ NTFS_RECORD; /* Usually the magic is "FILE". */
-/* 8*/ __u64 lsn; /* $LogFile sequence number for this record.
+/* 8*/ u64 lsn; /* $LogFile sequence number for this record.
Changed every time the record is modified. */
-/* 16*/ __u16 sequence_number; /* Number of times this mft record has been
+/* 16*/ u16 sequence_number; /* Number of times this mft record has been
reused. (See description for MFT_REF
above.) NOTE: The increment (skipping zero)
is done when the file is deleted. NOTE: If
this is zero it is left zero. */
-/* 18*/ __u16 link_count; /* Number of hard links, i.e. the number of
+/* 18*/ u16 link_count; /* Number of hard links, i.e. the number of
directory entries referencing this record.
NOTE: Only used in mft base records.
@@ -325,5 +335,5 @@
decrement the link_count.
FIXME: Careful with Win32 + DOS names! */
-/* 20*/ __u16 attrs_offset; /* Byte offset to the first attribute in this
+/* 20*/ u16 attrs_offset; /* Byte offset to the first attribute in this
mft record from the start of the mft record.
NOTE: Must be aligned to 8-byte boundary. */
@@ -331,7 +341,7 @@
is deleted, the MFT_RECORD_IN_USE flag is
set to zero. */
-/* 24*/ __u32 bytes_in_use; /* Number of bytes used in this mft record.
+/* 24*/ u32 bytes_in_use; /* Number of bytes used in this mft record.
NOTE: Must be aligned to 8-byte boundary. */
-/* 28*/ __u32 bytes_allocated; /* Number of bytes allocated for this mft
+/* 28*/ u32 bytes_allocated; /* Number of bytes allocated for this mft
record. This should be equal to the mft
record size. */
@@ -348,5 +358,5 @@
potential extents, belonging to the non-base
mft record). */
-/* 40*/ __u16 next_attr_instance; /* The instance number that will be
+/* 40*/ u16 next_attr_instance; /* The instance number that will be
assigned to the next attribute added to this
mft record. NOTE: Incremented each time
@@ -357,6 +367,6 @@
/* sizeof() = 42 bytes */
/* NTFS 3.1+ (Windows XP and above) introduce the following additions. */
-/* 42*/ //__u16 reserved; /* Reserved/alignment. */
-/* 44*/ //__u32 mft_record_number; /* Number of this mft record. */
+/* 42*/ //u16 reserved; /* Reserved/alignment. */
+/* 44*/ //u32 mft_record_number; /* Number of this mft record. */
/* sizeof() = 48 bytes */
/*
@@ -414,7 +424,7 @@
* for what I mean but COLLATION_UNICODE_STRING would not give any special
* treatment to any characters at all, but this is speculation.
- * COLLATION_NTOFS_ULONG - Sorting is done according to ascending __u32 key
+ * COLLATION_NTOFS_ULONG - Sorting is done according to ascending u32 key
* values. E.g. used for $SII index in FILE_Secure, which sorts by
- * security_id (__u32).
+ * security_id (u32).
* COLLATION_NTOFS_SID - Sorting is done according to ascending SID values.
* E.g. used for $O index in FILE_Extend/$Quota.
@@ -423,17 +433,17 @@
* index in FILE_Secure.
* COLLATION_NTOFS_ULONGS - Sorting is done according to a sequence of ascending
- * __u32 key values. E.g. used for $O index in FILE_Extend/$ObjId, which
+ * u32 key values. E.g. used for $O index in FILE_Extend/$ObjId, which
* sorts by object_id (16-byte), by splitting up the object_id in four
- * __u32 values and using them as individual keys. E.g. take the following
+ * u32 values and using them as individual keys. E.g. take the following
* two security_ids, stored as follows on disk:
* 1st: a1 61 65 b7 65 7b d4 11 9e 3d 00 e0 81 10 42 59
* 2nd: 38 14 37 d2 d2 f3 d4 11 a5 21 c8 6b 79 b1 97 45
- * To compare them, they are split into four __u32 values each, like so:
+ * To compare them, they are split into four u32 values each, like so:
* 1st: 0xb76561a1 0x11d47b65 0xe0003d9e 0x59421081
* 2nd: 0xd2371438 0x11d4f3d2 0x6bc821a5 0x4597b179
* Now, it is apparent why the 2nd object_id collates after the 1st: the
- * first __u32 value of the 1st object_id is less than the first __u32 of
- * the 2nd object_id. If the first __u32 values of both object_ids were
- * equal then the second __u32 values would be compared, etc.
+ * first u32 value of the 1st object_id is less than the first u32 of
+ * the 2nd object_id. If the first u32 values of both object_ids were
+ * equal then the second u32 values would be compared, etc.
*/
typedef enum {
@@ -486,10 +496,10 @@
terminated. */
/* 80*/ ATTR_TYPES type; /* Type of the attribute. */
-/* 84*/ __u32 display_rule; /* Default display rule.
+/* 84*/ u32 display_rule; /* Default display rule.
FIXME: What does it mean? (AIA) */
/* 88*/ COLLATION_RULES collation_rule; /* Default collation rule. */
/* 8c*/ ATTR_DEF_FLAGS flags; /* Flags describing the attribute. */
-/* 90*/ __u64 min_size; /* Optional minimum attribute size. */
-/* 98*/ __u64 max_size; /* Maximum size of attribute. */
+/* 90*/ u64 min_size; /* Optional minimum attribute size. */
+/* 98*/ u64 max_size; /* Maximum size of attribute. */
/* sizeof() = 0xa0 or 160 bytes */
} __attribute__ ((__packed__)) ATTR_DEF;
@@ -589,12 +599,12 @@
/*Ofs*/
/* 0*/ ATTR_TYPES type; /* The (32-bit) type of the attribute. */
-/* 4*/ __u32 length; /* Byte size of the resident part of the
+/* 4*/ u32 length; /* Byte size of the resident part of the
attribute (aligned to 8-byte boundary).
Used to get to the next attribute. */
-/* 8*/ __u8 non_resident; /* If 0, attribute is resident.
+/* 8*/ u8 non_resident; /* If 0, attribute is resident.
If 1, attribute is non-resident. */
-/* 9*/ __u8 name_length; /* Unicode character size of name of attribute.
+/* 9*/ u8 name_length; /* Unicode character size of name of attribute.
0 if unnamed. */
-/* 10*/ __u16 name_offset; /* If name_length != 0, the byte offset to the
+/* 10*/ u16 name_offset; /* If name_length != 0, the byte offset to the
beginning of the name from the attribute
record. Note that the name is stored as a
@@ -606,5 +616,5 @@
boundary. */
/* 12*/ ATTR_FLAGS flags; /* Flags describing the attribute. */
-/* 14*/ __u16 instance; /* The instance of this attribute record. This
+/* 14*/ u16 instance; /* The instance of this attribute record. This
number is unique within this mft record (see
MFT_RECORD/next_attribute_instance notes in
@@ -613,6 +623,6 @@
/* Resident attributes. */
struct {
-/* 16 */ __u32 value_length; /* Byte size of attribute value. */
-/* 20 */ __u16 value_offset; /* Byte offset of the attribute
+/* 16 */ u32 value_length; /* Byte size of attribute value. */
+/* 20 */ u16 value_offset; /* Byte offset of the attribute
value from the start of the
attribute record. When creating,
@@ -622,5 +632,5 @@
of 8-bytes. */
/* 22 */ RESIDENT_ATTR_FLAGS resident_flags; /* See above. */
-/* 23 */ __s8 reservedR; /* Reserved/alignment to 8-byte
+/* 23 */ s8 reservedR; /* Reserved/alignment to 8-byte
boundary. */
} __attribute__ ((__packed__));
@@ -638,5 +648,5 @@
zero length files. Can be 0 for "single extent"
attributes. */
-/* 32*/ __u16 mapping_pairs_offset; /* Byte offset from the
+/* 32*/ u16 mapping_pairs_offset; /* Byte offset from the
beginning of the structure to the mapping pairs
array which contains the mappings between the
@@ -644,5 +654,5 @@
When creating, place this at the end of this
record header aligned to 8-byte boundary. */
-/* 34*/ __u8 compression_unit; /* The compression unit expressed
+/* 34*/ u8 compression_unit; /* The compression unit expressed
as the log to the base 2 of the number of
clusters in a compression unit. 0 means not
@@ -650,8 +660,8 @@
compression unit size to be a power of two
clusters.) WinNT4 only uses a value of 4. */
-/* 35*/ __u8 reserved1[5]; /* Align to 8-byte boundary. */
+/* 35*/ u8 reserved1[5]; /* Align to 8-byte boundary. */
/* The sizes below are only used when lowest_vcn is zero, as otherwise it would
be difficult to keep them up-to-date.*/
-/* 40*/ __s64 allocated_size; /* Byte size of disk space
+/* 40*/ s64 allocated_size; /* Byte size of disk space
allocated to hold the attribute value. Always
is a multiple of the cluster size. When a file
@@ -661,12 +671,12 @@
rather than the actual on disk usage. For this
use the compressed_size (see below). */
-/* 48*/ __s64 data_size; /* Byte size of the attribute
+/* 48*/ s64 data_size; /* Byte size of the attribute
value. Can be larger than allocated_size if
attribute value is compressed or sparse. */
-/* 56*/ __s64 initialized_size; /* Byte size of initialized
+/* 56*/ s64 initialized_size; /* Byte size of initialized
portion of the attribute value. Usually equals
data_size. */
/* sizeof(uncompressed attr) = 64*/
-/* 64*/ __s64 compressed_size; /* Byte size of the attribute
+/* 64*/ s64 compressed_size; /* Byte size of the attribute
value after compression. Only present when
compressed. Always is a multiple of the
@@ -753,11 +763,11 @@
typedef struct {
/*Ofs*/
-/* 0*/ __s64 creation_time; /* Time file was created. Updated when
+/* 0*/ s64 creation_time; /* Time file was created. Updated when
a filename is changed(?). */
-/* 8*/ __s64 last_data_change_time; /* Time the data attribute was last
+/* 8*/ s64 last_data_change_time; /* Time the data attribute was last
modified. */
-/* 16*/ __s64 last_mft_change_time; /* Time this mft record was last
+/* 16*/ s64 last_mft_change_time; /* Time this mft record was last
modified. */
-/* 24*/ __s64 last_access_time; /* Approximate time when the file was
+/* 24*/ s64 last_access_time; /* Approximate time when the file was
last accessed (obviously this is not
updated on read-only volumes). In
@@ -770,5 +780,5 @@
/* 36*/ union {
/* NTFS 1.2 (and previous, presumably) */
-/* 36 */ __u8 reserved12[12]; /* Reserved/alignment to 8-byte
+/* 36 */ u8 reserved12[12]; /* Reserved/alignment to 8-byte
boundary. */
/* sizeof() = 48 bytes */
@@ -794,21 +804,21 @@
* attributes.
*/
- /* 36*/ __u32 maximum_versions; /* Maximum allowed versions for
+ /* 36*/ u32 maximum_versions; /* Maximum allowed versions for
file. Zero if version numbering is disabled. */
- /* 40*/ __u32 version_number; /* This file's version (if any).
+ /* 40*/ u32 version_number; /* This file's version (if any).
Set to zero if maximum_versions is zero. */
- /* 44*/ __u32 class_id; /* Class id from bidirectional
+ /* 44*/ u32 class_...
[truncated message content] |