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.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index cb74312eb270..14a704015970 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1041,7 +1041,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
1041 lblock = (size - 1) >> sdp->sd_sb.sb_bsize_shift; 1041 lblock = (size - 1) >> sdp->sd_sb.sb_bsize_shift;
1042 1042
1043 find_metapath(sdp, lblock, &mp, ip->i_height); 1043 find_metapath(sdp, lblock, &mp, ip->i_height);
1044 if (!gfs2_alloc_get(ip)) 1044 if (!gfs2_qadata_get(ip))
1045 return -ENOMEM; 1045 return -ENOMEM;
1046 1046
1047 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 1047 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
@@ -1061,7 +1061,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
1061 gfs2_quota_unhold(ip); 1061 gfs2_quota_unhold(ip);
1062 1062
1063out: 1063out:
1064 gfs2_alloc_put(ip); 1064 gfs2_qadata_put(ip);
1065 return error; 1065 return error;
1066} 1066}
1067 1067
@@ -1163,21 +1163,20 @@ static int do_grow(struct inode *inode, u64 size)
1163 struct gfs2_inode *ip = GFS2_I(inode); 1163 struct gfs2_inode *ip = GFS2_I(inode);
1164 struct gfs2_sbd *sdp = GFS2_SB(inode); 1164 struct gfs2_sbd *sdp = GFS2_SB(inode);
1165 struct buffer_head *dibh; 1165 struct buffer_head *dibh;
1166 struct gfs2_alloc *al = NULL; 1166 struct gfs2_qadata *qa = NULL;
1167 int error; 1167 int error;
1168 1168
1169 if (gfs2_is_stuffed(ip) && 1169 if (gfs2_is_stuffed(ip) &&
1170 (size > (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)))) { 1170 (size > (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)))) {
1171 al = gfs2_alloc_get(ip); 1171 qa = gfs2_qadata_get(ip);
1172 if (al == NULL) 1172 if (qa == NULL)
1173 return -ENOMEM; 1173 return -ENOMEM;
1174 1174
1175 error = gfs2_quota_lock_check(ip); 1175 error = gfs2_quota_lock_check(ip);
1176 if (error) 1176 if (error)
1177 goto do_grow_alloc_put; 1177 goto do_grow_alloc_put;
1178 1178
1179 al->al_requested = 1; 1179 error = gfs2_inplace_reserve(ip, 1);
1180 error = gfs2_inplace_reserve(ip);
1181 if (error) 1180 if (error)
1182 goto do_grow_qunlock; 1181 goto do_grow_qunlock;
1183 } 1182 }
@@ -1186,7 +1185,7 @@ static int do_grow(struct inode *inode, u64 size)
1186 if (error) 1185 if (error)
1187 goto do_grow_release; 1186 goto do_grow_release;
1188 1187
1189 if (al) { 1188 if (qa) {
1190 error = gfs2_unstuff_dinode(ip, NULL); 1189 error = gfs2_unstuff_dinode(ip, NULL);
1191 if (error) 1190 if (error)
1192 goto do_end_trans; 1191 goto do_end_trans;
@@ -1205,12 +1204,12 @@ static int do_grow(struct inode *inode, u64 size)
1205do_end_trans: 1204do_end_trans:
1206 gfs2_trans_end(sdp); 1205 gfs2_trans_end(sdp);
1207do_grow_release: 1206do_grow_release:
1208 if (al) { 1207 if (qa) {
1209 gfs2_inplace_release(ip); 1208 gfs2_inplace_release(ip);
1210do_grow_qunlock: 1209do_grow_qunlock:
1211 gfs2_quota_unlock(ip); 1210 gfs2_quota_unlock(ip);
1212do_grow_alloc_put: 1211do_grow_alloc_put:
1213 gfs2_alloc_put(ip); 1212 gfs2_qadata_put(ip);
1214 } 1213 }
1215 return error; 1214 return error;
1216} 1215}