diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-06-17 18:26:42 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-17 18:26:42 -0700 |
| commit | c12b9866ea52183ad5f2d87ca01c09b3a7508f5a (patch) | |
| tree | 14c7df6b50aed0a4c41a18110113b6442d9642de /include/linux | |
| parent | 78f2f471204076997e5360dd7ffe807b9eb1e5ce (diff) | |
[PATCH] ext3: concurrent block/inode allocation
From: Alex Tomas <bzzz@tmi.comex.ru>
This patch weans ext3 off lock_super()-based protection for the inode and
block allocators.
It's basically the same as the ext2 changes.
1) each group has own spinlock, which is used for group counter
modifications
2) sb->s_free_blocks_count isn't used any more. ext2_statfs() and
find_group_orlov() loop over groups to count free blocks
3) sb->s_free_blocks_count is recalculated at mount/umount/sync_super time
in order to check consistency and to avoid fsck warnings
4) reserved blocks are distributed over last groups
5) ext3_new_block() tries to use non-reserved blocks and if it fails then
tries to use reserved blocks
6) ext3_new_block() and ext3_free_blocks do not modify sb->s_free_blocks,
therefore they do not call mark_buffer_dirty() for superblock's
buffer_head. this should reduce I/O a bit
Also fix orlov allocator boundary case:
In the interests of SMP scalability the ext2 free blocks and free inodes
counters are "approximate". But there is a piece of code in the Orlov
allocator which fails due to boundary conditions on really small
filesystems.
Fix that up via a final allocation pass which simply uses first-fit for
allocatiopn of a directory inode.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ext3_fs.h | 2 | ||||
| -rw-r--r-- | include/linux/ext3_fs_sb.h | 10 | ||||
| -rw-r--r-- | include/linux/ext3_jbd.h | 6 |
3 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c2f36c9d8022..277bf8cac2a4 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -344,7 +344,9 @@ struct ext3_inode { #endif #define ext3_set_bit ext2_set_bit +#define ext3_set_bit_atomic ext2_set_bit_atomic #define ext3_clear_bit ext2_clear_bit +#define ext3_clear_bit_atomic ext2_clear_bit_atomic #define ext3_test_bit ext2_test_bit #define ext3_find_first_zero_bit ext2_find_first_zero_bit #define ext3_find_next_zero_bit ext2_find_next_zero_bit diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index 19bf2e132343..6d53e5cac0ac 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h @@ -21,6 +21,13 @@ #include <linux/wait.h> #endif +struct ext3_bg_info { + u8 bg_debts; + spinlock_t bg_balloc_lock; + spinlock_t bg_ialloc_lock; + unsigned long bg_reserved; +} ____cacheline_aligned_in_smp; + /* * third extended-fs super-block data in memory */ @@ -50,8 +57,7 @@ struct ext3_sb_info { u32 s_next_generation; u32 s_hash_seed[4]; int s_def_hash_version; - unsigned long s_dir_count; - u8 *s_debts; + struct ext3_bg_info *s_bgi; /* Journaling */ struct inode * s_journal_inode; diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index cb54b435a9db..60d7e40b609c 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h @@ -117,6 +117,12 @@ __ext3_journal_get_write_access(const char *where, } static inline void +ext3_journal_release_buffer(handle_t *handle, struct buffer_head *bh) +{ + journal_release_buffer(handle, bh); +} + +static inline void ext3_journal_forget(handle_t *handle, struct buffer_head *bh) { journal_forget(handle, bh); |
