Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv6438/include
Modified Files:
Makefile.am Makefile.in attrib.h bootsect.h disk_io.h
logfile.h mft.h ntfs_rec.h ntfsd.h unistr.h volume.h
Log Message:
Header file reorganisation so that it compiles.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -U2 -r1.4 -r1.5
--- Makefile.am 2001/04/07 00:53:37 1.4
+++ Makefile.am 2001/04/11 11:49:15 1.5
@@ -10,5 +10,4 @@
mft.h \
ntfs_rec.h \
- volume.h \
unistr.h \
support.h \
Index: Makefile.in
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/Makefile.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -U2 -r1.3 -r1.4
--- Makefile.in 2001/04/07 00:53:37 1.3
+++ Makefile.in 2001/04/11 11:49:15 1.4
@@ -84,5 +84,5 @@
linux_ntfsincludedir = $(includedir)/ntfs
-linux_ntfsinclude_HEADERS = attrib.h bitmap.h bootsect.h disk_io.h endians.h logfile.h mft.h ntfs_rec.h volume.h unistr.h support.h ntfsd.h
+linux_ntfsinclude_HEADERS = attrib.h bitmap.h bootsect.h disk_io.h endians.h logfile.h mft.h ntfs_rec.h unistr.h support.h ntfsd.h
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
Index: attrib.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/attrib.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -U2 -r1.23 -r1.24
--- attrib.h 2001/04/08 01:58:29 1.23
+++ attrib.h 2001/04/11 11:49:16 1.24
@@ -25,1664 +25,9 @@
#define ATTRIB_H
-#include "endians.h"
-#include "mft.h"
+#include "layout.h"
+#include "types.h"
#include "support.h"
#include "unistr.h"
-/*
- * System defined attributes (32-bit). Each attribute type has a corresponding
[...1642 lines suppressed...]
- LCN lcn; /* lcn = starting logical cluster number */
- __u64 length; /* run length in clusters */
-} run_list_element;
-
-typedef run_list_element *run_list;/*In memory vcn to lcn mapping array.*/
-/* run_list notes:
- * - The last vcn (in fact the last vcn + 1) is reached when length == 0.
- * - When lcn == 0 this means that the count vcns starting at vcn are not
- * physically allocated (i.e. this is a hole / data is sparse). */
-/* FIXME: Should this be a linked list so it is easier/quicker to edit? (AIA) */
-
/**
* decompress_run_list - decompress a mapping pairs array into a run list
@@ -1719,5 +64,5 @@
LCN vcn_to_lcn(const run_list rl, const VCN vcn);
-#include "volume.h"
+//#include "volume.h"
/**
Index: bootsect.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/bootsect.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- bootsect.h 2001/04/08 03:02:55 1.5
+++ bootsect.h 2001/04/11 11:49:16 1.6
@@ -26,5 +26,4 @@
#define BOOTSECT_H
-
/* The NTFS oem_id */
#define magicNTFS cpu_to_le64(0x202020205346544e) /* "NTFS " */
Index: disk_io.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/disk_io.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -U2 -r1.6 -r1.7
--- disk_io.h 2001/04/08 03:02:55 1.6
+++ disk_io.h 2001/04/11 11:49:16 1.7
@@ -27,5 +27,6 @@
#include <linux/types.h>
-#include "volume.h"
+#include "layout.h"
+#include "types.h"
/**
@@ -150,10 +151,10 @@
int get_mft_records(const ntfs_volume *vol, __u8 *buf,
- const MFT_REFERENCE *mref, const int count);
+ const MFT_REF *mref, const int count);
extern __inline__ int get_mft_record(const ntfs_volume *vol, __u8 *buf,
- const MFT_REFERENCE *mref);
+ const MFT_REF *mref);
-int read_file_record(const ntfs_volume *vol, const MFT_REFERENCE *mref,
+int read_file_record(const ntfs_volume *vol, const MFT_REF *mref,
MFT_RECORD **mrec, ATTR_RECORD **attr);
@@ -170,5 +171,5 @@
*/
int put_mft_record(ntfs_volume *vol, const __u8 *buf,
- const MFT_REFERENCE *mref);
+ const MFT_REF *mref);
#endif /* defined DISK_IO_H */
Index: logfile.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/logfile.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -U2 -r1.6 -r1.7
--- logfile.h 2001/04/08 03:02:55 1.6
+++ logfile.h 2001/04/11 11:49:16 1.7
@@ -26,5 +26,5 @@
#include "endians.h"
-#include "ntfs_rec.h"
+#include "layout.h"
typedef enum {
Index: mft.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/mft.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -U2 -r1.20 -r1.21
--- mft.h 2001/04/10 23:54:25 1.20
+++ mft.h 2001/04/11 11:49:16 1.21
@@ -27,200 +27,9 @@
#include <linux/bitops.h>
+#include "layout.h"
+#include "types.h"
#include "list.h"
-#include "endians.h"
-#include "ntfs_rec.h"
-#include "volume.h"
#include "support.h"
-#define is_mft_record(x) ( is_file_record(x) )
-#define is_mft_recordp(p) ( is_file_recordp(p) )
-
-/*
- * Clusters are signed 64-bit values on NTFS volumes. We define two types, LCN
- * and VCN, to allow for type checking and better code readability.
- */
-typedef __s64 VCN;
-typedef __s64 LCN;
-
-/*
- * 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 {
- FILE_$Mft = 0, /* Master file table (mft). Data attribute
- contains the entries and bitmap attribute
- records which ones are in use (bit==1). */
- FILE_$MftMirr = 1, /* Mft mirror (copy of first four mft records)
- in data attribute. */
- 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. */
- 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. */
- FILE_$BadClus = 8, /* Contains all bad clusters in the non-resident
- data attribute. */
- FILE_$Secure = 9, /* Shared security descriptors in data attribute
- and two indexes into the descriptors.
- Appeared in Windows NT4 SP4 (I think). */
- FILE_$UpCase = 10, /* Uppercase equivalents of all 65536 Unicode
- characters in data attribute. */
- FILE_$Extend = 11, /* Directory containing other system files (eg.
- $ObjId, $Quota, $Reparse and $UsnJrnl). This
- is new to NTFS3.0. */
- FILE_reserved12 = 12, /* Reserved for future use (records 12-15). */
- FILE_reserved13 = 13,
- FILE_reserved14 = 14,
- FILE_reserved15 = 15,
- FILE_first_user = 16, /* First user file, used as test limit for
- whether to allow opening a file or not. */
-} NTFS_SYSTEM_FILES;
-
-
-/*
- * 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;
-
-/*
- * mft references (aka file references or file record segment references) are
- * used whenever a structure needs to refer to a record in the mft.
- *
- * A reference consists of a 48-bit index into the mft and a 16-bit sequence
- * number used to detect stale references.
- *
- * The sequence number is a circular counter (skipping 0) describing how many
- * times the referenced mft record has been (re)used. This has to match the
- * sequence number of the mft record being referenced, otherwise the reference
- * is considered stale and removed (FIXME: only ntfsck or the driver itself?).
- *
- * If the sequence number is zero it is assumed that no sequence number
- * consistency checking should be performed.
- *
- * FIXME: Since inodes are 32-bit as of now, the driver needs to always check
- * for high_part being 0 and if not either BUG(), cause a panic() or handle
- * the situation in some other way. This shouldn't be a problem as a volume has
- * to become HUGE in order to need more than 32-bits worth of mft records.
- * Assuming the standard mft record size of 1kb only the records (never mind
- * the non-resident attributes, etc.) would require 4Tb of space on their own
- * for the first 32 bits worth of records. This is only if some strange person
- * doesn't decide to foul play and make the mft sparse which would be a really
- * 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 {
- /* We have a union so that we can either use the reference as one
- 64-bit number or as the individual parts (i.e. the mft index and the
- sequence number) broken up using a structure. Since there is no
- 48-bit data type we need to use another struct dividing the mft
- index into the low 32-bits and the high 16-bits. */
- struct {
- 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. */
- } __attribute__ ((__packed__));
- __u64 full_ref; /* Mft reference as one value.*/
- __u64; /* Unnamed reference as one
- value. */
-} __attribute__ ((__packed__)) MFT_REFERENCE;
-
-typedef enum {
- MFT_REFERENCE_MASK_CPU = 0x0000ffffffffffffULL,
- MFT_REFERENCE_MASK_LE = cpu_to_le64(0x0000ffffffffffffULL),
-} MFT_REFERENCE_CONSTS;
-
-/*
- * 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; /* 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
- reused. (See description for MFT_REFERENCE
- 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
- 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
- delete the file. Otherwise we delete the
- FILENAME_ATTR being referenced by the
- directory entry from the mft record and
- decrement the link_count.
- FIXME: Careful with Win32 + DOS names! */
-/* 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. */
-/* 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. */
-/* 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
- 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_attr_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.
- NOTE: The first instance number is always 0.
- */
-/* 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;
-
/**
* get_mft_record_data_size - return number of bytes used in mft record @b
@@ -239,142 +48,6 @@
* wouldn't view this as corruption in itself though!).
*/
-inline __u32 get_mft_record_data_size(const MFT_RECORD *b);
+extern __inline__ __u32 get_mft_record_data_size(const MFT_RECORD *b);
-/*
- * Implementation of files (aka mft records, aka inodes) in memory.
- * ================================================================
- *
- * NOTE: I have completely ignored the existence of things like directories
- * and directory references for the moment! These will just be added later on.
- * The directories themselves are of course covered by being base mft records
- * and hence follow the same semantics like every other mft record.
- *
- * Volume struct (typedef is in volume.h).
- * ---------------------------------------
- *
- * open_files: Linked list of ntfs_file struct pointers, keeping track
- * of all files which have been loaded into memory and are
- * open.
- *
- * nr_open_files: Number of open files.
- *
- * closed_files: Linked list of ntfs_file struct pointers, keeping track
- * of all cached files which are not open any more.
- *
- * nr_closed_files: Number of closed files.
- *
- * max_files: Maximum number of nr_open_files + nr_closed_files.
- *
- * As files are opened/closed, records move from one list to the other. When a
- * file is opened it moves to the front of files_open as we expect to do I/O on
- * it very soon so want quick access to it. When a file is closed, it moves to
- * the end of files_closed as we don't expect it to be opened any time soon.
- *
- * Note: We probably want to replace these with hash tables once the library
- * matures and users start complaining about the speed of it... but this will
- * do for now.
- *
- * mft_entries: Linked list of all loaded mft records (disk inodes) in
- * order of ascending mft record number (disk inode number,
- * i.e. disregarding the sequence number). Note, the list
- * members are not the actual MFT_RECORDS, but in memory
- * mft_entry structs.
- *
- * nr_mft_entries: Number of mft_entries.
- *
- * dirty_mft_entries: Linked list of all loaded mft records which are dirty.
- * Used by the disk writer thread. When a mft_entry is
- * marked dirty, the entry is added to the end of this
- * list. When it is flushed to disk, it is marked clean
- * and removed from this list.
- *
- * nr_dirty_mft_entries: Number of dirty mft_entries.
- *
- *
- * The mft_entry struct.
- * ---------------------
- *
- * Each loaded mft record is represented by the mft_entry structure which
- * contains these members:
- *
- * m_rec: Pointer to the actual MFT_RECORD. (Only valid if mapped flag is
- * set.)
- *
- * m_flags: Atomic flags describing the mft entry / record:
- *
- * mapped: Is the MFT_RECORD actually in memory? (Is mrec valid?)
- *
- * dirty: Does the record need to be written to disk? (If not, it is safe
- * to discard m_rec, but only if m_count is zero and we are
- * holding m_rec_lock for writing.)
- *
- * error: When reading the entry from disk it was detected that it is
- * corrupt. For example, it could be that a multi sector transfer
- * error was detected.
- *
- * m_ref: Mft reference of the mft record described by this entry. (This
- * includes the sequence number for consistency checking purposes.)
- *
- * m_count: Usage count. When zero this record is not referenced by
- * any files and can be thrown away safely (writing it to disk
- * first if dirty flag is set).
- *
- * m_list: Anchor for the mft_entries linked list.
- *
- * m_dirty_list: Anchor for the dirty_mft_enties linked list. (Only valid if
- * the dirty flag is set.)
- *
- * m_vol: Volume this entry and its mft record belong to.
- *
- * m_file: Ntfs file this mft entry belongs to.
- *
- * Future:
- *
- * - Reference all loaded non-resident attributes somehow. Need this for the
- * search context work and we do need to keep them so we can have two
- * readers at the same time. So we need to somehow specify which attribute
- * we are talking about, possibly which mft record it is in (+ position
- * in attribute list?) and a pointer to the attribute value itself.
- *
- * The ntfs_file struct (file = base mft record).
- * ----------------------------------------------
- *
- * Each loaded file is described by an ntfs_file struct, which contains these
- * members:
- *
- * m_refs: The mft references of the file (i.e. the on disk inode number).
- * This is an array of MFT_REFERENCEs. The first reference is the
- * base mft record and if any others exist they are the associated
- * loaded extension mft records. Used for attribute list purposes.
- *
- * m_entries: The loaded mft records for the file. This is an array of
- * pointers to mft_entries, corresponding to the m_refs. This
- * is not strictly necessary but results in a big speed up as we
- * don't need to search the vol->mft_entries list every time...
- *
- * When an entry is referenced in the above lists the usage count for the
- * corresponding entry is increased by one.
- *
- * nr_mft_refs: Number of records in the m_* arrays. If > 1, we
- * know there must be an attribute list attribute (but if 1, we
- * cannot assume there isn't one). This is of course the same as
- * a possible nr_m_entries, but refs is shorter to write. (-;
- *
- * f_count: Usage count. When zero this file is not open by anyone
- * and can be thrown away safely. No need to concern oneself with
- * dirty state as this is done on a mft_entry level, i.e. one level
- * below the idea of files.
- *
- * f_list: Anchor into vol->open/closed_files list. If f_count is > 0,
- * into open_files list, otherwise into closed_files list.
- *
- * Notes:
- *
- * - No field to know whether we have the file open for writing as this is
- * provided on a mft_entry level, i.e. below the files/directories level.
- * This might turn out to be a mistake and is subject to change in the
- * future if the current approach turns out not to work...
- */
-
/* Mft entry flag bit values */
#define ME_mapped 0
@@ -395,28 +68,4 @@
#define ClearMftEntryError(me) clear_bit(ME_error, &(me)->m_flags)
-struct _ntfs_file;
-
-typedef struct {
- MFT_RECORD *m_rec;
- unsigned int m_flags;
- MFT_REFERENCE m_ref;
- unsigned int m_count;
- struct _ntfs_file *m_file;
- struct list_head m_list;
- struct list_head m_dirty_list;
- struct _ntfs_volume *m_vol;
-} mft_entry;
-
-struct {
- MFT_REFERENCE *m_refs;
- mft_entry *m_entries;
- int nr_m_refs;
- int f_count;
- struct list_head f_list;
- struct _ntfs_volume *f_vol;
-} _ntfs_file;
-
-typedef struct _ntfs_file ntfs_file;
-
/**
* flush_mft_entry - flush a mft_entry to disk
@@ -585,5 +234,5 @@
* others Values returned by flush_mft_entry.
*/
-int insert_mft_entry(ntfs_volume *vol, mft_entry **me, const MFT_REFERENCE mref,
+int insert_mft_entry(ntfs_volume *vol, mft_entry **me, const MFT_REF mref,
const MFT_RECORD *mrec, const BOOL dirty,
const ntfs_file *f);
@@ -687,5 +336,5 @@
* pointer as a parameter.
*/
-ntfs_file *ntfs_open_by_mref(ntfs_volume *vol, const MFT_REFERENCE mref);
+ntfs_file *ntfs_open_by_mref(ntfs_volume *vol, const MFT_REF mref);
/**
Index: ntfs_rec.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/ntfs_rec.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- ntfs_rec.h 2001/04/08 03:02:55 1.5
+++ ntfs_rec.h 2001/04/11 11:49:16 1.6
@@ -28,71 +28,4 @@
#include "endians.h"
-/*
- * Magic identifiers present at the beginning of all ntfs record containing
- * records (like mft records for example).
- */
-typedef enum {
- magic_BAAD = cpu_to_le32(0x44414142), /* "BAAD" == corrupt record */
- magic_CHKD = cpu_to_le32(0x424b4843), /* "CHKD" == chkdsk ??? */
- magic_FILE = cpu_to_le32(0x454c4946), /* "FILE" == mft entry */
- magic_HOLE = cpu_to_le32(0x454c4f48), /* "HOLE" == ??? (NTFS 3.0+?) */
- magic_INDX = cpu_to_le32(0x58444e49), /* "INDX" == index buffer */
-} NTFS_RECORD_TYPES;
-
-/*
- * Generic magic comparison macros. Finally found a use for the ## preprocessor
- * operator! (-8
- */
-#define is_magic(x, m) ( (__u32)(x) == magic_##m )
-#define is_magicp(p, m) ( *(__u32*)(p) == magic_##m )
-
-/*
- * Specialised magic comparison macros.
- */
-#define is_baad_record(x) ( is_magic (x, BAAD) )
-#define is_baad_recordp(p) ( is_magicp(p, BAAD) )
-#define is_chkd_record(x) ( is_magic (x, CHKD) )
-#define is_chkd_recordp(p) ( is_magicp(p, CHKD) )
-#define is_file_record(x) ( is_magic (x, FILE) )
-#define is_file_recordp(p) ( is_magicp(p, FILE) )
-#define is_hole_record(x) ( is_magic (x, HOLE) )
-#define is_hole_recordp(p) ( is_magicp(p, HOLE) )
-#define is_indx_record(x) ( is_magic (x, INDX) )
-#define is_indx_recordp(p) ( is_magicp(p, INDX) )
-
-/*
- * Defines for the NTFS filesystem. Don't want to use BLOCK_SIZE and
- * BLOCK_SIZE_BITS from the kernel as that is 1024 and hence too high for us.
- */
-#define NTFS_SECTOR_SIZE 512
-#define NTFS_SECTOR_SIZE_BITS 9
-
-/*
- * 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
- * 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_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;
-
/**
* __post_read_mst_fixup - fast deprotect multi sector transfer protected data
Index: ntfsd.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/ntfsd.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -U2 -r1.7 -r1.8
--- ntfsd.h 2001/04/10 23:37:19 1.7
+++ ntfsd.h 2001/04/11 11:49:16 1.8
@@ -25,8 +25,5 @@
#define NTFSD_H
-#include <linux/bitops.h>
-
#include "list.h"
-#include "volume.h"
#include "support.h"
Index: unistr.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/unistr.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -U2 -r1.4 -r1.5
--- unistr.h 2001/04/08 03:02:55 1.4
+++ unistr.h 2001/04/11 11:49:16 1.5
@@ -31,5 +31,6 @@
*/
/* #include <linux/nls.h> */
-#include <stdio.h>
+//#include <stdio.h>
+#include <linux/types.h>
#include "endians.h"
Index: volume.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/volume.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -U2 -r1.12 -r1.13
--- volume.h 2001/04/10 23:37:19 1.12
+++ volume.h 2001/04/11 11:49:16 1.13
@@ -28,93 +28,6 @@
#include "list.h"
-#include "attrib.h"
#include "support.h"
-
-/*
- * FIXME: Do we really want to return a pointer to the actual volume structure
- * to the user to play with? It would be better to completely abstract the
- * structure and provide functions for accessing the public members instead.
- * In that case we would return a volume descriptor to the caller.
- *
- * DECISION: Return the actual structure. In the second release, once
- * everything is working, we still have the option of abstracting the volume
- * strcture data type.
- */
-/*
- * FIXME: For RAID stuff will need the fd and dev_name variables to be arrays
- * or lists or something... Also will need to know the number of sectors (and
- * sector size if not 512) of each device making up the RAID array. Obviously,
- * will need RAID information as well like which RAID is used together with
- * state information, etc. But that is the far future.
- */
-
-/* The ntfs volume structure describing an open volume. */
-struct {
- int fd; /* File descriptor associated with volume. */
- char *dev_name; /* Name of the device/file the volume is in. */
- char *vol_name; /* Name of the volume from the volume name
- attribute. */
- /* Version nos. and flags are from the volume information attribute. */
- __u8 major_ver; /* Ntfs major version of volume. */
- __u8 minor_ver; /* Ntfs minor version of volume. */
- __u16 flags; /* Bit array of VOLUME_* flags. */
- __s64 number_of_clusters;/* Volume size in clusters, hence also the
- number of bits in lcn_bitmap. */
- __u32 cluster_size; /* Byte size of a cluster. */
- __u32 mft_record_size; /* Byte size of a mft record. */
- __s64 mft_lcn; /* Logical cluster number of the data attribute
- for FILE_$Mft. */
- __s64 mftmirr_lcn; /* Logical cluster number of the data attribute
- for FILE_$MftMirr. */
- __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. */
- __u8 *lcn_bitmap; /* Value of data attribute of FILE_$Bitmap. Each
- bit represents a cluster on the volume, bit 0
- representing lcn 0 and so on. A set bit means
- that the cluster is in use and a zero bit
- means the cluster is free. */
- __u8 *mft_bitmap; /* Value of bitmap attribute of FILE_$Mft. Has
- same interpretation as the lcn_bitmap above
- but except that it keeps track of the usage
- of the mft records rather than the lcns. */
- run_list mft_runlist; /* Decompressed run list of the data attribute
- of FILE_$Mft. */
- __s64 number_of_mft_records; /* Number of records in the mft, equals
- the number of bits in mft_bitmap. */
- wchar_t *upcase; /* Upper case equivalents of all 65536
- 2-byte Unicode characters. Obtained
- from FILE_$UpCase. */
- __u32 upcase_len; /* Length in Unicode characters of the
- upcase table. */
- __u8 mft_records_per_cluster; /* The number of mft records that fit
- into one cluster or 0 if clusters
- are smaller than mft records. */
- __u8 clusters_per_mft_record; /* The size of a mft record in clusters
- or 0 if a mft record is smaller than
- a cluster. */
- struct list_head open_files; /* Linked list of ntfs_file struct
- pointers, keeping track of all files
- which have been loaded into memory
- and are open. */
- int nr_open_files; /* Number of open files. */
- struct list_head closed_files; /* Linked list of ntfs_file struct
- pointers, keeping track of all cached
- files which are not open any more. */ int nr_closed_files; /* Number of closed files. */
- int max_files; /* Maximum number of nr_open_files + nr_ closed_files. */
- struct list_head mft_entries; /* Linked list of all loaded mft records
- (disk inodes) in order of ascending
- mft record number (disk inode number,
- disregarding the sequence number).
- Note, the list members are mft_entry
- struct pointers. */
- int nr_mft_entries; /* Number of mft_entries. */
- struct list_head dirty_mft_entries; /* Linked list of all loaded mft
- records which are dirty. */
- int nr_dirty_mft_entries; /* Number of dirty mft_entries. */
- struct list_head v_list; /* Anchor for list of all mounted
- volumes. */
-} _ntfs_volume;
-
-typedef struct _ntfs_volume ntfs_volume;
+#include "types.h"
/**
|