diff options
author | Bob Peterson <rpeterso@redhat.com> | 2011-11-21 13:36:17 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-11-22 05:25:21 -0500 |
commit | 564e12b1157215171e7f3af5b70611ec7154327c (patch) | |
tree | f2a6e3394e59209f8e43a36f10f67bf1372c966c /fs/gfs2/super.c | |
parent | b3e47ca0c2427ec72a74e36c6408784b6098f2b5 (diff) |
GFS2: decouple quota allocations from block allocations
This patch separates the code pertaining to allocations into two
parts: quota-related information and block reservations.
This patch also moves all the block reservation structure allocations to
function gfs2_inplace_reserve to simplify the code, and moves
the frees to function gfs2_inplace_release.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 71e420989f77..69eb56876db4 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -1399,8 +1399,9 @@ static void gfs2_final_release_pages(struct gfs2_inode *ip) | |||
1399 | static int gfs2_dinode_dealloc(struct gfs2_inode *ip) | 1399 | static int gfs2_dinode_dealloc(struct gfs2_inode *ip) |
1400 | { | 1400 | { |
1401 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1401 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
1402 | struct gfs2_alloc *al; | 1402 | struct gfs2_qadata *qa; |
1403 | struct gfs2_rgrpd *rgd; | 1403 | struct gfs2_rgrpd *rgd; |
1404 | struct gfs2_holder gh; | ||
1404 | int error; | 1405 | int error; |
1405 | 1406 | ||
1406 | if (gfs2_get_inode_blocks(&ip->i_inode) != 1) { | 1407 | if (gfs2_get_inode_blocks(&ip->i_inode) != 1) { |
@@ -1408,8 +1409,8 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) | |||
1408 | return -EIO; | 1409 | return -EIO; |
1409 | } | 1410 | } |
1410 | 1411 | ||
1411 | al = gfs2_alloc_get(ip); | 1412 | qa = gfs2_qadata_get(ip); |
1412 | if (!al) | 1413 | if (!qa) |
1413 | return -ENOMEM; | 1414 | return -ENOMEM; |
1414 | 1415 | ||
1415 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 1416 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); |
@@ -1423,8 +1424,7 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) | |||
1423 | goto out_qs; | 1424 | goto out_qs; |
1424 | } | 1425 | } |
1425 | 1426 | ||
1426 | error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, | 1427 | error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &gh); |
1427 | &al->al_rgd_gh); | ||
1428 | if (error) | 1428 | if (error) |
1429 | goto out_qs; | 1429 | goto out_qs; |
1430 | 1430 | ||
@@ -1440,11 +1440,11 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) | |||
1440 | gfs2_trans_end(sdp); | 1440 | gfs2_trans_end(sdp); |
1441 | 1441 | ||
1442 | out_rg_gunlock: | 1442 | out_rg_gunlock: |
1443 | gfs2_glock_dq_uninit(&al->al_rgd_gh); | 1443 | gfs2_glock_dq_uninit(&gh); |
1444 | out_qs: | 1444 | out_qs: |
1445 | gfs2_quota_unhold(ip); | 1445 | gfs2_quota_unhold(ip); |
1446 | out: | 1446 | out: |
1447 | gfs2_alloc_put(ip); | 1447 | gfs2_qadata_put(ip); |
1448 | return error; | 1448 | return error; |
1449 | } | 1449 | } |
1450 | 1450 | ||