aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 285dd363199a..d4d10fadab79 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -661,14 +661,13 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
661/** 661/**
662 * gfs2_rs_delete - delete a multi-block reservation 662 * gfs2_rs_delete - delete a multi-block reservation
663 * @ip: The inode for this reservation 663 * @ip: The inode for this reservation
664 * @wcount: The inode's write count, or NULL
664 * 665 *
665 */ 666 */
666void gfs2_rs_delete(struct gfs2_inode *ip) 667void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
667{ 668{
668 struct inode *inode = &ip->i_inode;
669
670 down_write(&ip->i_rw_mutex); 669 down_write(&ip->i_rw_mutex);
671 if (ip->i_res && atomic_read(&inode->i_writecount) <= 1) { 670 if (ip->i_res && ((wcount == NULL) || (atomic_read(wcount) <= 1))) {
672 gfs2_rs_deltree(ip->i_res); 671 gfs2_rs_deltree(ip->i_res);
673 BUG_ON(ip->i_res->rs_free); 672 BUG_ON(ip->i_res->rs_free);
674 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res); 673 kmem_cache_free(gfs2_rsrv_cachep, ip->i_res);