diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2020-12-06 13:32:54 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2021-01-19 21:17:07 +0100 |
commit | 5a4e9c607e03886815121fa975fcd8e0fa7252fe (patch) | |
tree | 146b0059501ab9a6fd70eadd3fda2c5001d3a616 /fs/gfs2/log.c | |
parent | 458094c2c6115cda721fd11a56f7e4f27cddd5b1 (diff) | |
download | linux-5a4e9c607e03886815121fa975fcd8e0fa7252fe.tar.gz linux-5a4e9c607e03886815121fa975fcd8e0fa7252fe.tar.bz2 linux-5a4e9c607e03886815121fa975fcd8e0fa7252fe.zip |
gfs2: Minor gfs2_write_revokes cleanups
Clean up the computations in gfs2_write_revokes (no change in functionality).
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r-- | fs/gfs2/log.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 2e9314091c81..ccce17fe605f 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -712,11 +712,13 @@ void gfs2_glock_remove_revoke(struct gfs2_glock *gl) void gfs2_write_revokes(struct gfs2_sbd *sdp) { /* number of revokes we still have room for */ - int max_revokes = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) / sizeof(u64); + unsigned int max_revokes; gfs2_log_lock(sdp); - while (sdp->sd_log_num_revoke > max_revokes) - max_revokes += (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header)) / sizeof(u64); + max_revokes = sdp->sd_ldptrs; + if (sdp->sd_log_num_revoke > sdp->sd_ldptrs) + max_revokes += roundup(sdp->sd_log_num_revoke - sdp->sd_ldptrs, + sdp->sd_inptrs); max_revokes -= sdp->sd_log_num_revoke; if (!sdp->sd_log_num_revoke) { atomic_dec(&sdp->sd_log_blks_free); |