gfs2: Split gfs2_rsqa_delete into gfs2_rs_delete and gfs2_qa_put
Keeping reservations and quotas separate helps reviewing the code. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
This commit is contained in:
parent
2fba46a04c
commit
1595548fe7
|
@ -2194,7 +2194,8 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
|
|||
|
||||
ret = do_shrink(inode, newsize);
|
||||
out:
|
||||
gfs2_rsqa_delete(ip, NULL);
|
||||
gfs2_rs_delete(ip, NULL);
|
||||
gfs2_qa_put(ip);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -701,8 +701,10 @@ static int gfs2_release(struct inode *inode, struct file *file)
|
|||
kfree(file->private_data);
|
||||
file->private_data = NULL;
|
||||
|
||||
if (file->f_mode & FMODE_WRITE)
|
||||
gfs2_rsqa_delete(ip, &inode->i_writecount);
|
||||
if (file->f_mode & FMODE_WRITE) {
|
||||
gfs2_rs_delete(ip, &inode->i_writecount);
|
||||
gfs2_qa_put(ip);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -781,7 +781,8 @@ fail_free_inode:
|
|||
glock_clear_object(ip->i_gl, ip);
|
||||
gfs2_glock_put(ip->i_gl);
|
||||
}
|
||||
gfs2_rsqa_delete(ip, NULL);
|
||||
gfs2_rs_delete(ip, NULL);
|
||||
gfs2_qa_put(ip);
|
||||
fail_free_acls:
|
||||
posix_acl_release(default_acl);
|
||||
posix_acl_release(acl);
|
||||
|
|
|
@ -662,18 +662,17 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
|
|||
}
|
||||
|
||||
/**
|
||||
* gfs2_rsqa_delete - delete a multi-block reservation and quota allocation
|
||||
* gfs2_rs_delete - delete a multi-block reservation
|
||||
* @ip: The inode for this reservation
|
||||
* @wcount: The inode's write count, or NULL
|
||||
*
|
||||
*/
|
||||
void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount)
|
||||
void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
|
||||
{
|
||||
down_write(&ip->i_rw_mutex);
|
||||
if ((wcount == NULL) || (atomic_read(wcount) <= 1))
|
||||
gfs2_rs_deltree(&ip->i_res);
|
||||
up_write(&ip->i_rw_mutex);
|
||||
gfs2_qa_put(ip);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,7 +45,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
|
|||
bool dinode, u64 *generation);
|
||||
|
||||
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
|
||||
extern void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount);
|
||||
extern void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount);
|
||||
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
|
||||
u64 bstart, u32 blen, int meta);
|
||||
extern void gfs2_free_meta(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
|
||||
|
|
|
@ -1403,7 +1403,8 @@ out:
|
|||
truncate_inode_pages_final(&inode->i_data);
|
||||
if (ip->i_qadata)
|
||||
gfs2_assert_warn(sdp, ip->i_qadata->qa_ref == 0);
|
||||
gfs2_rsqa_delete(ip, NULL);
|
||||
gfs2_rs_delete(ip, NULL);
|
||||
gfs2_qa_put(ip);
|
||||
gfs2_ordered_del_inode(ip);
|
||||
clear_inode(inode);
|
||||
gfs2_dir_hash_inval(ip);
|
||||
|
|
Loading…
Reference in New Issue