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>
此提交包含在:
@@ -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;
|
||||
}
|
||||
|
||||
|
新增問題並參考
封鎖使用者