commit 5b9aaae742a79ef6001e58e5031b5f6ec03fe1ad Author: Eric Sandeen Date: Fri Jul 4 23:02:59 2014 -0400 e2fsprogs: reorder flags in chattr(1) The flags described in chattr usage() and the chattr(1) manpage were in semi-random order, which makes it hard to ascertain which flags might be missing or undocumented, and to locate flags within the manpage. Re-order the list of flags in alphanumeric order, and do the same for the flag descriptions in the body of the manpage. There should be no content changes here, just reordering for consistency. Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o Reviewed-by: Andreas Dilger diff --git a/misc/chattr.1.in b/misc/chattr.1.in index 2a3640c..ce426e8 100644 --- a/misc/chattr.1.in +++ b/misc/chattr.1.in @@ -19,24 +19,36 @@ chattr \- change file attributes on a Linux file system .B chattr changes the file attributes on a Linux file system. .PP -The format of a symbolic mode is +-=[acdeijstuACDST]. +The format of a symbolic mode is +-=[aAcCdDeijsStTu]. .PP The operator `+' causes the selected attributes to be added to the existing attributes of the files; `-' causes them to be removed; and `=' causes them to be the only attributes that the files have. .PP -The letters `acdeijstuACDST' select the new attributes for the files: -append only (a), compressed (c), no dump (d), extent format (e), immutable (i), -data journalling (j), secure deletion (s), no tail-merging (t), -undeletable (u), no atime updates (A), no copy on write (C), -synchronous directory updates (D), synchronous updates (S), -and top of directory hierarchy (T). +The letters `aAcCdDeijsStTu' select the new attributes for the files: +append only (a), +no atime updates (A), +compressed (c), +no copy on write (C), +no dump (d), +synchronous directory updates (D), +extent format (e), +immutable (i), +data journalling (j), +secure deletion (s), +synchronous updates (S), +no tail-merging (t), +top of directory hierarchy (T), +and undeletable (u). .PP The following attributes are read-only, and may be listed by .BR lsattr (1) -but not modified by chattr: huge file (h), compression error (E), -indexed directory (I), compression raw access (X), and compressed dirty -file (Z). +but not modified by chattr: +compression error (E), +huge file (h), +indexed directory (I), +compression raw access (X), +and compressed dirty file (Z). .SH OPTIONS .TP .B \-R @@ -51,14 +63,14 @@ Suppress most error messages. .BI \-v " version" Set the file's version/generation number. .SH ATTRIBUTES -When a file with the 'A' attribute set is accessed, its atime record is -not modified. This avoids a certain amount of disk I/O for laptop -systems. -.PP A file with the `a' attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute. .PP +When a file with the 'A' attribute set is accessed, its atime record is +not modified. This avoids a certain amount of disk I/O for laptop +systems. +.PP A file with the `c' attribute set is automatically compressed on the disk by the kernel. A read from this file returns uncompressed data. A write to this file compresses data before storing them on the disk. Note: please @@ -74,27 +86,21 @@ be fully stable. If the 'C' flag is set on a directory, it will have no effect on the directory, but new files created in that directory will the No_COW attribute.) .PP -When a directory with the `D' attribute set is modified, -the changes are written synchronously on the disk; this is equivalent to -the `dirsync' mount option applied to a subset of the files. -.PP A file with the `d' attribute set is not candidate for backup when the .BR dump (8) program is run. .PP -The 'E' attribute is used by the experimental compression patches to -indicate that a compressed file has a compression error. It may not be -set or reset using -.BR chattr (1), -although it can be displayed by -.BR lsattr (1). +When a directory with the `D' attribute set is modified, +the changes are written synchronously on the disk; this is equivalent to +the `dirsync' mount option applied to a subset of the files. .PP The 'e' attribute indicates that the file is using extents for mapping the blocks on disk. It may not be removed using .BR chattr (1). .PP -The 'I' attribute is used by the htree code to indicate that a directory -is being indexed using hashed trees. It may not be set or reset using +The 'E' attribute is used by the experimental compression patches to +indicate that a compressed file has a compression error. It may not be +set or reset using .BR chattr (1), although it can be displayed by .BR lsattr (1). @@ -111,6 +117,12 @@ renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute. .PP +The 'I' attribute is used by the htree code to indicate that a directory +is being indexed using hashed trees. It may not be set or reset using +.BR chattr (1), +although it can be displayed by +.BR lsattr (1). +.PP A file with the `j' attribute has all of its data written to the ext3 or ext4 journal before being written to the file itself, if the filesystem is mounted with the "data=ordered" or "data=writeback" options. When the @@ -127,6 +139,13 @@ 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 file with the 't' attribute will not have a partial block fragment at +the end of the file merged with other files (for those filesystems which +support tail-merging). This is necessary for applications such as LILO +which read the filesystem directly, and which don't understand tail-merged +files. Note: As of this writing, the ext2 or ext3 filesystems do not +(yet, except in very experimental patches) support tail-merging. +.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. This is a hint to the block allocator used by ext3 and ext4 that the @@ -137,13 +156,6 @@ and /home/mary are placed into separate block groups. For directories where this attribute is not set, the Orlov block allocator will try to group subdirectories closer together where possible. .PP -A file with the 't' attribute will not have a partial block fragment at -the end of the file merged with other files (for those filesystems which -support tail-merging). This is necessary for applications such as LILO -which read the filesystem directly, and which don't understand tail-merged -files. Note: As of this writing, the ext2 or ext3 filesystems do not -(yet, except in very experimental patches) support tail-merging. -.PP When a file with the `u' attribute set is deleted, its contents are saved. This allows the user to ask for its undeletion. Note: please make sure to read the bugs and limitations section at the end of this diff --git a/misc/chattr.c b/misc/chattr.c index 39a6016..d5a6a61 100644 --- a/misc/chattr.c +++ b/misc/chattr.c @@ -83,7 +83,7 @@ static unsigned long sf; static void usage(void) { fprintf(stderr, - _("Usage: %s [-RVf] [-+=AaCcDdeijsSu] [-v version] files...\n"), + _("Usage: %s [-RVf] [-+=aAcCdDeijsSu] [-v version] files...\n"), program_name); exit(1); }