lsattr: support more ext2 flags

function                                             old     new   delta
e2attr_flags_lname                                   214     285     +71
e2attr_flags_value                                    52      80     +28
e2attr_flags_sname                                    14      21      +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 106/0)             Total: 106 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-06-20 12:34:05 +02:00
parent 526b834790
commit 83dff7f431
2 changed files with 25 additions and 13 deletions

View File

@ -158,9 +158,7 @@ const uint32_t e2attr_flags_value[] ALIGN4 = {
EXT2_COMPRBLK_FL, EXT2_COMPRBLK_FL,
EXT2_DIRTY_FL, EXT2_DIRTY_FL,
EXT2_NOCOMPR_FL, EXT2_NOCOMPR_FL,
EXT2_ECOMPR_FL,
#endif #endif
EXT2_INDEX_FL,
EXT2_SECRM_FL, EXT2_SECRM_FL,
EXT2_UNRM_FL, EXT2_UNRM_FL,
EXT2_SYNC_FL, EXT2_SYNC_FL,
@ -170,26 +168,31 @@ const uint32_t e2attr_flags_value[] ALIGN4 = {
EXT2_NODUMP_FL, EXT2_NODUMP_FL,
EXT2_NOATIME_FL, EXT2_NOATIME_FL,
EXT2_COMPR_FL, EXT2_COMPR_FL,
EXT2_ECOMPR_FL,
EXT3_JOURNAL_DATA_FL, EXT3_JOURNAL_DATA_FL,
EXT2_INDEX_FL,
EXT2_NOTAIL_FL, EXT2_NOTAIL_FL,
EXT2_TOPDIR_FL EXT2_TOPDIR_FL,
EXT2_EXTENT_FL,
EXT2_NOCOW_FL,
EXT2_CASEFOLD_FL,
EXT2_INLINE_DATA_FL,
EXT2_PROJINHERIT_FL,
EXT2_VERITY_FL,
}; };
const char e2attr_flags_sname[] ALIGN1 = const char e2attr_flags_sname[] ALIGN1 =
#ifdef ENABLE_COMPRESSION #ifdef ENABLE_COMPRESSION
"BZXE" "BZX"
#endif #endif
"I" "suSDiadAcEjItTeCFNPV";
"suSDiadAcjtT";
static const char e2attr_flags_lname[] ALIGN1 = static const char e2attr_flags_lname[] ALIGN1 =
#ifdef ENABLE_COMPRESSION #ifdef ENABLE_COMPRESSION
"Compressed_File" "\0" "Compressed_File" "\0"
"Compressed_Dirty_File" "\0" "Compressed_Dirty_File" "\0"
"Compression_Raw_Access" "\0" "Compression_Raw_Access" "\0"
"Compression_Error" "\0"
#endif #endif
"Indexed_directory" "\0"
"Secure_Deletion" "\0" "Secure_Deletion" "\0"
"Undelete" "\0" "Undelete" "\0"
"Synchronous_Updates" "\0" "Synchronous_Updates" "\0"
@ -199,9 +202,17 @@ static const char e2attr_flags_lname[] ALIGN1 =
"No_Dump" "\0" "No_Dump" "\0"
"No_Atime" "\0" "No_Atime" "\0"
"Compression_Requested" "\0" "Compression_Requested" "\0"
"Encrypted" "\0"
"Journaled_Data" "\0" "Journaled_Data" "\0"
"Indexed_directory" "\0"
"No_Tailmerging" "\0" "No_Tailmerging" "\0"
"Top_of_Directory_Hierarchies" "\0" "Top_of_Directory_Hierarchies" "\0"
"Extents" "\0"
"No_COW" "\0"
"Casefold" "\0"
"Inline_Data" "\0"
"Project_Hierarchy" "\0"
"Verity" "\0"
/* Another trailing NUL is added by compiler */; /* Another trailing NUL is added by compiler */;
void print_e2flags(FILE *f, unsigned long flags, unsigned options) void print_e2flags(FILE *f, unsigned long flags, unsigned options)

View File

@ -182,11 +182,12 @@ struct ext2_dx_countlimit {
#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */
#define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */ #define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */
#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ #define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
#define EXT3_EXTENTS_FL 0x00080000 /* Inode uses extents */ #define EXT2_EXTENT_FL 0x00080000 /* Extents */
#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ #define EXT2_VERITY_FL 0x00100000
#define EXT2_NOCOW_FL 0x00800000 /* Do not cow file */
#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ #define EXT2_INLINE_DATA_FL 0x10000000
#define EXT2_FL_USER_MODIFIABLE 0x000080FF /* User modifiable flags */ #define EXT2_PROJINHERIT_FL 0x20000000
#define EXT2_CASEFOLD_FL 0x40000000
/* /*
* ioctl commands * ioctl commands