diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2006-01-08 04:02:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:13:47 -0500 |
commit | 05eb0b51fb46430050d5873458612f53e0234f2e (patch) | |
tree | 88b9398079f53f29dff7533fb27487ae725983b1 /include/linux | |
parent | 268fc16e343b4f8e249468747db2e658da46a814 (diff) |
[PATCH] fat: support a truncate() for expanding size (generic_cont_expand)
This patch changes generic_cont_expand(), in order to share the code
with fatfs.
- Use vmtruncate() if ->prepare_write() returns a error.
Even if ->prepare_write() returns an error, it may already have added some
blocks. So, this truncates blocks outside of ->i_size by vmtruncate().
- Add generic_cont_expand_simple().
The generic_cont_expand_simple() assumes that ->prepare_write() can handle
the block boundary. With this, we don't need to care the extra byte.
And for expanding a file size by truncate(), fatfs uses the
added generic_cont_expand_simple().
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/buffer_head.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 1db061bb6b08..9f159baf153f 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -197,7 +197,8 @@ int block_read_full_page(struct page*, get_block_t*); | |||
197 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | 197 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); |
198 | int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, | 198 | int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, |
199 | loff_t *); | 199 | loff_t *); |
200 | int generic_cont_expand(struct inode *inode, loff_t size) ; | 200 | int generic_cont_expand(struct inode *inode, loff_t size); |
201 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | ||
201 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 202 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
202 | int block_sync_page(struct page *); | 203 | int block_sync_page(struct page *); |
203 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 204 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |