Commit 5a4e9c60 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher

gfs2: Minor gfs2_write_revokes cleanups

Clean up the computations in gfs2_write_revokes (no change in functionality).
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 458094c2
...@@ -712,11 +712,13 @@ void gfs2_glock_remove_revoke(struct gfs2_glock *gl) ...@@ -712,11 +712,13 @@ void gfs2_glock_remove_revoke(struct gfs2_glock *gl)
void gfs2_write_revokes(struct gfs2_sbd *sdp) void gfs2_write_revokes(struct gfs2_sbd *sdp)
{ {
/* number of revokes we still have room for */ /* 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); gfs2_log_lock(sdp);
while (sdp->sd_log_num_revoke > max_revokes) max_revokes = sdp->sd_ldptrs;
max_revokes += (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header)) / sizeof(u64); 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; max_revokes -= sdp->sd_log_num_revoke;
if (!sdp->sd_log_num_revoke) { if (!sdp->sd_log_num_revoke) {
atomic_dec(&sdp->sd_log_blks_free); atomic_dec(&sdp->sd_log_blks_free);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment