aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.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/xattr.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/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index d1a27cda984f..19de5c487242 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -254,9 +254,9 @@ static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
254 break; 254 break;
255 } 255 }
256 256
257 if (!ocfs2_buffer_uptodate(bucket->bu_inode, 257 if (!ocfs2_buffer_uptodate(INODE_CACHE(bucket->bu_inode),
258 bucket->bu_bhs[i])) 258 bucket->bu_bhs[i]))
259 ocfs2_set_new_buffer_uptodate(bucket->bu_inode, 259 ocfs2_set_new_buffer_uptodate(INODE_CACHE(bucket->bu_inode),
260 bucket->bu_bhs[i]); 260 bucket->bu_bhs[i]);
261 } 261 }
262 262
@@ -271,7 +271,7 @@ static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
271{ 271{
272 int rc; 272 int rc;
273 273
274 rc = ocfs2_read_blocks(bucket->bu_inode, xb_blkno, 274 rc = ocfs2_read_blocks(INODE_CACHE(bucket->bu_inode), xb_blkno,
275 bucket->bu_blocks, bucket->bu_bhs, 0, 275 bucket->bu_blocks, bucket->bu_bhs, 0,
276 NULL); 276 NULL);
277 if (!rc) { 277 if (!rc) {
@@ -399,7 +399,7 @@ static int ocfs2_read_xattr_block(struct inode *inode, u64 xb_blkno,
399 int rc; 399 int rc;
400 struct buffer_head *tmp = *bh; 400 struct buffer_head *tmp = *bh;
401 401
402 rc = ocfs2_read_block(inode, xb_blkno, &tmp, 402 rc = ocfs2_read_block(INODE_CACHE(inode), xb_blkno, &tmp,
403 ocfs2_validate_xattr_block); 403 ocfs2_validate_xattr_block);
404 404
405 /* If ocfs2_read_block() got us a new bh, pass it up. */ 405 /* If ocfs2_read_block() got us a new bh, pass it up. */
@@ -724,8 +724,8 @@ static int ocfs2_xattr_shrink_size(struct inode *inode,
724 } 724 }
725 725
726 block = ocfs2_clusters_to_blocks(inode->i_sb, phys_cpos); 726 block = ocfs2_clusters_to_blocks(inode->i_sb, phys_cpos);
727 ocfs2_remove_xattr_clusters_from_cache(inode, block, 727 ocfs2_remove_xattr_clusters_from_cache(INODE_CACHE(inode),
728 alloc_size); 728 block, alloc_size);
729 cpos += alloc_size; 729 cpos += alloc_size;
730 trunc_len -= alloc_size; 730 trunc_len -= alloc_size;
731 } 731 }
@@ -970,7 +970,8 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode,
970 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); 970 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
971 /* Copy ocfs2_xattr_value */ 971 /* Copy ocfs2_xattr_value */
972 for (i = 0; i < num_clusters * bpc; i++, blkno++) { 972 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
973 ret = ocfs2_read_block(inode, blkno, &bh, NULL); 973 ret = ocfs2_read_block(INODE_CACHE(inode), blkno,
974 &bh, NULL);
974 if (ret) { 975 if (ret) {
975 mlog_errno(ret); 976 mlog_errno(ret);
976 goto out; 977 goto out;
@@ -1208,7 +1209,8 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode,
1208 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); 1209 blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
1209 1210
1210 for (i = 0; i < num_clusters * bpc; i++, blkno++) { 1211 for (i = 0; i < num_clusters * bpc; i++, blkno++) {
1211 ret = ocfs2_read_block(inode, blkno, &bh, NULL); 1212 ret = ocfs2_read_block(INODE_CACHE(inode), blkno,
1213 &bh, NULL);
1212 if (ret) { 1214 if (ret) {
1213 mlog_errno(ret); 1215 mlog_errno(ret);
1214 goto out; 1216 goto out;
@@ -2121,7 +2123,7 @@ static int ocfs2_xattr_block_set(struct inode *inode,
2121 } 2123 }
2122 2124
2123 new_bh = sb_getblk(inode->i_sb, first_blkno); 2125 new_bh = sb_getblk(inode->i_sb, first_blkno);
2124 ocfs2_set_new_buffer_uptodate(inode, new_bh); 2126 ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), new_bh);
2125 2127
2126 ret = ocfs2_journal_access_xb(handle, inode, new_bh, 2128 ret = ocfs2_journal_access_xb(handle, inode, new_bh,
2127 OCFS2_JOURNAL_ACCESS_CREATE); 2129 OCFS2_JOURNAL_ACCESS_CREATE);
@@ -4845,7 +4847,8 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode,
4845 mlog(0, "rm xattr extent rec at %u len = %u, start from %llu\n", 4847 mlog(0, "rm xattr extent rec at %u len = %u, start from %llu\n",
4846 cpos, len, (unsigned long long)blkno); 4848 cpos, len, (unsigned long long)blkno);
4847 4849
4848 ocfs2_remove_xattr_clusters_from_cache(inode, blkno, len); 4850 ocfs2_remove_xattr_clusters_from_cache(INODE_CACHE(inode), blkno,
4851 len);
4849 4852
4850 ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac); 4853 ret = ocfs2_lock_allocators(inode, &et, 0, 1, NULL, &meta_ac);
4851 if (ret) { 4854 if (ret) {