Whamcloud - gitweb
Applied Andrew Morton's patch to support the dirsync option.
authorTheodore Ts'o <tytso@mit.edu>
Sat, 15 Jun 2002 22:58:39 +0000 (18:58 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 15 Jun 2002 22:58:39 +0000 (18:58 -0400)
lib/e2p/ChangeLog
lib/e2p/pf.c
lib/ext2fs/ChangeLog
lib/ext2fs/ext2_fs.h
misc/ChangeLog
misc/chattr.1.in
misc/chattr.c

index 905e2b1..9df2ee4 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-15  Theodore Ts'o  <tytso@mit.edu>
+
+       * pf.c: Changed "compressed dirty flag" from 'D' to 'Z'.  Add
+               dirsync flag and assign it 'D'.
+
 2002-03-08  Theodore Tso  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.27
index d9aab29..a540c73 100644 (file)
@@ -28,13 +28,14 @@ static struct flags_name flags_array[] = {
        { EXT2_SECRM_FL, "s", "Secure_Deletion" },
        { EXT2_UNRM_FL, "u" , "Undelete" },
        { EXT2_SYNC_FL, "S", "Synchronous_Updates" },
+       { EXT2_DIRSYNC_FL, "D", "Synchronous_Directory_Updates" },
        { EXT2_IMMUTABLE_FL, "i", "Immutable" },
        { EXT2_APPEND_FL, "a", "Append_Only" },
        { EXT2_NODUMP_FL, "d", "No_Dump" },
        { EXT2_NOATIME_FL, "A", "No_Atime" },
        { EXT2_COMPR_FL, "c", "Compression_Requested" },
        { EXT2_COMPRBLK_FL, "B", "Compressed_File" },
-       { EXT2_DIRTY_FL, "D", "Compressed_Dirty_File" },
+       { EXT2_DIRTY_FL, "Z", "Compressed_Dirty_File" },
        { EXT2_NOCOMPR_FL, "X", "Compression_Raw_Access" },
        { EXT2_ECOMPR_FL, "E", "Compression_Error" },
        { EXT3_JOURNAL_DATA_FL, "j", "Journaled_Data" },
index 0b31f83..b84275a 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-15  Theodore Ts'o  <tytso@mit.edu>
+
+       * ext2_fs.h (EXT2_DIRSYNC_FL): Add new file.
+
 2002-06-09  Andreas Dilger <adilger@clusterfs.com>
 
        * ext2_fs.h: Add macros for maximum block/inode counts:
index 766afd7..c47b59b 100644 (file)
@@ -225,9 +225,10 @@ struct ext2_dx_countlimit {
 #define EXT2_IMAGIC_FL                 0x00002000
 #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_RESERVED_FL               0x80000000 /* reserved for ext2 lib */
 
-#define EXT2_FL_USER_VISIBLE           0x0000DFFF /* User visible flags */
+#define EXT2_FL_USER_VISIBLE           0x0001DFFF /* User visible flags */
 #define EXT2_FL_USER_MODIFIABLE                0x000080FF /* User modifiable flags */
 
 /*
index 0a972d0..e2dc6ad 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-15  Theodore Ts'o  <tytso@mit.edu>
+
+       * chattr.c: Applied patch from Andrew to support the dirsync flag.
+
 2002-05-22  Andreas Dilger <adilger@clusterfs.com>
 
        * mke2fs.c (set_fs_defaults): make the default inode ratio at most
index 82f054b..be64575 100644 (file)
@@ -19,16 +19,16 @@ 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 +-=[ASacdistu].
+The format of a symbolic mode is +-=[ASacDdistu].
 .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 `ASacdijsu' select the new attributes for the files: 
-don't update atime (A), synchronous updates (S), append only (a), 
-compressed (c), no dump (d), immutable (i), data journalling (j),
-secure deletion (s), and undeletable (u).
+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).
 .SH OPTIONS
 .TP
 .B \-R
@@ -74,6 +74,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
+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 '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 
@@ -92,6 +96,8 @@ by the kernel filesystem code.    These attributes will be implemented
 in a future ext2 fs version.
 .PP
 The `j' option is only useful if the filesystem is mounted as ext3.
+.PP
+The `D' option is only useful on Linux kernel 2.5.19 and later.
 .SH AVAILABILITY
 .B chattr
 is part of the e2fsprogs package and is available from
index 96977e9..467e6ba 100644 (file)
@@ -78,7 +78,7 @@ static void fatal_error(const char * fmt_string, int errcode)
        exit (errcode);
 }
 
-#define usage() fatal_error(_("usage: %s [-RV] [-+=AacdijsSu] [-v version] files...\n"), \
+#define usage() fatal_error(_("usage: %s [-RV] [-+=AacDdijsSu] [-v version] files...\n"), \
                             1)
 
 struct flags_char {
@@ -89,6 +89,7 @@ struct flags_char {
 static const struct flags_char flags_array[] = {
        { EXT2_NOATIME_FL, 'A' },
        { EXT2_SYNC_FL, 'S' },
+       { EXT2_DIRSYNC_FL, 'D' },
        { EXT2_APPEND_FL, 'a' },
        { EXT2_COMPR_FL, 'c' },
        { EXT2_NODUMP_FL, 'd' },
@@ -218,6 +219,8 @@ static void change_attributes (const char * name)
                                print_flags (stdout, flags, 0);
                                printf ("\n");
                        }
+                       if (!S_ISDIR(st.st_mode))
+                               flags &= ~EXT2_DIRSYNC_FL;
                        if (fsetflags (name, flags) == -1)
                                com_err (program_name, errno,
                                         _("while setting flags on %s"), name);