GFS2: Remove rs_requested field from reservations
[firefly-linux-kernel-4.4.55.git] / fs / gfs2 / inode.c
index 753af3d86bbcecaa76f5c01cb54d81b0006c4fac..f2709ea887da9ef164ab28a8857625f495cbc8fc 100644 (file)
@@ -737,10 +737,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
                brelse(bh);
 
        gfs2_trans_end(sdp);
-       /* Check if we reserved space in the rgrp. Function link_dinode may
-          not, depending on whether alloc is required. */
-       if (gfs2_mb_reserved(dip))
-               gfs2_inplace_release(dip);
+       gfs2_inplace_release(dip);
        gfs2_quota_unlock(dip);
        mark_inode_dirty(inode);
        gfs2_glock_dq_uninit_m(2, ghs);
@@ -897,7 +894,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
                        goto out_gunlock_q;
 
                error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
-                                        gfs2_rg_blocks(dip) +
+                                        gfs2_rg_blocks(dip, sdp->sd_max_dirres) +
                                         2 * RES_DINODE + RES_STATFS +
                                         RES_QUOTA, 0);
                if (error)
@@ -1378,7 +1375,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
                        goto out_gunlock_q;
 
                error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
-                                        gfs2_rg_blocks(ndip) +
+                                        gfs2_rg_blocks(ndip, sdp->sd_max_dirres) +
                                         4 * RES_DINODE + 4 * RES_LEAF +
                                         RES_STATFS + RES_QUOTA + 4, 0);
                if (error)