summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
authorBob Peterson2015-07-16 15:28:04 +0200
committerBob Peterson2015-12-14 19:16:38 +0100
commita097dc7e24cba7980bc5e2df461a4ef228e97e59 (patch)
treebfe9075d7d759fe136d540cea595dfbc4c81f361 /fs/gfs2/quota.c
parentGFS2: Extract quota data from reservations structure (revert 5407e24) (diff)
downloadkernel-qcow2-linux-a097dc7e24cba7980bc5e2df461a4ef228e97e59.tar.gz
kernel-qcow2-linux-a097dc7e24cba7980bc5e2df461a4ef228e97e59.tar.xz
kernel-qcow2-linux-a097dc7e24cba7980bc5e2df461a4ef228e97e59.zip
GFS2: Make rgrp reservations part of the gfs2_inode structure
Before this patch, multi-block reservation structures were allocated from a special slab. This patch folds the structure into the gfs2_inode structure. The disadvantage is that the gfs2_inode needs more memory, even when a file is opened read-only. The advantages are: (a) we don't need the special slab and the extra time it takes to allocate and deallocate from it. (b) we no longer need to worry that the structure exists for things like quota management. (c) This also allows us to remove the calls to get_write_access and put_write_access since we know the structure will exist. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index b845efdb5e3a..63a72109976c 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -550,10 +550,10 @@ int gfs2_qa_alloc(struct gfs2_inode *ip)
return error;
}
-void gfs2_qa_delete(struct gfs2_inode *ip)
+void gfs2_qa_delete(struct gfs2_inode *ip, atomic_t *wcount)
{
down_write(&ip->i_rw_mutex);
- if (ip->i_qadata) {
+ if (ip->i_qadata && ((wcount == NULL) || (atomic_read(wcount) <= 1))) {
kmem_cache_free(gfs2_qadata_cachep, ip->i_qadata);
ip->i_qadata = NULL;
}