diff options
author | Joel Becker <joel.becker@oracle.com> | 2009-02-10 23:00:41 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-04 19:07:48 -0400 |
commit | 8cb471e8f82506937fe5e2e9fb0bf90f6b1f1170 (patch) | |
tree | e275a8f5db101a9990ba44931cfd116123112b11 /fs/ocfs2/inode.c | |
parent | 6e5a3d7538ad4e46a976862f593faf65750e37cc (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/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 36bb588f8fcb..1c9713cceb39 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -662,7 +662,7 @@ static int ocfs2_remove_inode(struct inode *inode, | |||
662 | goto bail_commit; | 662 | goto bail_commit; |
663 | } | 663 | } |
664 | 664 | ||
665 | ocfs2_remove_from_cache(inode, di_bh); | 665 | ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); |
666 | vfs_dq_free_inode(inode); | 666 | vfs_dq_free_inode(inode); |
667 | 667 | ||
668 | status = ocfs2_free_dinode(handle, inode_alloc_inode, | 668 | status = ocfs2_free_dinode(handle, inode_alloc_inode, |
@@ -1112,14 +1112,14 @@ void ocfs2_clear_inode(struct inode *inode) | |||
1112 | ocfs2_lock_res_free(&oi->ip_inode_lockres); | 1112 | ocfs2_lock_res_free(&oi->ip_inode_lockres); |
1113 | ocfs2_lock_res_free(&oi->ip_open_lockres); | 1113 | ocfs2_lock_res_free(&oi->ip_open_lockres); |
1114 | 1114 | ||
1115 | ocfs2_metadata_cache_purge(inode); | 1115 | ocfs2_metadata_cache_purge(INODE_CACHE(inode)); |
1116 | 1116 | ||
1117 | mlog_bug_on_msg(oi->ip_metadata_cache.ci_num_cached, | 1117 | mlog_bug_on_msg(INODE_CACHE(inode)->ci_num_cached, |
1118 | "Clear inode of %llu, inode has %u cache items\n", | 1118 | "Clear inode of %llu, inode has %u cache items\n", |
1119 | (unsigned long long)oi->ip_blkno, oi->ip_metadata_cache.ci_num_cached); | 1119 | (unsigned long long)oi->ip_blkno, |
1120 | INODE_CACHE(inode)->ci_num_cached); | ||
1120 | 1121 | ||
1121 | mlog_bug_on_msg(!(oi->ip_metadata_cache.ci_flags & | 1122 | mlog_bug_on_msg(!(INODE_CACHE(inode)->ci_flags & OCFS2_CACHE_FL_INLINE), |
1122 | OCFS2_CACHE_FL_INLINE), | ||
1123 | "Clear inode of %llu, inode has a bad flag\n", | 1123 | "Clear inode of %llu, inode has a bad flag\n", |
1124 | (unsigned long long)oi->ip_blkno); | 1124 | (unsigned long long)oi->ip_blkno); |
1125 | 1125 | ||
@@ -1381,8 +1381,8 @@ int ocfs2_read_inode_block_full(struct inode *inode, struct buffer_head **bh, | |||
1381 | int rc; | 1381 | int rc; |
1382 | struct buffer_head *tmp = *bh; | 1382 | struct buffer_head *tmp = *bh; |
1383 | 1383 | ||
1384 | rc = ocfs2_read_blocks(inode, OCFS2_I(inode)->ip_blkno, 1, &tmp, | 1384 | rc = ocfs2_read_blocks(INODE_CACHE(inode), OCFS2_I(inode)->ip_blkno, |
1385 | flags, ocfs2_validate_inode_block); | 1385 | 1, &tmp, flags, ocfs2_validate_inode_block); |
1386 | 1386 | ||
1387 | /* If ocfs2_read_blocks() got us a new bh, pass it up. */ | 1387 | /* If ocfs2_read_blocks() got us a new bh, pass it up. */ |
1388 | if (!rc && !*bh) | 1388 | if (!rc && !*bh) |
@@ -1408,6 +1408,13 @@ static u64 ocfs2_inode_cache_owner(struct ocfs2_caching_info *ci) | |||
1408 | return oi->ip_blkno; | 1408 | return oi->ip_blkno; |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | static struct super_block *ocfs2_inode_cache_get_super(struct ocfs2_caching_info *ci) | ||
1412 | { | ||
1413 | struct ocfs2_inode_info *oi = cache_info_to_inode(ci); | ||
1414 | |||
1415 | return oi->vfs_inode.i_sb; | ||
1416 | } | ||
1417 | |||
1411 | static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) | 1418 | static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) |
1412 | { | 1419 | { |
1413 | struct ocfs2_inode_info *oi = cache_info_to_inode(ci); | 1420 | struct ocfs2_inode_info *oi = cache_info_to_inode(ci); |
@@ -1438,6 +1445,7 @@ static void ocfs2_inode_cache_io_unlock(struct ocfs2_caching_info *ci) | |||
1438 | 1445 | ||
1439 | const struct ocfs2_caching_operations ocfs2_inode_caching_ops = { | 1446 | const struct ocfs2_caching_operations ocfs2_inode_caching_ops = { |
1440 | .co_owner = ocfs2_inode_cache_owner, | 1447 | .co_owner = ocfs2_inode_cache_owner, |
1448 | .co_get_super = ocfs2_inode_cache_get_super, | ||
1441 | .co_cache_lock = ocfs2_inode_cache_lock, | 1449 | .co_cache_lock = ocfs2_inode_cache_lock, |
1442 | .co_cache_unlock = ocfs2_inode_cache_unlock, | 1450 | .co_cache_unlock = ocfs2_inode_cache_unlock, |
1443 | .co_io_lock = ocfs2_inode_cache_io_lock, | 1451 | .co_io_lock = ocfs2_inode_cache_io_lock, |