Skip to content

Commit 71b219f

Browse files
author
Andreas Gruenbacher
committed
gfs2: Minor calc_reserved cleanup
No functional change. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 76fce65 commit 71b219f

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

fs/gfs2/log.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -546,17 +546,14 @@ static inline unsigned int log_distance(struct gfs2_sbd *sdp, unsigned int newer
546546
static unsigned int calc_reserved(struct gfs2_sbd *sdp)
547547
{
548548
unsigned int reserved = 0;
549-
unsigned int mbuf;
550-
unsigned int dbuf;
549+
unsigned int blocks;
551550
struct gfs2_trans *tr = sdp->sd_log_tr;
552551

553552
if (tr) {
554-
mbuf = tr->tr_num_buf_new - tr->tr_num_buf_rm;
555-
dbuf = tr->tr_num_databuf_new - tr->tr_num_databuf_rm;
556-
reserved = mbuf + dbuf;
557-
/* Account for header blocks */
558-
reserved += DIV_ROUND_UP(mbuf, buf_limit(sdp));
559-
reserved += DIV_ROUND_UP(dbuf, databuf_limit(sdp));
553+
blocks = tr->tr_num_buf_new - tr->tr_num_buf_rm;
554+
reserved += blocks + DIV_ROUND_UP(blocks, buf_limit(sdp));
555+
blocks = tr->tr_num_databuf_new - tr->tr_num_databuf_rm;
556+
reserved += blocks + DIV_ROUND_UP(blocks, databuf_limit(sdp));
560557
}
561558

562559
if (sdp->sd_log_committed_revoke > 0)

0 commit comments

Comments
 (0)