From 15f9011add4013d32ea2f7ca7dbf860f95b8ec53 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 1 Nov 2002 01:53:52 -0500 Subject: [PATCH] Add support for a new inode flag, which is to be used for indicating the top of directory hierarchies for the Orlov block allocator. --- lib/e2p/pf.c | 1 + lib/ext2fs/ext2_fs.h | 3 ++- misc/chattr.1.in | 9 +++++++-- misc/chattr.c | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/e2p/pf.c b/lib/e2p/pf.c index a540c73..5edd690 100644 --- a/lib/e2p/pf.c +++ b/lib/e2p/pf.c @@ -40,6 +40,7 @@ static struct flags_name flags_array[] = { { EXT2_ECOMPR_FL, "E", "Compression_Error" }, { EXT3_JOURNAL_DATA_FL, "j", "Journaled_Data" }, { EXT2_NOTAIL_FL, "t", "No_Tailmerging" }, + { EXT2_TOPDIR_FL, "T", "Top_of_Directory_Hierarchies" }, { 0, NULL, NULL } }; diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 7cd679d..4f32466 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -232,9 +232,10 @@ struct ext2_dx_countlimit { #define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */ #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ #define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */ +#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ -#define EXT2_FL_USER_VISIBLE 0x0001DFFF /* User visible flags */ +#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ #define EXT2_FL_USER_MODIFIABLE 0x000080FF /* User modifiable flags */ /* diff --git a/misc/chattr.1.in b/misc/chattr.1.in index 218a291..1e17bd8 100644 --- a/misc/chattr.1.in +++ b/misc/chattr.1.in @@ -19,7 +19,7 @@ chattr \- change file attributes on a Linux second extended file system .B chattr changes the file attributes on a Linux second extended file system. .PP -The format of a symbolic mode is +-=[ASacDdistu]. +The format of a symbolic mode is +-=[ASacDdisTtu]. .PP The operator `+' causes the selected attributes to be added to the existing attributes of the files; `-' causes them to be removed; and @@ -28,7 +28,8 @@ existing attributes of the files; `-' causes them to be removed; and The letters `ASacDdijsu' select the new attributes for the files: don't update atime (A), synchronous updates (S), synchronous directory updates (D), append only (a), compressed (c), no dump (d), immutable (i), -data journalling (j), secure deletion (s), and undeletable (u). +data journalling (j), secure deletion (s), top of directory hierarchy +(T), no tail-merging (t), and undeletable (u). .SH OPTIONS .TP .B \-R @@ -85,6 +86,10 @@ When a file with the `S' attribute set is modified, the changes are written synchronously on the disk; this is equivalent to the `sync' mount option applied to a subset of the files. .PP +A directory with the 'T' attribute will be deemed to be the top of +directory hierarchies for the purposes of the Orlov block allocator +(which is used in newer kernels). +.PP A file with the 't' attribute will not have a partial block fragment at the of the file merged with other files (for those filesystems which support tail-merging). This is necessary for applications such as LILO diff --git a/misc/chattr.c b/misc/chattr.c index 467e6ba..4ff1564 100644 --- a/misc/chattr.c +++ b/misc/chattr.c @@ -98,6 +98,7 @@ static const struct flags_char flags_array[] = { { EXT2_SECRM_FL, 's' }, { EXT2_UNRM_FL, 'u' }, { EXT2_NOTAIL_FL, 't' }, + { EXT2_TOPDIR_FL, 'T' }, { 0, 0 } }; -- 1.8.3.1