aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2015-10-26 11:40:28 -0400
committerBob Peterson <rpeterso@redhat.com>2015-11-24 09:38:44 -0500
commitb54e9a0b92d44843f6719ae22b0f6daf5b9b23b4 (patch)
treec0e4f124cdd1208f046fc0fc19c090cc3204e6f3 /fs/gfs2/rgrp.c
parent39b0555f7a1f96ecd303103df15596db49c36c65 (diff)
GFS2: Extract quota data from reservations structure (revert 5407e24)
This patch basically reverts the majority of patch 5407e24. That patch eliminated the gfs2_qadata structure in favor of just using the reservations structure. The problem with doing that is that it increases the size of the reservations structure. That is not an issue until it comes time to fold the reservations structure into the inode in memory so we know it's always there. By separating out the quota structure again, we aren't punishing the non-quota users by making all the inodes bigger, requiring more slab space. This patch creates a new slab area to allocate the quota stuff so it's managed a little more sanely. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index ac0a65d94a7e..cb30748e7b19 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -596,10 +596,11 @@ void gfs2_free_clones(struct gfs2_rgrpd *rgd)
596} 596}
597 597
598/** 598/**
599 * gfs2_rs_alloc - make sure we have a reservation assigned to the inode 599 * gfs2_rsqa_alloc - make sure we have a reservation assigned to the inode
600 * plus a quota allocations data structure, if necessary
600 * @ip: the inode for this reservation 601 * @ip: the inode for this reservation
601 */ 602 */
602int gfs2_rs_alloc(struct gfs2_inode *ip) 603int gfs2_rsqa_alloc(struct gfs2_inode *ip)
603{ 604{
604 int error = 0; 605 int error = 0;
605 606
@@ -614,6 +615,12 @@ int gfs2_rs_alloc(struct gfs2_inode *ip)
614 } 615 }
615 616
616 RB_CLEAR_NODE(&ip->i_res->rs_node); 617 RB_CLEAR_NODE(&ip->i_res->rs_node);
618 error = gfs2_qa_alloc(ip);
619 if (error) {
620 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res);
621 ip->i_res = NULL;
622 }
623
617out: 624out:
618 up_write(&ip->i_rw_mutex); 625 up_write(&ip->i_rw_mutex);
619 return error; 626 return error;
@@ -678,12 +685,12 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
678} 685}
679 686
680/** 687/**
681 * gfs2_rs_delete - delete a multi-block reservation 688 * gfs2_rsqa_delete - delete a multi-block reservation and quota allocation
682 * @ip: The inode for this reservation 689 * @ip: The inode for this reservation
683 * @wcount: The inode's write count, or NULL 690 * @wcount: The inode's write count, or NULL
684 * 691 *
685 */ 692 */
686void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount) 693void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount)
687{ 694{
688 down_write(&ip->i_rw_mutex); 695 down_write(&ip->i_rw_mutex);
689 if (ip->i_res && ((wcount == NULL) || (atomic_read(wcount) <= 1))) { 696 if (ip->i_res && ((wcount == NULL) || (atomic_read(wcount) <= 1))) {
@@ -691,6 +698,8 @@ void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
691 BUG_ON(ip->i_res->rs_free); 698 BUG_ON(ip->i_res->rs_free);
692 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res); 699 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res);
693 ip->i_res = NULL; 700 ip->i_res = NULL;
701
702 gfs2_qa_delete(ip);
694 } 703 }
695 up_write(&ip->i_rw_mutex); 704 up_write(&ip->i_rw_mutex);
696} 705}