aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-10-09 13:38:40 -0400
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:23 -0500
commita90714c150e3ce677c57a9dac3ab1ec342c75a95 (patch)
tree43e3e744d86122940c0db39ac1bfed0d434b3216 /fs/ocfs2/xattr.c
parent9e33d69f553aaf11377307e8d6f82deb3385e351 (diff)
ocfs2: Add quota calls for allocation and freeing of inodes and space
Add quota calls for allocation and freeing of inodes and space, also update estimates on number of needed credits for a transaction. Move out inode allocation from ocfs2_mknod_locked() because vfs_dq_init() must be called outside of a transaction. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 9cb71e1c7c60..3b9634c7d296 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -1665,7 +1665,8 @@ static int ocfs2_remove_value_outside(struct inode*inode,
1665 1665
1666 ocfs2_init_dealloc_ctxt(&ctxt.dealloc); 1666 ocfs2_init_dealloc_ctxt(&ctxt.dealloc);
1667 1667
1668 ctxt.handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS); 1668 ctxt.handle = ocfs2_start_trans(osb,
1669 ocfs2_remove_extent_credits(osb->sb));
1669 if (IS_ERR(ctxt.handle)) { 1670 if (IS_ERR(ctxt.handle)) {
1670 ret = PTR_ERR(ctxt.handle); 1671 ret = PTR_ERR(ctxt.handle);
1671 mlog_errno(ret); 1672 mlog_errno(ret);
@@ -2233,7 +2234,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
2233 */ 2234 */
2234 if (!xi->value) { 2235 if (!xi->value) {
2235 if (!ocfs2_xattr_is_local(xe)) 2236 if (!ocfs2_xattr_is_local(xe))
2236 credits += OCFS2_REMOVE_EXTENT_CREDITS; 2237 credits += ocfs2_remove_extent_credits(inode->i_sb);
2237 2238
2238 goto out; 2239 goto out;
2239 } 2240 }
@@ -2250,7 +2251,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
2250 */ 2251 */
2251 if (ocfs2_xattr_can_be_in_inode(inode, xi, xis)) { 2252 if (ocfs2_xattr_can_be_in_inode(inode, xi, xis)) {
2252 clusters_add += new_clusters; 2253 clusters_add += new_clusters;
2253 credits += OCFS2_REMOVE_EXTENT_CREDITS + 2254 credits += ocfs2_remove_extent_credits(inode->i_sb) +
2254 OCFS2_INODE_UPDATE_CREDITS; 2255 OCFS2_INODE_UPDATE_CREDITS;
2255 if (!ocfs2_xattr_is_local(xe)) 2256 if (!ocfs2_xattr_is_local(xe))
2256 credits += ocfs2_calc_extend_credits( 2257 credits += ocfs2_calc_extend_credits(
@@ -2275,7 +2276,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
2275 xv = &def_xv.xv; 2276 xv = &def_xv.xv;
2276 2277
2277 if (old_clusters >= new_clusters) { 2278 if (old_clusters >= new_clusters) {
2278 credits += OCFS2_REMOVE_EXTENT_CREDITS; 2279 credits += ocfs2_remove_extent_credits(inode->i_sb);
2279 goto out; 2280 goto out;
2280 } else { 2281 } else {
2281 meta_add += ocfs2_extend_meta_needed(&xv->xr_list); 2282 meta_add += ocfs2_extend_meta_needed(&xv->xr_list);
@@ -4750,7 +4751,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode,
4750 } 4751 }
4751 } 4752 }
4752 4753
4753 handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS); 4754 handle = ocfs2_start_trans(osb, ocfs2_remove_extent_credits(osb->sb));
4754 if (IS_ERR(handle)) { 4755 if (IS_ERR(handle)) {
4755 ret = -ENOMEM; 4756 ret = -ENOMEM;
4756 mlog_errno(ret); 4757 mlog_errno(ret);
@@ -5109,7 +5110,8 @@ static int ocfs2_delete_xattr_in_bucket(struct inode *inode,
5109 5110
5110 ocfs2_init_dealloc_ctxt(&ctxt.dealloc); 5111 ocfs2_init_dealloc_ctxt(&ctxt.dealloc);
5111 5112
5112 ctxt.handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS); 5113 ctxt.handle = ocfs2_start_trans(osb,
5114 ocfs2_remove_extent_credits(osb->sb));
5113 if (IS_ERR(ctxt.handle)) { 5115 if (IS_ERR(ctxt.handle)) {
5114 ret = PTR_ERR(ctxt.handle); 5116 ret = PTR_ERR(ctxt.handle);
5115 mlog_errno(ret); 5117 mlog_errno(ret);