diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2021-01-29 19:56:37 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2021-02-22 21:16:22 +0100 |
commit | 71b219f4e50b12efffbc8107408e17904f9c47e6 (patch) | |
tree | 87661b4ba1ba89705219d21d7922c0a1a1482372 /fs/gfs2/log.c | |
parent | gfs2: Move function gfs2_ail_empty_tr (diff) | |
download | linux-71b219f4e50b12efffbc8107408e17904f9c47e6.tar.xz linux-71b219f4e50b12efffbc8107408e17904f9c47e6.zip |
gfs2: Minor calc_reserved cleanup
No functional change.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/gfs2/log.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 6fd4ded1e357..0c28ddd0e410 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -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) |