summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTheodore Y. Ts'o <tytso@mit.edu>2002-11-01 20:57:39 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-11-01 20:57:39 -0800
commit4be68d9c17a624c7dd096b6672cda97cccd90f98 (patch)
treebce702d263aac7f625c0b39078e7586d1aae2634 /include
parenteb74a93e56f1d44041f3633d9306ea9c5c0051a8 (diff)
[PATCH] Fixup Orlov block allocator for ext2
I finally had time to look at the Orlov patches, and found a memory leak; sbi->s_debts wasn't getting freed when the filesystem was getting unmounted, or in the error path. This patch also makes the following cleanups/changes: 1) Use sbi->s_debts instead of sbi->debts --- all other fields in struct ext2_sb_info are prefixed by "s_", so this makes things consistent. 2) Add support for a new inode flag, EXT2_TOPDIR_FL, which tells tells the Orlov allocator to treat that directory as the top of directory hierarchies, so that new subdirectories created in that directory should be spread apart. System administrators should set this flag on directories like /usr/src, /usr/home, etc. 3) Add a mount-time flag, -o oldalloc, which forces the use of the old inode (pre-Orlov) allocator. This makes it easier to do comparison benchmarks, and in case people want to use the old algorithm.
Diffstat (limited to 'include')
-rw-r--r--include/linux/ext2_fs.h6
-rw-r--r--include/linux/ext2_fs_sb.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 7e34cc751800..0d008cfb99a8 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -191,10 +191,11 @@ struct ext2_group_desc
#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_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
-#define EXT2_FL_USER_VISIBLE 0x00011FFF /* User visible flags */
-#define EXT2_FL_USER_MODIFIABLE 0x000100FF /* User modifiable flags */
+#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
+#define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
/*
* ioctl commands
@@ -300,6 +301,7 @@ struct ext2_inode {
* Mount flags
*/
#define EXT2_MOUNT_CHECK 0x0001 /* Do mount-time checks */
+#define EXT2_MOUNT_OLDALLOC 0x0002 /* Don't use the new Orlov allocator */
#define EXT2_MOUNT_GRPID 0x0004 /* Create files with directory's group */
#define EXT2_MOUNT_DEBUG 0x0008 /* Some debugging messages */
#define EXT2_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index 434924a64fe4..3c07d4ecf898 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -44,7 +44,7 @@ struct ext2_sb_info {
int s_first_ino;
u32 s_next_generation;
unsigned long s_dir_count;
- u8 *debts;
+ u8 *s_debts;
};
#endif /* _LINUX_EXT2_FS_SB */