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_id; /* Class id from bidirectional
class id index (?). */
- /* 48*/ __u32 owner_id; /* Owner_id of the user owning
+ /* 48*/ u32 owner_id; /* Owner_id of the user owning
the file. Translate via $Q index in FILE_Extend
/$Quota to the quota control entry for the user
owning the file. Zero if quotas are disabled. */
- /* 52*/ __u32 security_id; /* Security_id for the file.
+ /* 52*/ u32 security_id; /* Security_id for the file.
Translate via $SII index and $SDS data stream
in FILE_Secure to the security descriptor. */
- /* 56*/ __u64 quota_charged; /* Byte size of the charge to
+ /* 56*/ u64 quota_charged; /* Byte size of the charge to
the quota for all streams of the file. Note: Is
zero if quotas are disabled. */
- /* 64*/ __u64 usn; /* Last update sequence number
+ /* 64*/ u64 usn; /* Last update sequence number
of the file. This is a direct index into the
change (aka usn) journal file. It is zero if
@@ -861,8 +871,8 @@
/*Ofs*/
/* 0*/ ATTR_TYPES type; /* Type of referenced attribute. */
-/* 4*/ __u16 length; /* Byte size of this entry. */
-/* 6*/ __u8 name_length; /* Size in Unicode chars of the name of the
+/* 4*/ u16 length; /* Byte size of this entry. */
+/* 6*/ u8 name_length; /* Size in Unicode chars of the name of the
attribute or 0 if unnamed. */
-/* 7*/ __u8 name_offset; /* Byte offset to beginning of attribute name
+/* 7*/ u8 name_offset; /* Byte offset to beginning of attribute name
(always set this to where the name would
start even if unnamed). */
@@ -882,5 +892,5 @@
the ATTR_RECORD for this portion of the
attribute value. */
-/* 24*/ __u16 instance; /* If lowest_vcn = 0, the instance of the
+/* 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
@@ -938,30 +948,30 @@
/* 0*/ MFT_REF parent_directory; /* Directory this filename is
referenced from. */
-/* 8*/ __s64 creation_time; /* Time file was created. */
-/* 10*/ __s64 last_data_change_time; /* Time the data attribute was last
+/* 8*/ s64 creation_time; /* Time file was created. */
+/* 10*/ s64 last_data_change_time; /* Time the data attribute was last
modified. */
-/* 18*/ __s64 last_mft_change_time; /* Time this mft record was last
+/* 18*/ s64 last_mft_change_time; /* Time this mft record was last
modified. */
-/* 20*/ __s64 last_access_time; /* Last time this mft record was
+/* 20*/ s64 last_access_time; /* Last time this mft record was
accessed. */
-/* 28*/ __s64 allocated_size; /* Byte size of allocated space for the
+/* 28*/ s64 allocated_size; /* Byte size of allocated space for the
data attribute. NOTE: Is a multiple
of the cluster size. */
-/* 30*/ __s64 data_size; /* Byte size of actual data in data
+/* 30*/ s64 data_size; /* Byte size of actual data in data
attribute. */
/* 38*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */
/* 3c*/ union {
/* 3c*/ struct {
- /* 3c*/ __u16 packed_ea_size; /* Size of the buffer needed to
+ /* 3c*/ u16 packed_ea_size; /* Size of the buffer needed to
pack the extended attributes
(EAs), if such are present.*/
- /* 3e*/ __u16 reserved; /* Reserved for alignment. */
+ /* 3e*/ u16 reserved; /* Reserved for alignment. */
} __attribute__ ((__packed__));
- /* 3c*/ __u32 reparse_point_tag; /* Type of reparse point,
+ /* 3c*/ u32 reparse_point_tag; /* Type of reparse point,
present only in reparse
points and only if there are
no EAs. */
} __attribute__ ((__packed__));
-/* 40*/ __u8 file_name_length; /* Length of file name in
+/* 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.*/
@@ -979,8 +989,8 @@
*/
typedef struct {
- __u32 data1; /* The first eight hexadecimal digits of the GUID. */
- __u16 data2; /* The first group of four hexadecimal digits. */
- __u16 data3; /* The second group of four hexadecimal digits. */
- __u8 data4[8]; /* The first two bytes are the third group of four
+ u32 data1; /* The first eight hexadecimal digits of the GUID. */
+ u16 data2; /* The first group of four hexadecimal digits. */
+ u16 data3; /* The second group of four hexadecimal digits. */
+ u8 data4[8]; /* The first two bytes are the third group of four
hexadecimal digits. The remaining six bytes are the
final 12 hexadecimal digits. */
@@ -1007,5 +1017,5 @@
GUID domain_id;
} __attribute__ ((__packed__));
- __u8 extended_info[48];
+ u8 extended_info[48];
} __attribute__ ((__packed__));
} __attribute__ ((__packed__)) OBJ_ID_INDEX_DATA;
@@ -1034,5 +1044,5 @@
GUID domain_id; /* Reserved, zero. */
} __attribute__ ((__packed__));
- __u8 extended_info[48];
+ u8 extended_info[48];
} __attribute__ ((__packed__));
} __attribute__ ((__packed__)) OBJECT_ID_ATTR;
@@ -1173,8 +1183,8 @@
typedef union {
struct {
- __u32 low_part; /* Low 32-bits. */
- __u16 high_part; /* High 16-bits. */
+ u32 low_part; /* Low 32-bits. */
+ u16 high_part; /* High 16-bits. */
} __attribute__ ((__packed__));
- __u8 value[6]; /* Value as individual bytes. */
+ u8 value[6]; /* Value as individual bytes. */
} __attribute__ ((__packed__)) SID_IDENTIFIER_AUTHORITY;
@@ -1204,8 +1214,8 @@
*/
typedef struct {
- __u8 revision;
- __u8 sub_authority_count;
+ u8 revision;
+ u8 sub_authority_count;
SID_IDENTIFIER_AUTHORITY identifier_authority;
- __u32 sub_authority[1]; /* At least one sub_authority. */
+ u32 sub_authority[1]; /* At least one sub_authority. */
} __attribute__ ((__packed__)) SID;
@@ -1286,5 +1296,5 @@
ACE_TYPES type; /* Type of the ACE. */
ACE_FLAGS flags; /* Flags describing the ACE. */
- __u16 size; /* Size in bytes of the ACE. */
+ u16 size; /* Size in bytes of the ACE. */
} __attribute__ ((__packed__)) ACE_HEADER;
@@ -1477,10 +1487,10 @@
*/
typedef struct {
- __u8 revision; /* Revision of this ACL. */
- __u8 alignment1;
- __u16 size; /* Allocated space in bytes for ACL. Includes this
+ u8 revision; /* Revision of this ACL. */
+ u8 alignment1;
+ u16 size; /* Allocated space in bytes for ACL. Includes this
header, the ACEs and the remaining free space. */
- __u16 ace_count;/* Number of ACEs in the ACL. */
- __u16 alignment2;
+ u16 ace_count;/* Number of ACEs in the ACL. */
+ u16 alignment2;
/* sizeof() = 8 bytes */
} __attribute__ ((__packed__)) ACL;
@@ -1572,19 +1582,19 @@
*/
typedef struct {
- __u8 revision; /* Revision level of the security descriptor. */
- __u8 alignment;
+ u8 revision; /* Revision level of the security descriptor. */
+ u8 alignment;
SECURITY_DESCRIPTOR_CONTROL control; /* Flags qualifying the type of
the descriptor as well as the following fields. */
- __u32 owner; /* Byte offset to a SID representing an object's
+ u32 owner; /* Byte offset to a SID representing an object's
owner. If this is NULL, no owner SID is present in
the descriptor. */
- __u32 group; /* Byte offset to a SID representing an object's
+ u32 group; /* Byte offset to a SID representing an object's
primary group. If this is NULL, no primary group
SID is present in the descriptor. */
- __u32 sacl; /* Byte offset to a system ACL. Only valid, if
+ u32 sacl; /* Byte offset to a system ACL. Only valid, if
SE_SACL_PRESENT is set in the control field. If
SE_SACL_PRESENT is set but sacl is NULL, a NULL ACL
is specified. */
- __u32 dacl; /* Byte offset to a discretionary ACL. Only valid, if
+ u32 dacl; /* Byte offset to a discretionary ACL. Only valid, if
SE_DACL_PRESENT is set in the control field. If
SE_DACL_PRESENT is set but dacl is NULL, a NULL ACL
@@ -1601,6 +1611,6 @@
*/
typedef struct {
- __u8 revision; /* Revision level of the security descriptor. */
- __u8 alignment;
+ u8 revision; /* Revision level of the security descriptor. */
+ u8 alignment;
SECURITY_DESCRIPTOR_CONTROL control; /* Flags qualifying the type of
the descriptor as well as the following fields. */
@@ -1689,8 +1699,8 @@
*/
typedef struct {
- __u32 hash; /* Hash of the security descriptor. */
- __u32 security_id; /* The security_id assigned to the descriptor. */
- __u64 offset; /* Byte offset of this entry in the $SDS stream. */
- __u32 length; /* Size in bytes of this entry in $SDS stream. */
+ u32 hash; /* Hash of the security descriptor. */
+ u32 security_id; /* The security_id assigned to the descriptor. */
+ u64 offset; /* Byte offset of this entry in the $SDS stream. */
+ u32 length; /* Size in bytes of this entry in $SDS stream. */
} __attribute__ ((__packed__)) SECURITY_DESCRIPTOR_HEADER;
@@ -1717,5 +1727,5 @@
*/
typedef struct {
- __u32 security_id; /* The security_id assigned to the descriptor. */
+ u32 security_id; /* The security_id assigned to the descriptor. */
} __attribute__ ((__packed__)) SII_INDEX_KEY;
@@ -1726,6 +1736,6 @@
*/
typedef struct {
- __u32 hash; /* Hash of the security descriptor. */
- __u32 security_id; /* The security_id assigned to the descriptor. */
+ u32 hash; /* Hash of the security descriptor. */
+ u32 security_id; /* The security_id assigned to the descriptor. */
} __attribute__ ((__packed__)) SDH_INDEX_KEY;
@@ -1737,5 +1747,5 @@
*/
typedef struct {
- uchar_t name[0]; /* The name of the volume in Unicode. */
+ uchar_t name[0]; /* The name of the volume in Unicode. */
} __attribute__ ((__packed__)) VOLUME_NAME;
@@ -1763,7 +1773,7 @@
*/
typedef struct {
- __u64 reserved; /* Not used (yet?). */
- __u8 major_ver; /* Major version of the ntfs format. */
- __u8 minor_ver; /* Minor version of the ntfs format. */
+ u64 reserved; /* Not used (yet?). */
+ u8 major_ver; /* Major version of the ntfs format. */
+ u8 minor_ver; /* Minor version of the ntfs format. */
VOLUME_FLAGS flags; /* Bit array of VOLUME_* flags. */
} __attribute__ ((__packed__)) VOLUME_INFORMATION;
@@ -1777,5 +1787,5 @@
*/
typedef struct {
- __u8 data[0]; /* The file's data contents. */
+ u8 data[0]; /* The file's data contents. */
} __attribute__ ((__packed__)) DATA_ATTR;
@@ -1812,10 +1822,10 @@
*/
typedef struct {
- __u32 entries_offset; /* Byte offset to first INDEX_ENTRY
+ u32 entries_offset; /* Byte offset to first INDEX_ENTRY
aligned to 8-byte boundary. */
- __u32 index_length; /* Data size of the index in bytes,
+ u32 index_length; /* Data size of the index in bytes,
i.e. bytes used from allocated
size, aligned to 8-byte boundary. */
- __u32 allocated_size; /* Byte size of this index (block),
+ u32 allocated_size; /* Byte size of this index (block),
multiple of 8 bytes. */
/* NOTE: For the index root attribute, the above two numbers are always
@@ -1827,5 +1837,5 @@
belongs to. */
INDEX_HEADER_FLAGS flags; /* Bit field of INDEX_HEADER_FLAGS. */
- __u8 reserved[3]; /* Reserved/align to 8-byte boundary. */
+ u8 reserved[3]; /* Reserved/align to 8-byte boundary. */
} __attribute__ ((__packed__)) INDEX_HEADER;
@@ -1857,7 +1867,7 @@
index entries. If type is $FILE_NAME,
this must be COLLATION_FILE_NAME. */
- __u32 index_block_size; /* Size of each index block in bytes (in
+ u32 index_block_size; /* Size of each index block in bytes (in
the index allocation attribute). */
- __u8 clusters_per_index_block; /* Cluster size of each index block (in
+ u8 clusters_per_index_block; /* Cluster size of each index block (in
the index allocation attribute), when
an index block is >= than a cluster,
@@ -1867,5 +1877,5 @@
record size found in the boot sector
work). Has to be a power of 2. */
- __u8 reserved[3]; /* Reserved/align to 8-byte boundary. */
+ u8 reserved[3]; /* Reserved/align to 8-byte boundary. */
INDEX_HEADER index; /* Index header describing the
following index entries. */
@@ -1883,5 +1893,5 @@
typedef struct {
/* 0*/ NTFS_RECORD; /* Magic is "INDX". */
-/* 8*/ __s64 lsn; /* $LogFile sequence number of the last
+/* 8*/ s64 lsn; /* $LogFile sequence number of the last
modification of this index block. */
/* 16*/ VCN index_block_vcn; /* Virtual cluster number of the index block. */
@@ -1911,5 +1921,5 @@
*/
typedef struct {
- __u32 reparse_tag; /* Reparse point type (inc. flags). */
+ u32 reparse_tag; /* Reparse point type (inc. flags). */
MFT_REF file_id; /* Mft record of the file containing the
reparse point attribute. */
@@ -1962,11 +1972,11 @@
*/
typedef struct {
- __u32 version; /* Currently equals 2. */
+ u32 version; /* Currently equals 2. */
QUOTA_FLAGS flags; /* Flags describing this quota entry. */
- __u64 bytes_used; /* How many bytes of the quota are in use. */
- __s64 change_time; /* Last time this quota entry was changed. */
- __s64 threshold; /* Soft quota (-1 if not limited). */
- __s64 limit; /* Hard quota (-1 if not limited). */
- __s64 exceeded_time; /* How long the soft quota has been exceeded. */
+ u64 bytes_used; /* How many bytes of the quota are in use. */
+ s64 change_time; /* Last time this quota entry was changed. */
+ s64 threshold; /* Soft quota (-1 if not limited). */
+ s64 limit; /* Hard quota (-1 if not limited). */
+ s64 exceeded_time; /* How long the soft quota has been exceeded. */
SID sid; /* The SID of the user/object associated with
this quota entry. Equals zero for the quota
@@ -2008,18 +2018,18 @@
indexes. */
struct { /* Used for views/indexes to find the entry's data. */
- __u16 data_offset; /* Data byte offset from this
+ u16 data_offset; /* Data byte offset from this
INDEX_ENTRY. Follows the
index key. */
- __u16 data_length; /* Data length in bytes. */
- __u32 reservedV; /* Reserved (zero). */
+ u16 data_length; /* Data length in bytes. */
+ u32 reservedV; /* Reserved (zero). */
} __attribute__ ((__packed__));
} __attribute__ ((__packed__));
-/* 8*/ __u16 length; /* Byte size of this index entry, multiple of
+/* 8*/ u16 length; /* Byte size of this index entry, multiple of
8-bytes. */
-/* 10*/ __u16 key_length; /* Byte size of the key value, which is in the
+/* 10*/ u16 key_length; /* Byte size of the key value, which is in the
index entry. It follows field reserved. Not
multiple of 8-bytes. */
/* 12*/ INDEX_ENTRY_FLAGS flags; /* Bit field of INDEX_ENTRY_* flags. */
-/* 14*/ __u16 reserved; /* Reserved/align to 8-byte boundary. */
+/* 14*/ u16 reserved; /* Reserved/align to 8-byte boundary. */
/* sizeof() = 16 bytes */
} __attribute__ ((__packed__)) INDEX_ENTRY_HEADER;
@@ -2048,5 +2058,5 @@
SID sid; /* $O index in FILE_Extend/$Quota:
SID of the owner of the user_id. */
- __u32 owner_id; /* $Q index in FILE_Extend/$Quota:
+ u32 owner_id; /* $Q index in FILE_Extend/$Quota:
user_id of the owner of the quota
control entry in the data part of
@@ -2079,5 +2089,5 @@
*/
typedef struct {
- __u8 bitmap[0]; /* Array of bits. */
+ u8 bitmap[0]; /* Array of bits. */
} __attribute__ ((__packed__)) BITMAP_ATTR;
@@ -2129,8 +2139,8 @@
*/
typedef struct {
- __u32 reparse_tag; /* Reparse point type (inc. flags). */
- __u16 reparse_data_length; /* Byte size of reparse data. */
- __u16 reserved; /* Align to 8-byte boundary. */
- __u8 reparse_data[0]; /* Meaning depends on reparse_tag. */
+ u32 reparse_tag; /* Reparse point type (inc. flags). */
+ u16 reparse_data_length; /* Byte size of reparse data. */
+ u16 reserved; /* Align to 8-byte boundary. */
+ u8 reparse_data[0]; /* Meaning depends on reparse_tag. */
} __attribute__ ((__packed__)) REPARSE_POINT;
@@ -2141,9 +2151,9 @@
*/
typedef struct {
- __u16 ea_length; /* Byte size of the packed extended
+ u16 ea_length; /* Byte size of the packed extended
attributes. */
- __u16 need_ea_count; /* The number of extended attributes which have
+ u16 need_ea_count; /* The number of extended attributes which have
the NEED_EA bit set. */
- __u32 ea_query_length; /* Byte size of the buffer required to query
+ u32 ea_query_length; /* Byte size of the buffer required to query
the extended attributes when calling
ZwQueryEaFile() in Windows NT/2k. I.e. the
@@ -2170,12 +2180,12 @@
*/
typedef struct {
- __u32 next_entry_offset; /* Offset to the next EA_ATTR. */
- EA_FLAGS flags; /* Flags describing the EA. */
- __u8 ea_name_length; /* Length of the name of the extended
- attribute in bytes. */
- __u16 ea_value_length; /* Byte size of the EA's value. */
- __u8 ea_name[0]; /* Name of the EA. */
- __u8 ea_value[0]; /* The value of the EA. Immediately
- follows the name. */
+ u32 next_entry_offset; /* Offset to the next EA_ATTR. */
+ EA_FLAGS flags; /* Flags describing the EA. */
+ u8 ea_name_length; /* Length of the name of the extended
+ attribute in bytes. */
+ u16 ea_value_length; /* Byte size of the EA's value. */
+ u8 ea_name[0]; /* Name of the EA. */
+ u8 ea_value[0]; /* The value of the EA. Immediately
+ follows the name. */
} __attribute__ ((__packed__)) EA_ATTR;
Index: logfile.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/logfile.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -U2 -r1.13 -r1.14
--- logfile.h 20 Apr 2002 23:09:42 -0000 1.13
+++ logfile.h 2 Jul 2002 23:47:10 -0000 1.14
@@ -58,8 +58,8 @@
typedef struct {
NTFS_RECORD; /* The magic is "RSTR". */
- __u64 chkdsk_lsn; /* The check disk log file sequence number for
+ u64 chkdsk_lsn; /* The check disk log file sequence number for
this restart page. Only used when the
magic is changed to "CHKD". = 0 */
- __u32 system_page_size; /* Byte size of system pages, has to be >= 512
+ u32 system_page_size; /* Byte size of system pages, has to be >= 512
and a power of 2. Use this to calculate the
required size of the usa and add this to the
@@ -67,13 +67,13 @@
result is less than the value of the
restart_offset. = 0x1000 */
- __u32 log_page_size; /* Byte size of log file records, has to be
+ u32 log_page_size; /* Byte size of log file records, has to be
>= 512 and a power of 2. = 0x1000 */
- __u16 restart_offset; /* Byte offset from the start of the record to
+ u16 restart_offset; /* Byte offset from the start of the record to
the restart record. Value has to be aligned
to 8-byte boundary. = 0x30 */
- __s16 minor_ver; /* Log file minor version. Only check if major
+ s16 minor_ver; /* Log file minor version. Only check if major
version is 1. (=1 but >=1 is treated the
same and <=0 is also ok) */
- __u16 major_ver; /* Log file major version (=1 but =0 is ok) */
+ u16 major_ver; /* Log file major version (=1 but =0 is ok) */
} __attribute__ ((__packed__)) RESTART_PAGE_HEADER;
@@ -84,16 +84,16 @@
*/
typedef struct {
- __u64 current_lsn; /* Log file record. = 0x700000, 0x700808 */
- __u16 log_clients; /* Number of log client records following
+ u64 current_lsn; /* Log file record. = 0x700000, 0x700808 */
+ u16 log_clients; /* Number of log client records following
the restart_area. = 1 */
- __s16 client_free_list; /* How many clients are free(?). If != 0xffff,
+ s16 client_free_list; /* How many clients are free(?). If != 0xffff,
check that log_clients > client_free_list.
= 0xffff */
- __s16 client_in_use_list;/* How many clients are in use(?). If != 0xffff
+ s16 client_in_use_list;/* How many clients are in use(?). If != 0xffff
check that log_clients > client_in_use_list.
= 0 */
- __u16 flags; /* ??? = 0 */
- __u32 seq_number_bits; /* ??? = 0x2c or 0x2d */
- __u16 restart_area_length;/* Length of the restart area. Following
+ u16 flags; /* ??? = 0 */
+ u32 seq_number_bits; /* ??? = 0x2c or 0x2d */
+ u16 restart_area_length;/* Length of the restart area. Following
checks required if version matches.
Otherwise, skip them. restart_offset +
@@ -102,5 +102,5 @@
has to be >= client_array_offset +
(log_clients * 0xa0). = 0xd0 */
- __u16 client_array_offset;/* Offset from the start of this record to
+ u16 client_array_offset;/* Offset from the start of this record to
the first client record if versions are
matched. The offset is otherwise assumed to
@@ -113,5 +113,5 @@
client array + (log_clients * 0xa0) have to
be <= SystemPageSize. = 0x30 */
- __u64 file_size; /* Byte size of the log file. If the
+ u64 file_size; /* Byte size of the log file. If the
restart_offset + the offset of the file_size
are > 510 then corruption has occured. This
@@ -125,11 +125,11 @@
seq_number_bits == 0x43 - file_size bits.
= 0x400000 */
- __u32 last_lsn_data_length;/* ??? = 0, 0x40 */
- __u16 record_length; /* Byte size of this record. If the version
+ u32 last_lsn_data_length;/* ??? = 0, 0x40 */
+ u16 record_length; /* Byte size of this record. If the version
matches then check that the value of
record_length is a multiple of 8, i.e.
(record_length + 7) & ~7 == record_length.
= 0x30 */
- __u16 log_page_data_offset;/* ??? = 0x40 */
+ u16 log_page_data_offset;/* ??? = 0x40 */
/*
* There are eight bytes here at offset 0x58, which contain a value,
@@ -146,15 +146,15 @@
*/
typedef struct {
- __u64 oldest_lsn; /* Oldest log file sequence number for this
+ u64 oldest_lsn; /* Oldest log file sequence number for this
client record. */
- __u64 client_restart_lsn;/* Log file sequence number at which to
+ u64 client_restart_lsn; /* Log file sequence number at which to
restart the volume, i.e. the current
position within the logfile. */
- __s16 prev_client; /* ??? = 0xffff */
- __s16 next_client; /* ??? = 0xffff */
- __u64 seq_number; /* ??? = 1, size uncertain, Regis calls this
+ s16 prev_client; /* ??? = 0xffff */
+ s16 next_client; /* ??? = 0xffff */
+ u64 seq_number; /* ??? = 1, size uncertain, Regis calls this
"volume clear flag" and gives a size of one
byte. */
- __u32 client_name_length; /* ??? length of client name in bytes. = 8,
+ u32 client_name_length; /* ??? length of client name in bytes. = 8,
size uncertain, offset uncertain */
uchar_t client_name[0]; /* ??? Name of the client in unicode. = NTFS */
@@ -177,14 +177,14 @@
NTFS_RECORD; /* The magic is "RCRD". */
union {
- __u64 last_lsn;
- __u32 file_offset;
+ u64 last_lsn;
+ u32 file_offset;
} __attribute__ ((__packed__)) copy;
- __u32 flags;
- __u16 page_count;
- __u16 page_position;
+ u32 flags;
+ u16 page_count;
+ u16 page_position;
union {
struct {
- __u64 next_record_offset;
- __u64 last_end_lsn;
+ u64 next_record_offset;
+ u64 last_end_lsn;
} __attribute__ ((__packed__)) packed;
} __attribute__ ((__packed__)) header;
@@ -206,35 +206,35 @@
*/
typedef struct {
- __u64 this_lsn;
- __u64 client_previous_lsn;
- __u64 client_undo_next_lsn;
- __u32 client_data_length;
+ u64 this_lsn;
+ u64 client_previous_lsn;
+ u64 client_undo_next_lsn;
+ u32 client_data_length;
struct {
- __u16 seq_number;
- __u16 client_index;
+ u16 seq_number;
+ u16 client_index;
} __attribute__ ((__packed__)) client_id;
- __u32 record_type;
- __u32 transaction_id;
+ u32 record_type;
+ u32 transaction_id;
LOG_RECORD_FLAGS flags;
- __u16 reserved_or_alignment[3];
+ u16 reserved_or_alignment[3];
/* Now are at ofs 0x30 into struct. */
- __u16 redo_operation;
- __u16 undo_operation;
- __u16 redo_offset;
- __u16 redo_length;
- __u16 undo_offset;
- __u16 undo_length;
- __u16 target_attribute;
- __u16 lcns_to_follow; /* Number of lcn_list entries
+ u16 redo_operation;
+ u16 undo_operation;
+ u16 redo_offset;
+ u16 redo_length;
+ u16 undo_offset;
+ u16 undo_length;
+ u16 target_attribute;
+ u16 lcns_to_follow; /* Number of lcn_list entries
following this entry. */
/* Now at ofs 0x40. */
- __u16 record_offset;
- __u16 attribute_offset;
- __u32 alignment_or_reserved;
- __s64 target_vcn;
+ u16 record_offset;
+ u16 attribute_offset;
+ u32 alignment_or_reserved;
+ s64 target_vcn;
/* Now at ofs 0x50. */
struct { /* Only present if lcns_to_follow
is not 0. */
- __s64 lcn;
+ s64 lcn;
} __attribute__((__packed__)) lcn_list[0];
} __attribute__ ((__packed__)) LOG_RECORD;
Index: mft.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/mft.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -U2 -r1.34 -r1.35
--- mft.h 1 Jun 2002 00:41:45 -0000 1.34
+++ mft.h 2 Jul 2002 23:47:10 -0000 1.35
@@ -28,5 +28,5 @@
extern 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);
/**
@@ -55,5 +55,5 @@
extern 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);
/**
@@ -94,5 +94,5 @@
* NTFS driver/chkdsk wouldn't view this as corruption in itself though).
*/
-static __inline__ __u32 ntfs_get_mft_record_data_size(const MFT_RECORD *m)
+static __inline__ u32 ntfs_get_mft_record_data_size(const MFT_RECORD *m)
{
if (!m || !is_mft_record(m->magic))
Index: mst.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/mst.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -U2 -r1.4 -r1.5
--- mst.h 20 Apr 2002 23:09:42 -0000 1.4
+++ mst.h 2 Jul 2002 23:47:10 -0000 1.5
@@ -28,6 +28,6 @@
#include "types.h"
-extern int ntfs_post_read_mst_fixup(NTFS_RECORD *b, const __u32 size);
-extern int ntfs_pre_write_mst_fixup(NTFS_RECORD *b, const __u32 size);
+extern int ntfs_post_read_mst_fixup(NTFS_RECORD *b, const u32 size);
+extern int ntfs_pre_write_mst_fixup(NTFS_RECORD *b, const u32 size);
extern void ntfs_post_write_mst_fixup(NTFS_RECORD *b);
Index: types.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/types.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- types.h 1 Jun 2002 00:41:45 -0000 1.9
+++ types.h 2 Jul 2002 23:47:10 -0000 1.10
@@ -42,5 +42,5 @@
VCN vcn; /* vcn = Starting virtual cluster number. */
LCN lcn; /* lcn = Starting logical cluster number. */
- __s64 length; /* Run length in clusters. */
+ s64 length; /* Run length in clusters. */
} run_list_element;
@@ -69,5 +69,5 @@
*/
typedef union {
- __u8; /* Unnamed __u8 to serve as default when just using
+ u8; /* Unnamed u8 to serve as default when just using
a_val without specifying any of the below. */
STANDARD_INFORMATION std_inf;
Index: unistr.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/unistr.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -U2 -r1.14 -r1.15
--- unistr.h 29 Apr 2002 01:53:55 -0000 1.14
+++ unistr.h 2 Jul 2002 23:47:10 -0000 1.15
@@ -28,30 +28,30 @@
#include "types.h"
-extern const __u8 legal_ansi_char_array[0x40];
+extern const u8 legal_ansi_char_array[0x40];
extern 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);
+ 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,
+extern 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);
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);
+ 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);
+extern void ntfs_upcase_name(uchar_t *name, u32 name_len,
+ const uchar_t *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 uchar_t *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 uchar_t *upcase, const u32 upcase_len);
extern int ntfs_ucstombs(const uchar_t *ins, const int ins_len, char **outs,
Index: volume.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/volume.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -U2 -r1.24 -r1.25
--- volume.h 6 Jun 2002 20:47:32 -0000 1.24
+++ volume.h 2 Jul 2002 23:47:10 -0000 1.25
@@ -75,16 +75,16 @@
unsigned long state; /* NTFS specific flags describing this volume.
See ntfs_volume_state_bits above. */
- __u8 major_ver; /* Ntfs major version of volume. */
- __u8 minor_ver; /* Ntfs minor version of volume. */
- __u16 flags; /* Bit array of VOLUME_* flags. */
+ u8 major_ver; /* Ntfs major version of volume. */
+ u8 minor_ver; /* Ntfs minor version of volume. */
+ u16 flags; /* Bit array of VOLUME_* flags. */
- __u16 sector_size; /* Byte size of a sector. */
- __u8 sector_size_bits; /* Log(2) of the byte size of a sector. */
- __u32 cluster_size; /* Byte size of a cluster. */
- __u32 mft_record_size; /* Byte size of a mft record. */
- __u8 cluster_size_bits; /* Log(2) of the byte size of a cluster. */
- __u8 mft_record_size_bits;/* Log(2) of the byte size of a mft record. */
+ u16 sector_size; /* Byte size of a sector. */
+ u8 sector_size_bits; /* Log(2) of the byte size of a sector. */
+ u32 cluster_size; /...
[truncated message content] |