aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dir.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2009-02-10 23:00:41 -0500
committerJoel Becker <joel.becker@oracle.com>2009-09-04 19:07:48 -0400
commit8cb471e8f82506937fe5e2e9fb0bf90f6b1f1170 (patch)
treee275a8f5db101a9990ba44931cfd116123112b11 /fs/ocfs2/dir.c
parent6e5a3d7538ad4e46a976862f593faf65750e37cc (diff)
ocfs2: Take the inode out of the metadata read/write paths.
We are really passing the inode into the ocfs2_read/write_blocks() functions to get at the metadata cache. This commit passes the cache directly into the metadata block functions, divorcing them from the inode. Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r--fs/ocfs2/dir.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index b358f3bf896d..273fb7648fce 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -564,7 +564,8 @@ static int ocfs2_read_dir_block_direct(struct inode *dir, u64 phys,
564 int ret; 564 int ret;
565 struct buffer_head *tmp = *bh; 565 struct buffer_head *tmp = *bh;
566 566
567 ret = ocfs2_read_block(dir, phys, &tmp, ocfs2_validate_dir_block); 567 ret = ocfs2_read_block(INODE_CACHE(dir), phys, &tmp,
568 ocfs2_validate_dir_block);
568 if (ret) { 569 if (ret) {
569 mlog_errno(ret); 570 mlog_errno(ret);
570 goto out; 571 goto out;
@@ -622,7 +623,8 @@ static int ocfs2_read_dx_root(struct inode *dir, struct ocfs2_dinode *di,
622 u64 blkno = le64_to_cpu(di->i_dx_root); 623 u64 blkno = le64_to_cpu(di->i_dx_root);
623 struct buffer_head *tmp = *dx_root_bh; 624 struct buffer_head *tmp = *dx_root_bh;
624 625
625 ret = ocfs2_read_block(dir, blkno, &tmp, ocfs2_validate_dx_root); 626 ret = ocfs2_read_block(INODE_CACHE(dir), blkno, &tmp,
627 ocfs2_validate_dx_root);
626 628
627 /* If ocfs2_read_block() got us a new bh, pass it up. */ 629 /* If ocfs2_read_block() got us a new bh, pass it up. */
628 if (!ret && !*dx_root_bh) 630 if (!ret && !*dx_root_bh)
@@ -662,7 +664,8 @@ static int ocfs2_read_dx_leaf(struct inode *dir, u64 blkno,
662 int ret; 664 int ret;
663 struct buffer_head *tmp = *dx_leaf_bh; 665 struct buffer_head *tmp = *dx_leaf_bh;
664 666
665 ret = ocfs2_read_block(dir, blkno, &tmp, ocfs2_validate_dx_leaf); 667 ret = ocfs2_read_block(INODE_CACHE(dir), blkno, &tmp,
668 ocfs2_validate_dx_leaf);
666 669
667 /* If ocfs2_read_block() got us a new bh, pass it up. */ 670 /* If ocfs2_read_block() got us a new bh, pass it up. */
668 if (!ret && !*dx_leaf_bh) 671 if (!ret && !*dx_leaf_bh)
@@ -680,7 +683,7 @@ static int ocfs2_read_dx_leaves(struct inode *dir, u64 start, int num,
680{ 683{
681 int ret; 684 int ret;
682 685
683 ret = ocfs2_read_blocks(dir, start, num, dx_leaf_bhs, 0, 686 ret = ocfs2_read_blocks(INODE_CACHE(dir), start, num, dx_leaf_bhs, 0,
684 ocfs2_validate_dx_leaf); 687 ocfs2_validate_dx_leaf);
685 if (ret) 688 if (ret)
686 mlog_errno(ret); 689 mlog_errno(ret);
@@ -2332,7 +2335,7 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
2332 goto bail; 2335 goto bail;
2333 } 2336 }
2334 2337
2335 ocfs2_set_new_buffer_uptodate(inode, new_bh); 2338 ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), new_bh);
2336 2339
2337 status = ocfs2_journal_access_db(handle, inode, new_bh, 2340 status = ocfs2_journal_access_db(handle, inode, new_bh,
2338 OCFS2_JOURNAL_ACCESS_CREATE); 2341 OCFS2_JOURNAL_ACCESS_CREATE);
@@ -2418,7 +2421,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb,
2418 ret = -EIO; 2421 ret = -EIO;
2419 goto out; 2422 goto out;
2420 } 2423 }
2421 ocfs2_set_new_buffer_uptodate(dir, dx_root_bh); 2424 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), dx_root_bh);
2422 2425
2423 ret = ocfs2_journal_access_dr(handle, dir, dx_root_bh, 2426 ret = ocfs2_journal_access_dr(handle, dir, dx_root_bh,
2424 OCFS2_JOURNAL_ACCESS_CREATE); 2427 OCFS2_JOURNAL_ACCESS_CREATE);
@@ -2495,7 +2498,7 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb,
2495 } 2498 }
2496 dx_leaves[i] = bh; 2499 dx_leaves[i] = bh;
2497 2500
2498 ocfs2_set_new_buffer_uptodate(dir, bh); 2501 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), bh);
2499 2502
2500 ret = ocfs2_journal_access_dl(handle, dir, bh, 2503 ret = ocfs2_journal_access_dl(handle, dir, bh,
2501 OCFS2_JOURNAL_ACCESS_CREATE); 2504 OCFS2_JOURNAL_ACCESS_CREATE);
@@ -3005,7 +3008,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
3005 goto out_commit; 3008 goto out_commit;
3006 } 3009 }
3007 3010
3008 ocfs2_set_new_buffer_uptodate(dir, dirdata_bh); 3011 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), dirdata_bh);
3009 3012
3010 ret = ocfs2_journal_access_db(handle, dir, dirdata_bh, 3013 ret = ocfs2_journal_access_db(handle, dir, dirdata_bh,
3011 OCFS2_JOURNAL_ACCESS_CREATE); 3014 OCFS2_JOURNAL_ACCESS_CREATE);
@@ -3387,7 +3390,7 @@ do_extend:
3387 goto bail; 3390 goto bail;
3388 } 3391 }
3389 3392
3390 ocfs2_set_new_buffer_uptodate(dir, new_bh); 3393 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), new_bh);
3391 3394
3392 status = ocfs2_journal_access_db(handle, dir, new_bh, 3395 status = ocfs2_journal_access_db(handle, dir, new_bh,
3393 OCFS2_JOURNAL_ACCESS_CREATE); 3396 OCFS2_JOURNAL_ACCESS_CREATE);
@@ -4565,7 +4568,7 @@ remove_index:
4565 goto out; 4568 goto out;
4566 } 4569 }
4567 4570
4568 ocfs2_remove_from_cache(dir, dx_root_bh); 4571 ocfs2_remove_from_cache(INODE_CACHE(dir), dx_root_bh);
4569out: 4572out:
4570 ocfs2_schedule_truncate_log_flush(osb, 1); 4573 ocfs2_schedule_truncate_log_flush(osb, 1);
4571 ocfs2_run_deallocs(osb, &dealloc); 4574 ocfs2_run_deallocs(osb, &dealloc);