GFS2: Fold quota data into the reservations struct

This patch moves the ancillary quota data structures into the
block reservations structure. This saves GFS2 some time and
effort in allocating and deallocating the qadata structure.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
此提交包含在:
Bob Peterson
2012-05-18 09:28:23 -04:00
提交者 Steven Whitehouse
父節點 0a305e4960
當前提交 5407e24229
共有 12 個檔案被更改,包括 56 行新增186 行删除

查看文件

@@ -325,13 +325,8 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
struct gfs2_ea_header *ea,
struct gfs2_ea_header *prev, int leave)
{
struct gfs2_qadata *qa;
int error;
qa = gfs2_qadata_get(ip);
if (!qa)
return -ENOMEM;
error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
if (error)
goto out_alloc;
@@ -340,7 +335,6 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
gfs2_quota_unhold(ip);
out_alloc:
gfs2_qadata_put(ip);
return error;
}
@@ -713,17 +707,12 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
unsigned int blks,
ea_skeleton_call_t skeleton_call, void *private)
{
struct gfs2_qadata *qa;
struct buffer_head *dibh;
int error;
qa = gfs2_qadata_get(ip);
if (!qa)
return -ENOMEM;
error = gfs2_quota_lock_check(ip);
if (error)
goto out;
return error;
error = gfs2_inplace_reserve(ip, blks);
if (error)
@@ -753,8 +742,6 @@ out_ipres:
gfs2_inplace_release(ip);
out_gunlock_q:
gfs2_quota_unlock(ip);
out:
gfs2_qadata_put(ip);
return error;
}
@@ -1494,16 +1481,11 @@ out_gunlock:
int gfs2_ea_dealloc(struct gfs2_inode *ip)
{
struct gfs2_qadata *qa;
int error;
qa = gfs2_qadata_get(ip);
if (!qa)
return -ENOMEM;
error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
if (error)
goto out_alloc;
return error;
error = ea_foreach(ip, ea_dealloc_unstuffed, NULL);
if (error)
@@ -1519,8 +1501,6 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
out_quota:
gfs2_quota_unhold(ip);
out_alloc:
gfs2_qadata_put(ip);
return error;
}