diff options
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 3fee2fd3ae43..b1dcfab36465 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -472,7 +472,8 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, | |||
472 | struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; | 472 | struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; |
473 | struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master; | 473 | struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master; |
474 | struct buffer_head *l_bh; | 474 | struct buffer_head *l_bh; |
475 | int percent, sync_percent; | 475 | s64 x, y; |
476 | int need_sync = 0; | ||
476 | int error; | 477 | int error; |
477 | 478 | ||
478 | error = gfs2_meta_inode_buffer(l_ip, &l_bh); | 479 | error = gfs2_meta_inode_buffer(l_ip, &l_bh); |
@@ -486,16 +487,16 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, | |||
486 | l_sc->sc_free += free; | 487 | l_sc->sc_free += free; |
487 | l_sc->sc_dinodes += dinodes; | 488 | l_sc->sc_dinodes += dinodes; |
488 | gfs2_statfs_change_out(l_sc, l_bh->b_data + sizeof(struct gfs2_dinode)); | 489 | gfs2_statfs_change_out(l_sc, l_bh->b_data + sizeof(struct gfs2_dinode)); |
489 | if (m_sc->sc_free) | 490 | if (sdp->sd_args.ar_statfs_percent) { |
490 | percent = (100 * l_sc->sc_free) / m_sc->sc_free; | 491 | x = 100 * l_sc->sc_free; |
491 | else | 492 | y = m_sc->sc_free * sdp->sd_args.ar_statfs_percent; |
492 | percent = 100; | 493 | if (x >= y || x <= -y) |
494 | need_sync = 1; | ||
495 | } | ||
493 | spin_unlock(&sdp->sd_statfs_spin); | 496 | spin_unlock(&sdp->sd_statfs_spin); |
494 | 497 | ||
495 | brelse(l_bh); | 498 | brelse(l_bh); |
496 | sync_percent = sdp->sd_args.ar_statfs_percent; | 499 | if (need_sync) |
497 | if (sync_percent && (percent >= sync_percent || | ||
498 | percent <= -sync_percent)) | ||
499 | gfs2_wake_up_statfs(sdp); | 500 | gfs2_wake_up_statfs(sdp); |
500 | } | 501 | } |
501 | 502 | ||