aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 6ce0686eab72..f0a1326d9bba 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -377,7 +377,7 @@ static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
377 bucket->bu_bhs[i] = sb_getblk(bucket->bu_inode->i_sb, 377 bucket->bu_bhs[i] = sb_getblk(bucket->bu_inode->i_sb,
378 xb_blkno + i); 378 xb_blkno + i);
379 if (!bucket->bu_bhs[i]) { 379 if (!bucket->bu_bhs[i]) {
380 rc = -EIO; 380 rc = -ENOMEM;
381 mlog_errno(rc); 381 mlog_errno(rc);
382 break; 382 break;
383 } 383 }
@@ -754,8 +754,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode,
754 BUG_ON(why == RESTART_META); 754 BUG_ON(why == RESTART_META);
755 755
756 credits = ocfs2_calc_extend_credits(inode->i_sb, 756 credits = ocfs2_calc_extend_credits(inode->i_sb,
757 &vb->vb_xv->xr_list, 757 &vb->vb_xv->xr_list);
758 clusters_to_add);
759 status = ocfs2_extend_trans(handle, credits); 758 status = ocfs2_extend_trans(handle, credits);
760 if (status < 0) { 759 if (status < 0) {
761 status = -ENOMEM; 760 status = -ENOMEM;
@@ -2865,6 +2864,12 @@ static int ocfs2_create_xattr_block(struct inode *inode,
2865 } 2864 }
2866 2865
2867 new_bh = sb_getblk(inode->i_sb, first_blkno); 2866 new_bh = sb_getblk(inode->i_sb, first_blkno);
2867 if (!new_bh) {
2868 ret = -ENOMEM;
2869 mlog_errno(ret);
2870 goto end;
2871 }
2872
2868 ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), new_bh); 2873 ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), new_bh);
2869 2874
2870 ret = ocfs2_journal_access_xb(ctxt->handle, INODE_CACHE(inode), 2875 ret = ocfs2_journal_access_xb(ctxt->handle, INODE_CACHE(inode),
@@ -3040,8 +3045,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
3040 if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) { 3045 if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) {
3041 clusters_add += new_clusters; 3046 clusters_add += new_clusters;
3042 credits += ocfs2_calc_extend_credits(inode->i_sb, 3047 credits += ocfs2_calc_extend_credits(inode->i_sb,
3043 &def_xv.xv.xr_list, 3048 &def_xv.xv.xr_list);
3044 new_clusters);
3045 } 3049 }
3046 3050
3047 goto meta_guess; 3051 goto meta_guess;
@@ -3106,8 +3110,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
3106 if (!ocfs2_xattr_is_local(xe)) 3110 if (!ocfs2_xattr_is_local(xe))
3107 credits += ocfs2_calc_extend_credits( 3111 credits += ocfs2_calc_extend_credits(
3108 inode->i_sb, 3112 inode->i_sb,
3109 &def_xv.xv.xr_list, 3113 &def_xv.xv.xr_list);
3110 new_clusters);
3111 goto out; 3114 goto out;
3112 } 3115 }
3113 } 3116 }
@@ -3132,9 +3135,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
3132 meta_add += ocfs2_extend_meta_needed(&xv->xr_list); 3135 meta_add += ocfs2_extend_meta_needed(&xv->xr_list);
3133 clusters_add += new_clusters - old_clusters; 3136 clusters_add += new_clusters - old_clusters;
3134 credits += ocfs2_calc_extend_credits(inode->i_sb, 3137 credits += ocfs2_calc_extend_credits(inode->i_sb,
3135 &xv->xr_list, 3138 &xv->xr_list);
3136 new_clusters -
3137 old_clusters);
3138 if (value_size >= OCFS2_XATTR_ROOT_SIZE) 3139 if (value_size >= OCFS2_XATTR_ROOT_SIZE)
3139 goto out; 3140 goto out;
3140 } 3141 }
@@ -3180,7 +3181,7 @@ meta_guess:
3180 &xb->xb_attrs.xb_root.xt_list; 3181 &xb->xb_attrs.xb_root.xt_list;
3181 meta_add += ocfs2_extend_meta_needed(el); 3182 meta_add += ocfs2_extend_meta_needed(el);
3182 credits += ocfs2_calc_extend_credits(inode->i_sb, 3183 credits += ocfs2_calc_extend_credits(inode->i_sb,
3183 el, 1); 3184 el);
3184 } else 3185 } else
3185 credits += OCFS2_SUBALLOC_ALLOC + 1; 3186 credits += OCFS2_SUBALLOC_ALLOC + 1;
3186 3187
@@ -6216,8 +6217,7 @@ static int ocfs2_value_metas_in_xattr_header(struct super_block *sb,
6216 le16_to_cpu(xv->xr_list.l_next_free_rec); 6217 le16_to_cpu(xv->xr_list.l_next_free_rec);
6217 6218
6218 *credits += ocfs2_calc_extend_credits(sb, 6219 *credits += ocfs2_calc_extend_credits(sb,
6219 &def_xv.xv.xr_list, 6220 &def_xv.xv.xr_list);
6220 le32_to_cpu(xv->xr_clusters));
6221 6221
6222 /* 6222 /*
6223 * If the value is a tree with depth > 1, We don't go deep 6223 * If the value is a tree with depth > 1, We don't go deep
@@ -6782,7 +6782,7 @@ static int ocfs2_lock_reflink_xattr_rec_allocators(
6782 metas.num_metas += ocfs2_extend_meta_needed(xt_et->et_root_el); 6782 metas.num_metas += ocfs2_extend_meta_needed(xt_et->et_root_el);
6783 6783
6784 *credits += ocfs2_calc_extend_credits(osb->sb, 6784 *credits += ocfs2_calc_extend_credits(osb->sb,
6785 xt_et->et_root_el, len); 6785 xt_et->et_root_el);
6786 6786
6787 if (metas.num_metas) { 6787 if (metas.num_metas) {
6788 ret = ocfs2_reserve_new_metadata_blocks(osb, metas.num_metas, 6788 ret = ocfs2_reserve_new_metadata_blocks(osb, metas.num_metas,