aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 41d494d79709..14a704015970 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -133,7 +133,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
133 and write it out to disk */ 133 and write it out to disk */
134 134
135 unsigned int n = 1; 135 unsigned int n = 1;
136 error = gfs2_alloc_block(ip, &block, &n); 136 error = gfs2_alloc_blocks(ip, &block, &n, 0, NULL);
137 if (error) 137 if (error)
138 goto out_brelse; 138 goto out_brelse;
139 if (isdir) { 139 if (isdir) {
@@ -503,7 +503,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock,
503 do { 503 do {
504 int error; 504 int error;
505 n = blks - alloced; 505 n = blks - alloced;
506 error = gfs2_alloc_block(ip, &bn, &n); 506 error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL);
507 if (error) 507 if (error)
508 return error; 508 return error;
509 alloced += n; 509 alloced += n;
@@ -743,9 +743,6 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
743 else if (ip->i_depth) 743 else if (ip->i_depth)
744 revokes = sdp->sd_inptrs; 744 revokes = sdp->sd_inptrs;
745 745
746 if (error)
747 return error;
748
749 memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); 746 memset(&rlist, 0, sizeof(struct gfs2_rgrp_list));
750 bstart = 0; 747 bstart = 0;
751 blen = 0; 748 blen = 0;
@@ -1044,7 +1041,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
1044 lblock = (size - 1) >> sdp->sd_sb.sb_bsize_shift; 1041 lblock = (size - 1) >> sdp->sd_sb.sb_bsize_shift;
1045 1042
1046 find_metapath(sdp, lblock, &mp, ip->i_height); 1043 find_metapath(sdp, lblock, &mp, ip->i_height);
1047 if (!gfs2_alloc_get(ip)) 1044 if (!gfs2_qadata_get(ip))
1048 return -ENOMEM; 1045 return -ENOMEM;
1049 1046
1050 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 1047 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
@@ -1064,7 +1061,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
1064 gfs2_quota_unhold(ip); 1061 gfs2_quota_unhold(ip);
1065 1062
1066out: 1063out:
1067 gfs2_alloc_put(ip); 1064 gfs2_qadata_put(ip);
1068 return error; 1065 return error;
1069} 1066}
1070 1067
@@ -1166,21 +1163,20 @@ static int do_grow(struct inode *inode, u64 size)
1166 struct gfs2_inode *ip = GFS2_I(inode); 1163 struct gfs2_inode *ip = GFS2_I(inode);
1167 struct gfs2_sbd *sdp = GFS2_SB(inode); 1164 struct gfs2_sbd *sdp = GFS2_SB(inode);
1168 struct buffer_head *dibh; 1165 struct buffer_head *dibh;
1169 struct gfs2_alloc *al = NULL; 1166 struct gfs2_qadata *qa = NULL;
1170 int error; 1167 int error;
1171 1168
1172 if (gfs2_is_stuffed(ip) && 1169 if (gfs2_is_stuffed(ip) &&
1173 (size > (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)))) { 1170 (size > (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)))) {
1174 al = gfs2_alloc_get(ip); 1171 qa = gfs2_qadata_get(ip);
1175 if (al == NULL) 1172 if (qa == NULL)
1176 return -ENOMEM; 1173 return -ENOMEM;
1177 1174
1178 error = gfs2_quota_lock_check(ip); 1175 error = gfs2_quota_lock_check(ip);
1179 if (error) 1176 if (error)
1180 goto do_grow_alloc_put; 1177 goto do_grow_alloc_put;
1181 1178
1182 al->al_requested = 1; 1179 error = gfs2_inplace_reserve(ip, 1);
1183 error = gfs2_inplace_reserve(ip);
1184 if (error) 1180 if (error)
1185 goto do_grow_qunlock; 1181 goto do_grow_qunlock;
1186 } 1182 }
@@ -1189,7 +1185,7 @@ static int do_grow(struct inode *inode, u64 size)
1189 if (error) 1185 if (error)
1190 goto do_grow_release; 1186 goto do_grow_release;
1191 1187
1192 if (al) { 1188 if (qa) {
1193 error = gfs2_unstuff_dinode(ip, NULL); 1189 error = gfs2_unstuff_dinode(ip, NULL);
1194 if (error) 1190 if (error)
1195 goto do_end_trans; 1191 goto do_end_trans;
@@ -1208,12 +1204,12 @@ static int do_grow(struct inode *inode, u64 size)
1208do_end_trans: 1204do_end_trans:
1209 gfs2_trans_end(sdp); 1205 gfs2_trans_end(sdp);
1210do_grow_release: 1206do_grow_release:
1211 if (al) { 1207 if (qa) {
1212 gfs2_inplace_release(ip); 1208 gfs2_inplace_release(ip);
1213do_grow_qunlock: 1209do_grow_qunlock:
1214 gfs2_quota_unlock(ip); 1210 gfs2_quota_unlock(ip);
1215do_grow_alloc_put: 1211do_grow_alloc_put:
1216 gfs2_alloc_put(ip); 1212 gfs2_qadata_put(ip);
1217 } 1213 }
1218 return error; 1214 return error;
1219} 1215}