diff options
Diffstat (limited to 'fs/ocfs2/extent_map.c')
-rw-r--r-- | fs/ocfs2/extent_map.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index f2bb1a04d253..843db64e9d4a 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c | |||
@@ -293,7 +293,7 @@ static int ocfs2_last_eb_is_empty(struct inode *inode, | |||
293 | struct ocfs2_extent_block *eb; | 293 | struct ocfs2_extent_block *eb; |
294 | struct ocfs2_extent_list *el; | 294 | struct ocfs2_extent_list *el; |
295 | 295 | ||
296 | ret = ocfs2_read_extent_block(inode, last_eb_blk, &eb_bh); | 296 | ret = ocfs2_read_extent_block(INODE_CACHE(inode), last_eb_blk, &eb_bh); |
297 | if (ret) { | 297 | if (ret) { |
298 | mlog_errno(ret); | 298 | mlog_errno(ret); |
299 | goto out; | 299 | goto out; |
@@ -353,11 +353,11 @@ static int ocfs2_search_for_hole_index(struct ocfs2_extent_list *el, | |||
353 | * eb_bh is NULL. Otherwise, eb_bh should point to the extent block | 353 | * eb_bh is NULL. Otherwise, eb_bh should point to the extent block |
354 | * containing el. | 354 | * containing el. |
355 | */ | 355 | */ |
356 | static int ocfs2_figure_hole_clusters(struct inode *inode, | 356 | int ocfs2_figure_hole_clusters(struct ocfs2_caching_info *ci, |
357 | struct ocfs2_extent_list *el, | 357 | struct ocfs2_extent_list *el, |
358 | struct buffer_head *eb_bh, | 358 | struct buffer_head *eb_bh, |
359 | u32 v_cluster, | 359 | u32 v_cluster, |
360 | u32 *num_clusters) | 360 | u32 *num_clusters) |
361 | { | 361 | { |
362 | int ret, i; | 362 | int ret, i; |
363 | struct buffer_head *next_eb_bh = NULL; | 363 | struct buffer_head *next_eb_bh = NULL; |
@@ -375,7 +375,7 @@ static int ocfs2_figure_hole_clusters(struct inode *inode, | |||
375 | if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) | 375 | if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) |
376 | goto no_more_extents; | 376 | goto no_more_extents; |
377 | 377 | ||
378 | ret = ocfs2_read_extent_block(inode, | 378 | ret = ocfs2_read_extent_block(ci, |
379 | le64_to_cpu(eb->h_next_leaf_blk), | 379 | le64_to_cpu(eb->h_next_leaf_blk), |
380 | &next_eb_bh); | 380 | &next_eb_bh); |
381 | if (ret) { | 381 | if (ret) { |
@@ -428,7 +428,8 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, | |||
428 | tree_height = le16_to_cpu(el->l_tree_depth); | 428 | tree_height = le16_to_cpu(el->l_tree_depth); |
429 | 429 | ||
430 | if (tree_height > 0) { | 430 | if (tree_height > 0) { |
431 | ret = ocfs2_find_leaf(inode, el, v_cluster, &eb_bh); | 431 | ret = ocfs2_find_leaf(INODE_CACHE(inode), el, v_cluster, |
432 | &eb_bh); | ||
432 | if (ret) { | 433 | if (ret) { |
433 | mlog_errno(ret); | 434 | mlog_errno(ret); |
434 | goto out; | 435 | goto out; |
@@ -455,7 +456,8 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, | |||
455 | * field. | 456 | * field. |
456 | */ | 457 | */ |
457 | if (hole_len) { | 458 | if (hole_len) { |
458 | ret = ocfs2_figure_hole_clusters(inode, el, eb_bh, | 459 | ret = ocfs2_figure_hole_clusters(INODE_CACHE(inode), |
460 | el, eb_bh, | ||
459 | v_cluster, &len); | 461 | v_cluster, &len); |
460 | if (ret) { | 462 | if (ret) { |
461 | mlog_errno(ret); | 463 | mlog_errno(ret); |
@@ -539,7 +541,8 @@ static void ocfs2_relative_extent_offsets(struct super_block *sb, | |||
539 | 541 | ||
540 | int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, | 542 | int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, |
541 | u32 *p_cluster, u32 *num_clusters, | 543 | u32 *p_cluster, u32 *num_clusters, |
542 | struct ocfs2_extent_list *el) | 544 | struct ocfs2_extent_list *el, |
545 | unsigned int *extent_flags) | ||
543 | { | 546 | { |
544 | int ret = 0, i; | 547 | int ret = 0, i; |
545 | struct buffer_head *eb_bh = NULL; | 548 | struct buffer_head *eb_bh = NULL; |
@@ -548,7 +551,8 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, | |||
548 | u32 coff; | 551 | u32 coff; |
549 | 552 | ||
550 | if (el->l_tree_depth) { | 553 | if (el->l_tree_depth) { |
551 | ret = ocfs2_find_leaf(inode, el, v_cluster, &eb_bh); | 554 | ret = ocfs2_find_leaf(INODE_CACHE(inode), el, v_cluster, |
555 | &eb_bh); | ||
552 | if (ret) { | 556 | if (ret) { |
553 | mlog_errno(ret); | 557 | mlog_errno(ret); |
554 | goto out; | 558 | goto out; |
@@ -590,6 +594,9 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, | |||
590 | *p_cluster = *p_cluster + coff; | 594 | *p_cluster = *p_cluster + coff; |
591 | if (num_clusters) | 595 | if (num_clusters) |
592 | *num_clusters = ocfs2_rec_clusters(el, rec) - coff; | 596 | *num_clusters = ocfs2_rec_clusters(el, rec) - coff; |
597 | |||
598 | if (extent_flags) | ||
599 | *extent_flags = rec->e_flags; | ||
593 | } | 600 | } |
594 | out: | 601 | out: |
595 | if (eb_bh) | 602 | if (eb_bh) |
@@ -862,8 +869,8 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr, | |||
862 | BUG_ON(bhs[done + i]->b_blocknr != (p_block + i)); | 869 | BUG_ON(bhs[done + i]->b_blocknr != (p_block + i)); |
863 | } | 870 | } |
864 | 871 | ||
865 | rc = ocfs2_read_blocks(inode, p_block, count, bhs + done, | 872 | rc = ocfs2_read_blocks(INODE_CACHE(inode), p_block, count, |
866 | flags, validate); | 873 | bhs + done, flags, validate); |
867 | if (rc) { | 874 | if (rc) { |
868 | mlog_errno(rc); | 875 | mlog_errno(rc); |
869 | break; | 876 | break; |