diff options
| author | Andrew Morton <akpm@zip.com.au> | 2002-05-27 05:13:29 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-05-27 05:13:29 -0700 |
| commit | bb772c58ab8542b34162f356faac2ed18fb7afe4 (patch) | |
| tree | cba428387bc8268d704ee4fea4fff9f8418e2c2c /include/linux/ext2_fs.h | |
| parent | 7d608fac351b06ae0192bba9e116a965c2f35c5d (diff) | |
[PATCH] dirsync
An implementation of directory-synchronous mounts.
I sent this out some months ago and it didn't generate a lot of
interest. Later we had one of the usual cheery exchanges with Wietse
Venema (postfix development) and he agreed that directory synchronous
mounts were something that he could use, and that there was benefit in
implementing them in Linux. If you choose to apply this I'll push the
2.4 patch.
Patch against e2fsprogs-1.26:
http://www.zip.com.au/~akpm/linux/dirsync/e2fsprogs-1.26.patch
Patch against util-linux-2.11n:
http://www.zip.com.au/~akpm/linux/dirsync/util-linux-2.11n.patch
The kernel patch includes implementations for ext2 and ext3. It's
pretty simple.
- When dirsync is in operation against a directory, the following operations
are synchronous within that directory: create, link, unlink, symlink,
mkdir, rmdir, mknod, rename (synchronous if either the source or dest
directory is dirsync).
- dirsync is a subset of sync. So `mount -o sync' or `chattr +S'
give you everything which `mount -o dirsync' or `chattr +D' gives,
plus synchronous file writes.
- ext2's inode.i_attr_flags is unused, and is removed.
- mount /dev/foo /mnt/bar -o dirsync works as expected.
- An ext2 or ext3 directory tree can be set dirsync with `chattr +D -R'.
- dirsync is maintained as new directories are created under
a `chattr +D' directory. Like `chattr +S'.
- Other filesystems can trivially be taught about dirsync. It's just
a matter of replacing `IS_SYNC(inode)' with `IS_DIRSYNC(inode)' in
the directory update functions. IS_SYNC will still be honoured when
IS_DIRSYNC is used.
- Non-directory files do not have their dirsync flag propagated. So
an S_ISREG file which is created inside a dirsync directory will not
have its dirsync bit set. chattr needs to do this as well.
- There was a bit of version skew between e2fsprogs' idea of the
inode flags and the kernel's. That is sorted out here.
- `lsattr' shows the dirsync flag as "D". The letter "D" was
previously being used for Compressed_Dirty_File. I changed
Compressed_Dirty_File to use "Z". Is that OK?
The mount(2) manpage needs to be taught about MS_DIRSYNC.
Diffstat (limited to 'include/linux/ext2_fs.h')
| -rw-r--r-- | include/linux/ext2_fs.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 527c8f0bf0db..e84468874422 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -211,10 +211,15 @@ struct ext2_group_desc #define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ /* End compression flags --- maybe not all used */ #define EXT2_BTREE_FL 0x00001000 /* btree format dir */ +#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ +#define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ +#define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ +#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ +#define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ -#define EXT2_FL_USER_VISIBLE 0x00001FFF /* User visible flags */ -#define EXT2_FL_USER_MODIFIABLE 0x000000FF /* User modifiable flags */ +#define EXT2_FL_USER_VISIBLE 0x00011FFF /* User visible flags */ +#define EXT2_FL_USER_MODIFIABLE 0x000100FF /* User modifiable flags */ /* * ioctl commands |
