Skip to content

Commit 1595548

Browse files
Andreas GruenbacherAstralBob
authored andcommitted
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 <[email protected]> Signed-off-by: Bob Peterson <[email protected]>
1 parent 2fba46a commit 1595548

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

fs/gfs2/bmap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,8 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
21942194

21952195
ret = do_shrink(inode, newsize);
21962196
out:
2197-
gfs2_rsqa_delete(ip, NULL);
2197+
gfs2_rs_delete(ip, NULL);
2198+
gfs2_qa_put(ip);
21982199
return ret;
21992200
}
22002201

fs/gfs2/file.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,10 @@ static int gfs2_release(struct inode *inode, struct file *file)
701701
kfree(file->private_data);
702702
file->private_data = NULL;
703703

704-
if (file->f_mode & FMODE_WRITE)
705-
gfs2_rsqa_delete(ip, &inode->i_writecount);
704+
if (file->f_mode & FMODE_WRITE) {
705+
gfs2_rs_delete(ip, &inode->i_writecount);
706+
gfs2_qa_put(ip);
707+
}
706708
return 0;
707709
}
708710

fs/gfs2/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
781781
glock_clear_object(ip->i_gl, ip);
782782
gfs2_glock_put(ip->i_gl);
783783
}
784-
gfs2_rsqa_delete(ip, NULL);
784+
gfs2_rs_delete(ip, NULL);
785+
gfs2_qa_put(ip);
785786
fail_free_acls:
786787
posix_acl_release(default_acl);
787788
posix_acl_release(acl);

fs/gfs2/rgrp.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,18 +662,17 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
662662
}
663663

664664
/**
665-
* gfs2_rsqa_delete - delete a multi-block reservation and quota allocation
665+
* gfs2_rs_delete - delete a multi-block reservation
666666
* @ip: The inode for this reservation
667667
* @wcount: The inode's write count, or NULL
668668
*
669669
*/
670-
void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount)
670+
void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
671671
{
672672
down_write(&ip->i_rw_mutex);
673673
if ((wcount == NULL) || (atomic_read(wcount) <= 1))
674674
gfs2_rs_deltree(&ip->i_res);
675675
up_write(&ip->i_rw_mutex);
676-
gfs2_qa_put(ip);
677676
}
678677

679678
/**

fs/gfs2/rgrp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
4545
bool dinode, u64 *generation);
4646

4747
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
48-
extern void gfs2_rsqa_delete(struct gfs2_inode *ip, atomic_t *wcount);
48+
extern void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount);
4949
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
5050
u64 bstart, u32 blen, int meta);
5151
extern void gfs2_free_meta(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,

fs/gfs2/super.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,8 @@ static void gfs2_evict_inode(struct inode *inode)
14031403
truncate_inode_pages_final(&inode->i_data);
14041404
if (ip->i_qadata)
14051405
gfs2_assert_warn(sdp, ip->i_qadata->qa_ref == 0);
1406-
gfs2_rsqa_delete(ip, NULL);
1406+
gfs2_rs_delete(ip, NULL);
1407+
gfs2_qa_put(ip);
14071408
gfs2_ordered_del_inode(ip);
14081409
clear_inode(inode);
14091410
gfs2_dir_hash_inval(ip);

0 commit comments

Comments
 (0)