diff options
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r-- | fs/ocfs2/journal.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 825cb0ae1b4c..5a8a90d1c787 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -649,29 +649,20 @@ bail: | |||
649 | static int ocfs2_force_read_journal(struct inode *inode) | 649 | static int ocfs2_force_read_journal(struct inode *inode) |
650 | { | 650 | { |
651 | int status = 0; | 651 | int status = 0; |
652 | int i, p_blocks; | 652 | int i; |
653 | u64 v_blkno, p_blkno; | 653 | u64 v_blkno, p_blkno, p_blocks, num_blocks; |
654 | #define CONCURRENT_JOURNAL_FILL 32 | 654 | #define CONCURRENT_JOURNAL_FILL 32ULL |
655 | struct buffer_head *bhs[CONCURRENT_JOURNAL_FILL]; | 655 | struct buffer_head *bhs[CONCURRENT_JOURNAL_FILL]; |
656 | 656 | ||
657 | mlog_entry_void(); | 657 | mlog_entry_void(); |
658 | 658 | ||
659 | BUG_ON(inode->i_blocks != | ||
660 | ocfs2_align_bytes_to_sectors(i_size_read(inode))); | ||
661 | |||
662 | memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL); | 659 | memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL); |
663 | 660 | ||
664 | mlog(0, "Force reading %llu blocks\n", | 661 | num_blocks = ocfs2_blocks_for_bytes(inode->i_sb, inode->i_size); |
665 | (unsigned long long)(inode->i_blocks >> | ||
666 | (inode->i_sb->s_blocksize_bits - 9))); | ||
667 | |||
668 | v_blkno = 0; | 662 | v_blkno = 0; |
669 | while (v_blkno < | 663 | while (v_blkno < num_blocks) { |
670 | (inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9))) { | ||
671 | |||
672 | status = ocfs2_extent_map_get_blocks(inode, v_blkno, | 664 | status = ocfs2_extent_map_get_blocks(inode, v_blkno, |
673 | 1, &p_blkno, | 665 | &p_blkno, &p_blocks, NULL); |
674 | &p_blocks); | ||
675 | if (status < 0) { | 666 | if (status < 0) { |
676 | mlog_errno(status); | 667 | mlog_errno(status); |
677 | goto bail; | 668 | goto bail; |
@@ -1306,7 +1297,7 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb, | |||
1306 | continue; | 1297 | continue; |
1307 | 1298 | ||
1308 | iter = ocfs2_iget(osb, le64_to_cpu(de->inode), | 1299 | iter = ocfs2_iget(osb, le64_to_cpu(de->inode), |
1309 | OCFS2_FI_FLAG_NOLOCK); | 1300 | OCFS2_FI_FLAG_ORPHAN_RECOVERY); |
1310 | if (IS_ERR(iter)) | 1301 | if (IS_ERR(iter)) |
1311 | continue; | 1302 | continue; |
1312 | 1303 | ||
@@ -1418,7 +1409,6 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, | |||
1418 | /* Set the proper information to get us going into | 1409 | /* Set the proper information to get us going into |
1419 | * ocfs2_delete_inode. */ | 1410 | * ocfs2_delete_inode. */ |
1420 | oi->ip_flags |= OCFS2_INODE_MAYBE_ORPHANED; | 1411 | oi->ip_flags |= OCFS2_INODE_MAYBE_ORPHANED; |
1421 | oi->ip_orphaned_slot = slot; | ||
1422 | spin_unlock(&oi->ip_lock); | 1412 | spin_unlock(&oi->ip_lock); |
1423 | 1413 | ||
1424 | iput(inode); | 1414 | iput(inode); |