mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
vfs: add hooks for ext4's delayed allocation support
Export mpage_bio_submit() and __mpage_writepage() for the benefit of ext4's delayed allocation support. Also change __block_write_full_page so that if buffers that have the BH_Delay flag set it will call get_block() to get the physical block allocated, just as in the !BH_Mapped case. Signed-off-by: Alex Tomas <alex@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
87c89c232c
commit
29a814d2ee
3 changed files with 20 additions and 11 deletions
|
@ -1691,11 +1691,13 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
|
|||
*/
|
||||
clear_buffer_dirty(bh);
|
||||
set_buffer_uptodate(bh);
|
||||
} else if (!buffer_mapped(bh) && buffer_dirty(bh)) {
|
||||
} else if ((!buffer_mapped(bh) || buffer_delay(bh)) &&
|
||||
buffer_dirty(bh)) {
|
||||
WARN_ON(bh->b_size != blocksize);
|
||||
err = get_block(inode, block, bh, 1);
|
||||
if (err)
|
||||
goto recover;
|
||||
clear_buffer_delay(bh);
|
||||
if (buffer_new(bh)) {
|
||||
/* blockdev mappings never come here */
|
||||
clear_buffer_new(bh);
|
||||
|
@ -1774,7 +1776,8 @@ recover:
|
|||
bh = head;
|
||||
/* Recovery: lock and submit the mapped buffers */
|
||||
do {
|
||||
if (buffer_mapped(bh) && buffer_dirty(bh)) {
|
||||
if (buffer_mapped(bh) && buffer_dirty(bh) &&
|
||||
!buffer_delay(bh)) {
|
||||
lock_buffer(bh);
|
||||
mark_buffer_async_write(bh);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue