Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv3215/include
Modified Files:
attrib.h bootsect.h mft.h
Log Message:
And the last move into CVS. The make files. (Note: compilation is untested
and all changes have been done without testing so if it doesn't compile at
the moment don't be too surprised.)
Index: attrib.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/attrib.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** attrib.h 2001/01/30 00:13:11 1.5
--- attrib.h 2001/01/30 12:29:03 1.6
***************
*** 46,50 ****
/*
! * System defined attributes (32-bit).
*/
typedef enum {
--- 46,55 ----
/*
! * System defined attributes (32-bit). Each attribute type has a corresponding
! * attribute name (Unicode string of maximum 64 character length) as described
! * by the attribute definitions present in the data attribute of the $AttrDef
! * system file. On NTFS 3.0 volumes the names are just as the types are named
! * in the below enum. Note: All system attribute names start with a dollar sign.
! * If that isn't a revealing choice of symbol... (-;
*/
typedef enum {
***************
*** 83,87 ****
/*
! * Attribute record header.
*/
typedef struct {
--- 88,92 ----
/*
! * Attribute record header. Always aligned to 8-byte boundary.
*/
typedef struct {
***************
*** 89,93 ****
/* 0*/ ATTRIBUTE_TYPE type; /* The (32-bit) type of the attribute. */
/* 4*/ __u32 length; /* Byte size of the resident part of the
! attribute (aligned to 8-byte boundary). */
/* 8*/ __u8 non_resident; /* If 0, attribute is resident.
If 1, attribute is non-resident. */
--- 94,99 ----
/* 0*/ ATTRIBUTE_TYPE type; /* The (32-bit) type of the attribute. */
/* 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.
If 1, attribute is non-resident. */
***************
*** 604,607 ****
--- 610,615 ----
* Attribute: Index root (0x90).
*
+ * Always resident.
+ *
* This is followed by a sequence of index entries (INDEX_ENTRY structures)
* as described by the index header.
***************
*** 622,625 ****
--- 630,635 ----
* Attribute: Index allocation (0xa0).
*
+ * Always non-resident (doesn't make sense to be resident anyway!).
+ *
* This is an array of index blocks. Each index block starts with an
* INDEX_BLOCK_HEADER structure containing an index header, followed by a
Index: bootsect.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/bootsect.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** bootsect.h 2001/01/25 22:25:43 1.2
--- bootsect.h 2001/01/30 12:29:03 1.3
***************
*** 36,40 ****
* value is one less than the actual value!).
* On versions of NT 3.51 and earlier, the backup copy was located at
! * number of sectors/2, i.e. in the middle of the volume.
*/
--- 36,40 ----
* value is one less than the actual value!).
* On versions of NT 3.51 and earlier, the backup copy was located at
! * number of sectors/2 (integer divide), i.e. in the middle of the volume.
*/
***************
*** 79,83 ****
__u32 checksum; /* Boot sector checksum. */
__u8 bootstrap[426]; /* Irrelevant (boot up code). */
! __u16 end_of_sector_marker; /* 0xaa55 in little endian. */
} __attribute__ ((__packed__)) NTFS_BOOT_SECTOR;
--- 79,84 ----
__u32 checksum; /* Boot sector checksum. */
__u8 bootstrap[426]; /* Irrelevant (boot up code). */
! __u16 end_of_sector_marker; /* End of bootsector magic. Always is
! 0xaa55 in little endian. */
} __attribute__ ((__packed__)) NTFS_BOOT_SECTOR;
Index: mft.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/mft.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** mft.h 2001/01/28 05:49:57 1.3
--- mft.h 2001/01/30 12:29:03 1.4
***************
*** 30,36 ****
/*
! * System file numbers. All these files are always marked as used in the bitmap
! * attribute of the mft; presumably in order to avoid accidental allocation for
! * random other mft records.
*/
typedef enum {
--- 30,38 ----
/*
! * System files mft record numbers. All these files are always marked as used
! * in the bitmap attribute of the mft; presumably in order to avoid accidental
! * allocation for random other mft records. Also, the sequence number for each
! * of the system files is always equal to their mft record number and it is
! * never modified.
*/
typedef enum {
***************
*** 42,46 ****
FILE_$LogFile = 2, /* Journalling log in data attribute. */
FILE_$Volume = 3, /* Volume name attribute and volume information
! attribute (flags and ntfs version). */
FILE_$AttrDef = 4, /* Array of attribute definitions in data
attribute. */
--- 44,50 ----
FILE_$LogFile = 2, /* Journalling log in data attribute. */
FILE_$Volume = 3, /* Volume name attribute and volume information
! attribute (flags and ntfs version). Windows
! refers to this file as volume DASD, no idea
! what that stands for though. */
FILE_$AttrDef = 4, /* Array of attribute definitions in data
attribute. */
***************
*** 123,132 ****
/*
* The mft record header present at the beginning of every record in the mft.
! * This is followed by a sequence of variable length attribute records.
*/
typedef struct {
/*Ofs*/
/* 0*/ NTFS_RECORD_HEADER ntfs;/* Usually the magic is "FILE". */
! /* 8*/ __s64 lsn; /* Log file sequence number for this record. */
/* 16*/ __u16 sequence_number; /* Number of times this mft record has been
reused. (See description for MFT_REFERENCE
--- 127,140 ----
/*
* The mft record header present at the beginning of every record in the mft.
! * This is followed by a sequence of variable length attribute records which
! * is terminated by an attribute of type $END which is a truncated attribute
! * in that it only consists of the attribute type code $END and none of the
! * other members of the attribute structure are present.
*/
typedef struct {
/*Ofs*/
/* 0*/ NTFS_RECORD_HEADER ntfs;/* Usually the magic is "FILE". */
! /* 8*/ __s64 lsn; /* Log file sequence number for this record.
! Changed every time the record is modified. */
/* 16*/ __u16 sequence_number; /* Number of times this mft record has been
reused. (See description for MFT_REFERENCE
***************
*** 136,139 ****
--- 144,148 ----
/* 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.
NOTE: When deleting a directory entry we
check the link_count and if it is 1 we
***************
*** 146,150 ****
mft record from the start of the mft record.
NOTE: Must be aligned to 8-byte boundary. */
! /* 22*/ __u16 flags; /* Bit array of MFT_RECORD_* flags. When a file
is deleted, the MFT_RECORD_IN_USE flag is
set to zero. */
--- 155,159 ----
mft record from the start of the mft record.
NOTE: Must be aligned to 8-byte boundary. */
! /* 22*/ __u16 flags; /* Bit array of MFT_RECORD_FLAGS. When a file
is deleted, the MFT_RECORD_IN_USE flag is
set to zero. */
***************
*** 154,158 ****
record. This should be equal to the mft
record size. */
! /* 32*/ __u64 base_file_record; /* This is zero for base mft records. When it
is not zero it is a mft reference pointing
to the base mft record to which this record
--- 163,167 ----
record. This should be equal to the mft
record size. */
! /* 32*/ __u64 base_mft_record; /* This is zero for base mft records. When it
is not zero it is a mft reference pointing
to the base mft record to which this record
***************
*** 161,168 ****
record which describes this extension record
and hence might need modification when the
! extension record itself is modified). */
/* 40*/ __u16 next_attribute_instance; /* The instance number that will be
assigned to the next attribute added to this
! mft record. NOTE: incremented each time
after it is used. NOTE: Every time the mft
record is reused this number is set to zero.
--- 170,180 ----
record which describes this extension record
and hence might need modification when the
! extension record itself is modified, also
! locating the attribute list also means
! finding the other potential extents,
! belonging to the non-base mft record). */
/* 40*/ __u16 next_attribute_instance; /* The instance number that will be
assigned to the next attribute added to this
! mft record. NOTE: Incremented each time
after it is used. NOTE: Every time the mft
record is reused this number is set to zero.
***************
*** 170,173 ****
--- 182,194 ----
*/
/* 42 = sizeof() */
+ /*
+ * When (re)using the mft record, we place the update sequence array at this
+ * offset, i.e. before we start with the attributes. This also makes sense,
+ * otherwise we could run into problems with the update sequence array
+ * containing in itself the last two bytes of a sector which would mean that
+ * multi sector transfer protection wouldn't work. As you can't protect data
+ * by overwriting it since you then can't get it back...
+ * When reading we obviously use the data from the ntfs record header.
+ */
} __attribute__ ((__packed__)) MFT_RECORD_HEADER;
|