diff options
Diffstat (limited to 'fs/block_dev.c')
| -rw-r--r-- | fs/block_dev.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 6339a30879b7..379a446e243e 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -378,14 +378,26 @@ static int blkdev_readpage(struct file * file, struct page * page) | |||
| 378 | return block_read_full_page(page, blkdev_get_block); | 378 | return block_read_full_page(page, blkdev_get_block); |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | static int blkdev_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) | 381 | static int blkdev_write_begin(struct file *file, struct address_space *mapping, |
| 382 | loff_t pos, unsigned len, unsigned flags, | ||
| 383 | struct page **pagep, void **fsdata) | ||
| 382 | { | 384 | { |
| 383 | return block_prepare_write(page, from, to, blkdev_get_block); | 385 | *pagep = NULL; |
| 386 | return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | ||
| 387 | blkdev_get_block); | ||
| 384 | } | 388 | } |
| 385 | 389 | ||
| 386 | static int blkdev_commit_write(struct file *file, struct page *page, unsigned from, unsigned to) | 390 | static int blkdev_write_end(struct file *file, struct address_space *mapping, |
| 391 | loff_t pos, unsigned len, unsigned copied, | ||
| 392 | struct page *page, void *fsdata) | ||
| 387 | { | 393 | { |
| 388 | return block_commit_write(page, from, to); | 394 | int ret; |
| 395 | ret = block_write_end(file, mapping, pos, len, copied, page, fsdata); | ||
| 396 | |||
| 397 | unlock_page(page); | ||
| 398 | page_cache_release(page); | ||
| 399 | |||
| 400 | return ret; | ||
| 389 | } | 401 | } |
| 390 | 402 | ||
| 391 | /* | 403 | /* |
| @@ -1327,8 +1339,8 @@ const struct address_space_operations def_blk_aops = { | |||
| 1327 | .readpage = blkdev_readpage, | 1339 | .readpage = blkdev_readpage, |
| 1328 | .writepage = blkdev_writepage, | 1340 | .writepage = blkdev_writepage, |
| 1329 | .sync_page = block_sync_page, | 1341 | .sync_page = block_sync_page, |
| 1330 | .prepare_write = blkdev_prepare_write, | 1342 | .write_begin = blkdev_write_begin, |
| 1331 | .commit_write = blkdev_commit_write, | 1343 | .write_end = blkdev_write_end, |
| 1332 | .writepages = generic_writepages, | 1344 | .writepages = generic_writepages, |
| 1333 | .direct_IO = blkdev_direct_IO, | 1345 | .direct_IO = blkdev_direct_IO, |
| 1334 | }; | 1346 | }; |
