Skip to content

Commit 2f7ee35

Browse files
AstralBobswhiteho
authored andcommitted
GFS2: Use variable rather than qa to determine if unstuff necessary
In the future, the qadata structure will be eliminated and merged back in with the block reservation structure, after we extend the lifespan of that. This patch is a step forward in eliminating the qadata structure. It adds a variable to the do_grow function to determine when unstuffing is necessary, and has been done. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 9598d25 commit 2f7ee35

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎fs/gfs2/bmap.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,7 @@ static int do_grow(struct inode *inode, u64 size)
11691169
struct buffer_head *dibh;
11701170
struct gfs2_qadata *qa = NULL;
11711171
int error;
1172+
int unstuff = 0;
11721173

11731174
if (gfs2_is_stuffed(ip) &&
11741175
(size > (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)))) {
@@ -1183,13 +1184,14 @@ static int do_grow(struct inode *inode, u64 size)
11831184
error = gfs2_inplace_reserve(ip, 1);
11841185
if (error)
11851186
goto do_grow_qunlock;
1187+
unstuff = 1;
11861188
}
11871189

11881190
error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT, 0);
11891191
if (error)
11901192
goto do_grow_release;
11911193

1192-
if (qa) {
1194+
if (unstuff) {
11931195
error = gfs2_unstuff_dinode(ip, NULL);
11941196
if (error)
11951197
goto do_end_trans;
@@ -1208,7 +1210,7 @@ static int do_grow(struct inode *inode, u64 size)
12081210
do_end_trans:
12091211
gfs2_trans_end(sdp);
12101212
do_grow_release:
1211-
if (qa) {
1213+
if (unstuff) {
12121214
gfs2_inplace_release(ip);
12131215
do_grow_qunlock:
12141216
gfs2_quota_unlock(ip);

0 commit comments

Comments
 (0)