gfs2: Minor calc_reserved cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 29 Jan 2021 18:56:37 +0000 (19:56 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 22 Feb 2021 20:16:22 +0000 (21:16 +0100)
No functional change.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/log.c

index 6fd4ded1e357c2681b6455c169992508c7b4cf84..0c28ddd0e4103eb33cde646f47198b445da6a51f 100644 (file)
@@ -546,17 +546,14 @@ static inline unsigned int log_distance(struct gfs2_sbd *sdp, unsigned int newer
 static unsigned int calc_reserved(struct gfs2_sbd *sdp)
 {
        unsigned int reserved = 0;
-       unsigned int mbuf;
-       unsigned int dbuf;
+       unsigned int blocks;
        struct gfs2_trans *tr = sdp->sd_log_tr;
 
        if (tr) {
-               mbuf = tr->tr_num_buf_new - tr->tr_num_buf_rm;
-               dbuf = tr->tr_num_databuf_new - tr->tr_num_databuf_rm;
-               reserved = mbuf + dbuf;
-               /* Account for header blocks */
-               reserved += DIV_ROUND_UP(mbuf, buf_limit(sdp));
-               reserved += DIV_ROUND_UP(dbuf, databuf_limit(sdp));
+               blocks = tr->tr_num_buf_new - tr->tr_num_buf_rm;
+               reserved += blocks + DIV_ROUND_UP(blocks, buf_limit(sdp));
+               blocks = tr->tr_num_databuf_new - tr->tr_num_databuf_rm;
+               reserved += blocks + DIV_ROUND_UP(blocks, databuf_limit(sdp));
        }
 
        if (sdp->sd_log_committed_revoke > 0)