Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv5076
Modified Files:
attrib.h bootsect.h logfile.h mft.h ntfs_rec.h
Log Message:
Update to latest include files.
Index: attrib.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/attrib.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** attrib.h 2001/02/03 02:03:35 1.8
--- attrib.h 2001/03/02 15:03:56 1.9
***************
*** 27,49 ****
/*
- * The data attribute of FILE_$AttrDef contains a sequence of attribute
- * definitions for the NTFS volume. With this, it is supposed to be safe for an
- * older NTFS driver to mount a volume containing a newer NTFS version without
- * damaging it (that's the theory. In practice it's: not damaging it too much).
- * The flags describe whether the attribute can be resident/non-resident and
- * possibly other things, too but the actual bits are unknown.
- */
- typedef struct {
[...1759 lines suppressed...]
--- 1709,1713 ----
* errno describes the error.
*/
! __s64 get_attribute_value(const ntfs_volume *vol,
const ATTRIBUTE_RECORD_HEADER *a, __u8 *b);
***************
*** 915,919 ****
*/
int set_attribute_value(ntfs_volume *vol, ATTRIBUTE_RECORD_HEADER *a,
! const __u8 *b, __u64 l);
#endif /* defined ATTRIB_H */
--- 1731,1735 ----
*/
int set_attribute_value(ntfs_volume *vol, ATTRIBUTE_RECORD_HEADER *a,
! const __u8 *b, __s64 l);
#endif /* defined ATTRIB_H */
Index: bootsect.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/bootsect.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** bootsect.h 2001/01/30 12:29:03 1.3
--- bootsect.h 2001/03/02 15:03:56 1.4
***************
*** 49,53 ****
__u16 root_entries; /* zero */
__u16 sectors; /* zero */
! __u8 media_type; /* irrelevant */
__u16 sectors_per_fat; /* zero */
__u16 sectors_per_track; /* irrelevant */
--- 49,53 ----
__u16 root_entries; /* zero */
__u16 sectors; /* zero */
! __u8 media_type; /* 0xf8 = hard disk */
__u16 sectors_per_fat; /* zero */
__u16 sectors_per_track; /* irrelevant */
***************
*** 70,75 ****
bytes, the maximum byte size is
approx. 4.7x10^21 bytes. (-; */
! __s64 mft_lcn; /* Cluster location of mft. */
! __s64 mftmirr_lcn; /* Cluster lcoation of copy of mft. */
__s8 clusters_per_mft_record; /* Mft record size in clusters. */
__u8 reserved0[3]; /* zero */
--- 70,75 ----
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 */
Index: logfile.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/logfile.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** logfile.h 2001/01/27 14:22:02 1.3
--- logfile.h 2001/03/02 15:03:56 1.4
***************
*** 143,147 ****
__u16 prev_client; /* ??? = 0x808, 0xd07, 0xd5d */
__u16 next_client; /* ??? = 0x70 */
! __u16 seq_number; /* ??? = 0, 4 size uncertain */
__u16 client_name; /* ??? = empty string??? size uncertain */
} __attribute__ ((__packed__)) RESTART_CLIENT;
--- 143,149 ----
__u16 prev_client; /* ??? = 0x808, 0xd07, 0xd5d */
__u16 next_client; /* ??? = 0x70 */
! __u16 seq_number; /* ??? = 0, 4 size uncertain, Regis calls this
! "volume clear flag" and gives a size of one
! byte. */
__u16 client_name; /* ??? = empty string??? size uncertain */
} __attribute__ ((__packed__)) RESTART_CLIENT;
Index: mft.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/mft.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** mft.h 2001/01/30 12:55:21 1.5
--- mft.h 2001/03/02 15:03:56 1.6
***************
*** 50,55 ****
attribute. */
FILE_$root = 5, /* Root directory. */
! FILE_$BitMap = 6, /* Allocation bitmap of all clusters in bitmap
! attribute. */
FILE_$Boot = 7, /* Boot sector (always at cluster 0) in data
attribute. */
--- 50,55 ----
attribute. */
FILE_$root = 5, /* Root directory. */
! FILE_$BitMap = 6, /* Allocation bitmap of all clusters (lcns) in
! data attribute. */
FILE_$Boot = 7, /* Boot sector (always at cluster 0) in data
attribute. */
***************
*** 74,84 ****
/*
! * These are the so far known MFT_RECORD_* flags which contain information
! * about the mft record in which they are present.
*/
typedef enum {
MFT_RECORD_IN_USE = cpu_to_le16(0x0001),
MFT_RECORD_IS_DIRECTORY = cpu_to_le16(0x0002),
! } MFT_RECORD_FLAGS;
/*
--- 74,85 ----
/*
! * These are the so far known MFT_RECORD_* flags (16-bit) which contain
! * information about the mft record in which they are present.
*/
typedef enum {
MFT_RECORD_IN_USE = cpu_to_le16(0x0001),
MFT_RECORD_IS_DIRECTORY = cpu_to_le16(0x0002),
! MFT_REC_SPACE_FILLER = 0xffff /* Just to make flags 16-bit. */
! } __attribute__ ((__packed__)) MFT_RECORD_FLAGS;
/*
***************
*** 107,110 ****
--- 108,119 ----
* horrible thing to do as it would trash our current driver implementation. )-:
* Do I hear screams "we want 64-bit inodes!" ?!? (-;
+ *
+ * FIXME: The mft zone is defined as the first 12% of the volume. This space is
+ * reserved so that the mft can grow contiguously and hence doesn't become
+ * fragmented. Volume free space includes the empty part of the mft zone and
+ * when the volume's free 88% are used up, the mft zone is shrunk by a factor
+ * of 2, thus making more space available for more files/data. This process is
+ * repeated everytime there is no more free space except for the mft zone until
+ * there really is no more free space.
*/
typedef union {
***************
*** 117,121 ****
struct {
__u32 low_part; /* Low 32-bits of mft index. */
! __u16 high_part; /* High 32-bits of mft index. */
} __attribute__ ((__packed__));
__u16 sequence_number; /* 16-bit sequence number. */
--- 126,130 ----
struct {
__u32 low_part; /* Low 32-bits of mft index. */
! __u16 high_part; /* High 16-bits of mft index. */
} __attribute__ ((__packed__));
__u16 sequence_number; /* 16-bit sequence number. */
***************
*** 135,139 ****
/*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
--- 144,148 ----
/*Ofs*/
/* 0*/ NTFS_RECORD_HEADER ntfs;/* Usually the magic is "FILE". */
! /* 8*/ __s64 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
***************
*** 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. */
--- 164,168 ----
mft record from the start of the mft record.
NOTE: Must be aligned to 8-byte boundary. */
! /* 22*/ MFT_RECORD_FLAGS flags; /* Bit array of MFT_RECORD_FLAGS. When a file
is deleted, the MFT_RECORD_IN_USE flag is
set to zero. */
***************
*** 163,177 ****
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
! belongs (this is then used to locate the
! attribute list attribute present in the base
! 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
--- 172,187 ----
record. This should be equal to the mft
record size. */
! /* 32*/ MFT_REFERENCE 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 belongs (this is then used to
! locate the attribute list attribute present
! in the base 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
Index: ntfs_rec.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/ntfs_rec.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ntfs_rec.h 2001/01/28 05:49:57 1.2
--- ntfs_rec.h 2001/03/02 15:03:56 1.3
***************
*** 36,40 ****
magic_HOLE = cpu_to_le32(0x454c4f48), /* "HOLE" == ??? (NTFS 3.0+?) */
magic_INDX = cpu_to_le32(0x58444e49), /* "INDX" == index buffer */
! } NTFS_RECORD_TYPES;
/*
--- 36,40 ----
magic_HOLE = cpu_to_le32(0x454c4f48), /* "HOLE" == ??? (NTFS 3.0+?) */
magic_INDX = cpu_to_le32(0x58444e49), /* "INDX" == index buffer */
! } NTFS_RECORD_TYPE;
/*
***************
*** 75,93 ****
* are set to it (during writing). If they are not, an incomplete multi sector
* transfer has occured when the data was written.
*/
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)
! from the start of the ntfs record. */
! __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
! minus 1. */
} __attribute__ ((__packed__)) NTFS_RECORD_HEADER;
/**
* post_read_mst_fixup - deprotect multi sector transfer protected data
! * @b: pinter to the data to deprotect
* @size: size in bytes of @b
*
--- 75,110 ----
* 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.
+ * 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_TYPE 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
! including the Update Sequence Number (usn),
! thus the number of fixups is the usa_count
! minus 1. */
} __attribute__ ((__packed__)) NTFS_RECORD_HEADER;
/**
+ * __post_read_mst_fixup - fast deprotect multi sector transfer protected data
+ * @b: pointer to the data to deprotect
+ * @size: size in bytes of @b
+ *
+ * Perform the necessary post read multi sector transfer fixup, not checking for
+ * any errors. Defined inline for additional speed.
+ */
+ extern __inline__ void __post_read_mst_fixup(NTFS_RECORD_HEADER *b,
+ const __u32 size);
+
+ /**
* post_read_mst_fixup - deprotect multi sector transfer protected data
! * @b: pointer to the data to deprotect
* @size: size in bytes of @b
*
|