Subject: Re: lfs_stats.segs_reclaimed always incremented?
To: None <tech-kern@netbsd.org>
From: Juan RP <juan@xtrarom.org>
List: tech-kern
Date: 05/25/2005 03:05:01
On Wed, 25 May 2005 02:22:18 +0200
Juan RP <juan@xtrarom.org> wrote:
> Shouldn't vfs.lfs.stats.segs_reclaimed be 0 in this case?
>
> Index: lfs_syscalls.c
> ===================================================================
> RCS file: /cvsroot/src/sys/ufs/lfs/lfs_syscalls.c,v
> retrieving revision 1.106
> diff -u -r1.106 lfs_syscalls.c
> --- lfs_syscalls.c 20 May 2005 19:48:25 -0000 1.106
> +++ lfs_syscalls.c 25 May 2005 00:15:22 -0000
> @@ -877,6 +877,7 @@
> int
> lfs_do_segclean(struct lfs *fs, unsigned long segnum)
> {
> + extern int lfs_dostats;
> struct buf *bp;
> CLEANERINFO *cip;
> SEGUSE *sup;
> @@ -933,7 +934,8 @@
> (void) LFS_BWRITE_LOG(bp);
> wakeup(&fs->lfs_avail);
>
> - ++lfs_stats.segs_reclaimed;
> + if (lfs_dostats)
> + ++lfs_stats.segs_reclaimed;
>
> return (0);
> }
Hmm, looks like we'll have to include <sys/sysctl.h> to get the value
of lfs_dostats.