diff options
Diffstat (limited to 'fs/ntfs/layout.h')
-rw-r--r-- | fs/ntfs/layout.h | 83 |
1 files changed, 47 insertions, 36 deletions
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h index 47b338999921..609ad1728ce4 100644 --- a/fs/ntfs/layout.h +++ b/fs/ntfs/layout.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * layout.h - All NTFS associated on-disk structures. Part of the Linux-NTFS | 2 | * layout.h - All NTFS associated on-disk structures. Part of the Linux-NTFS |
3 | * project. | 3 | * project. |
4 | * | 4 | * |
5 | * Copyright (c) 2001-2004 Anton Altaparmakov | 5 | * Copyright (c) 2001-2005 Anton Altaparmakov |
6 | * Copyright (c) 2002 Richard Russon | 6 | * Copyright (c) 2002 Richard Russon |
7 | * | 7 | * |
8 | * This program/include file is free software; you can redistribute it and/or | 8 | * This program/include file is free software; you can redistribute it and/or |
@@ -547,26 +547,44 @@ enum { | |||
547 | COLLATION_NTOFS_ULONG = const_cpu_to_le32(0x10), | 547 | COLLATION_NTOFS_ULONG = const_cpu_to_le32(0x10), |
548 | COLLATION_NTOFS_SID = const_cpu_to_le32(0x11), | 548 | COLLATION_NTOFS_SID = const_cpu_to_le32(0x11), |
549 | COLLATION_NTOFS_SECURITY_HASH = const_cpu_to_le32(0x12), | 549 | COLLATION_NTOFS_SECURITY_HASH = const_cpu_to_le32(0x12), |
550 | COLLATION_NTOFS_ULONGS = const_cpu_to_le32(0x13) | 550 | COLLATION_NTOFS_ULONGS = const_cpu_to_le32(0x13), |
551 | }; | 551 | }; |
552 | 552 | ||
553 | typedef le32 COLLATION_RULE; | 553 | typedef le32 COLLATION_RULE; |
554 | 554 | ||
555 | /* | 555 | /* |
556 | * The flags (32-bit) describing attribute properties in the attribute | 556 | * The flags (32-bit) describing attribute properties in the attribute |
557 | * definition structure. FIXME: This information is from Regis's information | 557 | * definition structure. FIXME: This information is based on Regis's |
558 | * and, according to him, it is not certain and probably incomplete. | 558 | * information and, according to him, it is not certain and probably |
559 | * The INDEXABLE flag is fairly certainly correct as only the file name | 559 | * incomplete. The INDEXABLE flag is fairly certainly correct as only the file |
560 | * attribute has this flag set and this is the only attribute indexed in NT4. | 560 | * name attribute has this flag set and this is the only attribute indexed in |
561 | * NT4. | ||
561 | */ | 562 | */ |
562 | enum { | 563 | enum { |
563 | INDEXABLE = const_cpu_to_le32(0x02), /* Attribute can be | 564 | ATTR_DEF_INDEXABLE = const_cpu_to_le32(0x02), /* Attribute can be |
564 | indexed. */ | 565 | indexed. */ |
565 | NEED_TO_REGENERATE = const_cpu_to_le32(0x40), /* Need to regenerate | 566 | ATTR_DEF_MULTIPLE = const_cpu_to_le32(0x04), /* Attribute type |
566 | during regeneration | 567 | can be present multiple times in the |
567 | phase. */ | 568 | mft records of an inode. */ |
568 | CAN_BE_NON_RESIDENT = const_cpu_to_le32(0x80), /* Attribute can be | 569 | ATTR_DEF_NOT_ZERO = const_cpu_to_le32(0x08), /* Attribute value |
569 | non-resident. */ | 570 | must contain at least one non-zero |
571 | byte. */ | ||
572 | ATTR_DEF_INDEXED_UNIQUE = const_cpu_to_le32(0x10), /* Attribute must be | ||
573 | indexed and the attribute value must be | ||
574 | unique for the attribute type in all of | ||
575 | the mft records of an inode. */ | ||
576 | ATTR_DEF_NAMED_UNIQUE = const_cpu_to_le32(0x20), /* Attribute must be | ||
577 | named and the name must be unique for | ||
578 | the attribute type in all of the mft | ||
579 | records of an inode. */ | ||
580 | ATTR_DEF_RESIDENT = const_cpu_to_le32(0x40), /* Attribute must be | ||
581 | resident. */ | ||
582 | ATTR_DEF_ALWAYS_LOG = const_cpu_to_le32(0x80), /* Always log | ||
583 | modifications to this attribute, | ||
584 | regardless of whether it is resident or | ||
585 | non-resident. Without this, only log | ||
586 | modifications if the attribute is | ||
587 | resident. */ | ||
570 | }; | 588 | }; |
571 | 589 | ||
572 | typedef le32 ATTR_DEF_FLAGS; | 590 | typedef le32 ATTR_DEF_FLAGS; |
@@ -749,10 +767,11 @@ typedef struct { | |||
749 | record header aligned to 8-byte boundary. */ | 767 | record header aligned to 8-byte boundary. */ |
750 | /* 34*/ u8 compression_unit; /* The compression unit expressed | 768 | /* 34*/ u8 compression_unit; /* The compression unit expressed |
751 | as the log to the base 2 of the number of | 769 | as the log to the base 2 of the number of |
752 | clusters in a compression unit. 0 means not | 770 | clusters in a compression unit. 0 means not |
753 | compressed. (This effectively limits the | 771 | compressed. (This effectively limits the |
754 | compression unit size to be a power of two | 772 | compression unit size to be a power of two |
755 | clusters.) WinNT4 only uses a value of 4. */ | 773 | clusters.) WinNT4 only uses a value of 4. |
774 | Sparse files also have this set to 4. */ | ||
756 | /* 35*/ u8 reserved[5]; /* Align to 8-byte boundary. */ | 775 | /* 35*/ u8 reserved[5]; /* Align to 8-byte boundary. */ |
757 | /* The sizes below are only used when lowest_vcn is zero, as otherwise it would | 776 | /* The sizes below are only used when lowest_vcn is zero, as otherwise it would |
758 | be difficult to keep them up-to-date.*/ | 777 | be difficult to keep them up-to-date.*/ |
@@ -772,10 +791,10 @@ typedef struct { | |||
772 | data_size. */ | 791 | data_size. */ |
773 | /* sizeof(uncompressed attr) = 64*/ | 792 | /* sizeof(uncompressed attr) = 64*/ |
774 | /* 64*/ sle64 compressed_size; /* Byte size of the attribute | 793 | /* 64*/ sle64 compressed_size; /* Byte size of the attribute |
775 | value after compression. Only present when | 794 | value after compression. Only present when |
776 | compressed. Always is a multiple of the | 795 | compressed or sparse. Always is a multiple of |
777 | cluster size. Represents the actual amount of | 796 | the cluster size. Represents the actual amount |
778 | disk space being used on the disk. */ | 797 | of disk space being used on the disk. */ |
779 | /* sizeof(compressed attr) = 72*/ | 798 | /* sizeof(compressed attr) = 72*/ |
780 | } __attribute__ ((__packed__)) non_resident; | 799 | } __attribute__ ((__packed__)) non_resident; |
781 | } __attribute__ ((__packed__)) data; | 800 | } __attribute__ ((__packed__)) data; |
@@ -834,7 +853,7 @@ enum { | |||
834 | /* Note, this is a copy of the corresponding bit from the mft record, | 853 | /* Note, this is a copy of the corresponding bit from the mft record, |
835 | telling us whether this file has a view index present (eg. object id | 854 | telling us whether this file has a view index present (eg. object id |
836 | index, quota index, one of the security indexes or the encrypting | 855 | index, quota index, one of the security indexes or the encrypting |
837 | file system related indexes). */ | 856 | filesystem related indexes). */ |
838 | }; | 857 | }; |
839 | 858 | ||
840 | typedef le32 FILE_ATTR_FLAGS; | 859 | typedef le32 FILE_ATTR_FLAGS; |
@@ -917,20 +936,12 @@ typedef struct { | |||
917 | /* 56*/ le64 quota_charged; /* Byte size of the charge to | 936 | /* 56*/ le64 quota_charged; /* Byte size of the charge to |
918 | the quota for all streams of the file. Note: Is | 937 | the quota for all streams of the file. Note: Is |
919 | zero if quotas are disabled. */ | 938 | zero if quotas are disabled. */ |
920 | /* 64*/ le64 usn; /* Last update sequence number | 939 | /* 64*/ leUSN usn; /* Last update sequence number |
921 | of the file. This is a direct index into the | 940 | of the file. This is a direct index into the |
922 | change (aka usn) journal file. It is zero if | 941 | transaction log file ($UsnJrnl). It is zero if |
923 | the usn journal is disabled. | 942 | the usn journal is disabled or this file has |
924 | NOTE: To disable the journal need to delete | 943 | not been subject to logging yet. See usnjrnl.h |
925 | the journal file itself and to then walk the | 944 | for details. */ |
926 | whole mft and set all Usn entries in all mft | ||
927 | records to zero! (This can take a while!) | ||
928 | The journal is FILE_Extend/$UsnJrnl. Win2k | ||
929 | will recreate the journal and initiate | ||
930 | logging if necessary when mounting the | ||
931 | partition. This, in contrast to disabling the | ||
932 | journal is a very fast process, so the user | ||
933 | won't even notice it. */ | ||
934 | } __attribute__ ((__packed__)) v3; | 945 | } __attribute__ ((__packed__)) v3; |
935 | /* sizeof() = 72 bytes (NTFS 3.x) */ | 946 | /* sizeof() = 72 bytes (NTFS 3.x) */ |
936 | } __attribute__ ((__packed__)) ver; | 947 | } __attribute__ ((__packed__)) ver; |
@@ -1893,7 +1904,7 @@ enum { | |||
1893 | VOLUME_FLAGS_MASK = const_cpu_to_le16(0x803f), | 1904 | VOLUME_FLAGS_MASK = const_cpu_to_le16(0x803f), |
1894 | 1905 | ||
1895 | /* To make our life easier when checking if we must mount read-only. */ | 1906 | /* To make our life easier when checking if we must mount read-only. */ |
1896 | VOLUME_MUST_MOUNT_RO_MASK = const_cpu_to_le16(0x8037), | 1907 | VOLUME_MUST_MOUNT_RO_MASK = const_cpu_to_le16(0x8027), |
1897 | } __attribute__ ((__packed__)); | 1908 | } __attribute__ ((__packed__)); |
1898 | 1909 | ||
1899 | typedef le16 VOLUME_FLAGS; | 1910 | typedef le16 VOLUME_FLAGS; |