Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24591
b: refs/heads/master
c: 3c674e7
h: refs/heads/master
i:
  24589: 00cd98e
  24587: f85a531
  24583: fafb528
  24575: 9c716ca
v: v3
  • Loading branch information
Nathan Scott committed Mar 28, 2006
1 parent bcf0246 commit 9ef0676
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0edd5962bd83d319aaa50b39580dc30299a7fe3
refs/heads/master: 3c674e74238cb2484169e3f84f687c66887086b6
7 changes: 4 additions & 3 deletions trunk/fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,6 @@ static int get_more_blocks(struct dio *dio)
*/
ret = dio->page_errors;
if (ret == 0) {
map_bh->b_state = 0;
map_bh->b_size = 0;
BUG_ON(dio->block_in_file >= dio->final_block_in_request);
fs_startblk = dio->block_in_file >> dio->blkfactor;
dio_count = dio->final_block_in_request - dio->block_in_file;
Expand All @@ -534,6 +532,9 @@ static int get_more_blocks(struct dio *dio)
if (dio_count & blkmask)
fs_count++;

map_bh->b_state = 0;
map_bh->b_size = fs_count << dio->inode->i_blkbits;

create = dio->rw == WRITE;
if (dio->lock_type == DIO_LOCKING) {
if (dio->block_in_file < (i_size_read(dio->inode) >>
Expand All @@ -542,13 +543,13 @@ static int get_more_blocks(struct dio *dio)
} else if (dio->lock_type == DIO_NO_LOCKING) {
create = 0;
}

/*
* For writes inside i_size we forbid block creations: only
* overwrites are permitted. We fall back to buffered writes
* at a higher level for inside-i_size block-instantiating
* writes.
*/
map_bh->b_size = fs_count << dio->blkbits;
ret = (*dio->get_block)(dio->inode, fs_startblk,
map_bh, create);
}
Expand Down

0 comments on commit 9ef0676

Please sign in to comment.