aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/inode.c46
-rw-r--r--fs/ext3/super.c10
2 files changed, 9 insertions, 47 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index ea5888688f94..0d5fa73b18dc 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -844,12 +844,6 @@ get_block:
844 return ret; 844 return ret;
845} 845}
846 846
847static int ext3_writepages_get_block(struct inode *inode, sector_t iblock,
848 struct buffer_head *bh, int create)
849{
850 return ext3_direct_io_get_blocks(inode, iblock, 1, bh, create);
851}
852
853/* 847/*
854 * `handle' can be NULL if create is zero 848 * `handle' can be NULL if create is zero
855 */ 849 */
@@ -1323,45 +1317,6 @@ out_fail:
1323 return ret; 1317 return ret;
1324} 1318}
1325 1319
1326static int
1327ext3_writeback_writepage_helper(struct page *page,
1328 struct writeback_control *wbc)
1329{
1330 return block_write_full_page(page, ext3_get_block, wbc);
1331}
1332
1333static int
1334ext3_writeback_writepages(struct address_space *mapping,
1335 struct writeback_control *wbc)
1336{
1337 struct inode *inode = mapping->host;
1338 handle_t *handle = NULL;
1339 int err, ret = 0;
1340
1341 if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
1342 return ret;
1343
1344 handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode));
1345 if (IS_ERR(handle)) {
1346 ret = PTR_ERR(handle);
1347 return ret;
1348 }
1349
1350 ret = __mpage_writepages(mapping, wbc, ext3_writepages_get_block,
1351 ext3_writeback_writepage_helper);
1352
1353 /*
1354 * Need to reaquire the handle since ext3_writepages_get_block()
1355 * can restart the handle
1356 */
1357 handle = journal_current_handle();
1358
1359 err = ext3_journal_stop(handle);
1360 if (!ret)
1361 ret = err;
1362 return ret;
1363}
1364
1365static int ext3_writeback_writepage(struct page *page, 1320static int ext3_writeback_writepage(struct page *page,
1366 struct writeback_control *wbc) 1321 struct writeback_control *wbc)
1367{ 1322{
@@ -1599,7 +1554,6 @@ static struct address_space_operations ext3_writeback_aops = {
1599 .readpage = ext3_readpage, 1554 .readpage = ext3_readpage,
1600 .readpages = ext3_readpages, 1555 .readpages = ext3_readpages,
1601 .writepage = ext3_writeback_writepage, 1556 .writepage = ext3_writeback_writepage,
1602 .writepages = ext3_writeback_writepages,
1603 .sync_page = block_sync_page, 1557 .sync_page = block_sync_page,
1604 .prepare_write = ext3_prepare_write, 1558 .prepare_write = ext3_prepare_write,
1605 .commit_write = ext3_writeback_commit_write, 1559 .commit_write = ext3_writeback_commit_write,
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 545b440a2d2f..981ccb233ef5 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -225,8 +225,16 @@ void __ext3_std_error (struct super_block * sb, const char * function,
225 int errno) 225 int errno)
226{ 226{
227 char nbuf[16]; 227 char nbuf[16];
228 const char *errstr = ext3_decode_error(sb, errno, nbuf); 228 const char *errstr;
229
230 /* Special case: if the error is EROFS, and we're not already
231 * inside a transaction, then there's really no point in logging
232 * an error. */
233 if (errno == -EROFS && journal_current_handle() == NULL &&
234 (sb->s_flags & MS_RDONLY))
235 return;
229 236
237 errstr = ext3_decode_error(sb, errno, nbuf);
230 printk (KERN_CRIT "EXT3-fs error (device %s) in %s: %s\n", 238 printk (KERN_CRIT "EXT3-fs error (device %s) in %s: %s\n",
231 sb->s_id, function, errstr); 239 sb->s_id, function, errstr);
232 240