diff options
author | Evgeniy Dushistov <dushistov@mail.ru> | 2006-06-25 08:47:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:01 -0400 |
commit | 6ef4d6bf86a82965896eaa1a189177239ec2bbab (patch) | |
tree | 3217c5601d8cf6701f8783ec776aa96d0dd75d4a /include | |
parent | c9a27b5dca52bbd0955e065e49e56eb313d02c34 (diff) |
[PATCH] ufs: change block number on the fly
First of all some necessary notes about UFS by it self: To avoid waste of disk
space the tail of file consists not from blocks (which is ordinary big enough,
16K usually), it consists from fragments(which is ordinary 2K). When file is
growing its tail occupy 1 fragment, 2 fragments... At some stage decision to
allocate whole block is made and all fragments are moved to one block.
How this situation was handled before:
ufs_prepare_write
->block_prepare_write
->ufs_getfrag_block
->...
->ufs_new_fragments:
bh = sb_bread
bh->b_blocknr = result + i;
mark_buffer_dirty (bh);
This is wrong solution, because:
- it didn't take into consideration that there is another cache: "inode page
cache"
- because of sb_getblk uses not b_blocknr, (it uses page->index) to find
certain block, this breaks sb_getblk.
How this situation is handled now: we go though all "page inode cache", if
there are no such page in cache we load it into cache, and change b_blocknr.
Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ufs_fs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 86b5b4271b5a..ed5053f5cd71 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -875,7 +875,8 @@ struct ufs_super_block_third { | |||
875 | /* balloc.c */ | 875 | /* balloc.c */ |
876 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); | 876 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); |
877 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); | 877 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); |
878 | extern unsigned ufs_new_fragments (struct inode *, __fs32 *, unsigned, unsigned, unsigned, int *); | 878 | extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned, |
879 | unsigned, int *, struct page *); | ||
879 | 880 | ||
880 | /* cylinder.c */ | 881 | /* cylinder.c */ |
881 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); | 882 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); |