diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-21 23:50:39 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-21 23:50:39 +0000 |
commit | ee05a750df8c3f9f5d686affb4df7e316507797a (patch) | |
tree | 887af571215b85d480946bb169aafa0605c786db /sys/ufs | |
parent | e84c5b85eb5d0fc9af7eb3cdcc77a22eb07dec74 (diff) |
First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.
ok art@ niklas@ nordin@
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_alloc.c | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 10 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 12 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_alloc.c | 6 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_bio.c | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/inode.h | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 22 |
8 files changed, 35 insertions, 35 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_alloc.c b/sys/ufs/ext2fs/ext2fs_alloc.c index 20fb531ad79..49302e497ff 100644 --- a/sys/ufs/ext2fs/ext2fs_alloc.c +++ b/sys/ufs/ext2fs/ext2fs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_alloc.c,v 1.14 2004/01/20 03:44:06 tedu Exp $ */ +/* $OpenBSD: ext2fs_alloc.c,v 1.15 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: ext2fs_alloc.c,v 1.10 2001/07/05 08:38:27 toshii Exp $ */ /* @@ -176,8 +176,8 @@ ext2fs_inode_alloc(struct inode *pip, int mode, struct ucred *cred, /* * Set up a new generation number for this inode. */ - if (++ext2gennumber < (u_long)time.tv_sec) - ext2gennumber = time.tv_sec; + if (++ext2gennumber < (u_long)time_second) + ext2gennumber = time_second; ip->i_e2fs_gen = ext2gennumber; return (0); noinodes: diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index f8bc26959c4..fbb13d1458f 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.33 2004/06/04 08:06:04 tedu Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.34 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -310,7 +310,7 @@ ext2fs_mount(mp, path, data, ndp, p) if (fs->e2fs_fmod != 0) { /* XXX */ fs->e2fs_fmod = 0; if (fs->e2fs.e2fs_state == 0) - fs->e2fs.e2fs_wtime = time.tv_sec; + fs->e2fs.e2fs_wtime = time_second; else printf("%s: file system not clean; please fsck(8)\n", mp->mnt_stat.f_mntfromname); @@ -812,7 +812,7 @@ ext2fs_sync(mp, waitfor, cred, p) */ if (fs->e2fs_fmod != 0) { fs->e2fs_fmod = 0; - fs->e2fs.e2fs_wtime = time.tv_sec; + fs->e2fs.e2fs_wtime = time_second; if ((error = ext2fs_cgupdate(ump, waitfor))) allerror = error; } @@ -924,8 +924,8 @@ ext2fs_vget(mp, ino, vpp) * already have one. This should only happen on old filesystems. */ if (ip->i_e2fs_gen == 0) { - if (++ext2gennumber < (u_long)time.tv_sec) - ext2gennumber = time.tv_sec; + if (++ext2gennumber < (u_long)time_second) + ext2gennumber = time_second; ip->i_e2fs_gen = ext2gennumber; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) ip->i_flag |= IN_MODIFIED; diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index c41fbb14235..2a43bc7cc07 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_alloc.c,v 1.46 2004/01/20 03:44:06 tedu Exp $ */ +/* $OpenBSD: ffs_alloc.c,v 1.47 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */ /* @@ -941,7 +941,7 @@ ffs_fragextend(ip, cg, bprev, osize, nsize) brelse(bp); return (0); } - cgp->cg_time = time.tv_sec; + cgp->cg_time = time_second; bno = dtogd(fs, bprev); for (i = numfrags(fs, osize); i < frags; i++) if (isclr(cg_blksfree(cgp), bno + i)) { @@ -1008,7 +1008,7 @@ ffs_alloccg(ip, cg, bpref, size) brelse(bp); return (0); } - cgp->cg_time = time.tv_sec; + cgp->cg_time = time_second; if (size == fs->fs_bsize) { bno = ffs_alloccgblk(ip, bp, bpref); bdwrite(bp); @@ -1339,7 +1339,7 @@ ffs_nodealloccg(ip, cg, ipref, mode) brelse(bp); return (0); } - cgp->cg_time = time.tv_sec; + cgp->cg_time = time_second; if (ipref) { ipref %= fs->fs_ipg; if (isclr(cg_inosused(cgp), ipref)) @@ -1432,7 +1432,7 @@ ffs_blkfree(ip, bno, size) brelse(bp); return; } - cgp->cg_time = time.tv_sec; + cgp->cg_time = time_second; bno = dtogd(fs, bno); if (size == fs->fs_bsize) { blkno = fragstoblks(fs, bno); @@ -1538,7 +1538,7 @@ ffs_freefile(struct inode *pip, ino_t ino, int mode) brelse(bp); return (0); } - cgp->cg_time = time.tv_sec; + cgp->cg_time = time_second; ino %= fs->fs_ipg; if (isclr(cg_inosused(cgp), ino)) { printf("dev = 0x%x, ino = %d, fs = %s\n", diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index ead5f75652f..bd80d00dc65 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.65 2004/06/04 08:06:05 tedu Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.66 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1340,7 +1340,7 @@ ffs_sbupdate(mp, waitfor) bp = getblk(mp->um_devvp, SBOFF >> (fs->fs_fshift - fs->fs_fsbtodb), (int)fs->fs_sbsize, 0, 0); fs->fs_fmod = 0; - fs->fs_time = time.tv_sec; + fs->fs_time = time_second; bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); /* Restore compatibility to old file systems. XXX */ dfs = (struct fs *)bp->b_data; /* XXX */ diff --git a/sys/ufs/lfs/lfs_alloc.c b/sys/ufs/lfs/lfs_alloc.c index c0474be5f56..da823b14c1d 100644 --- a/sys/ufs/lfs/lfs_alloc.c +++ b/sys/ufs/lfs/lfs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_alloc.c,v 1.10 2003/06/02 23:28:23 millert Exp $ */ +/* $OpenBSD: lfs_alloc.c,v 1.11 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: lfs_alloc.c,v 1.4 1996/03/25 12:53:37 pk Exp $ */ /* @@ -129,8 +129,8 @@ lfs_valloc(v) ip->i_din.ffs_din.di_inumber = new_ino; /* Set a new generation number for this inode. */ - if (++nextgennumber < (u_long)time.tv_sec) - nextgennumber = time.tv_sec; + if (++nextgennumber < (u_long)time_second) + nextgennumber = time_second; ip->i_ffs_gen = nextgennumber; /* Insert into the inode hash table. */ diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c index 0f9dde05755..8ed1e7ca754 100644 --- a/sys/ufs/lfs/lfs_bio.c +++ b/sys/ufs/lfs/lfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_bio.c,v 1.10 2003/06/02 23:28:23 millert Exp $ */ +/* $OpenBSD: lfs_bio.c,v 1.11 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: lfs_bio.c,v 1.5 1996/02/09 22:28:49 christos Exp $ */ /* @@ -120,7 +120,7 @@ lfs_bwrite(v) ++locked_queue_count; bp->b_flags |= B_LOCKED; TAILQ_INSERT_TAIL(&bdirties, bp, b_synclist); - bp->b_synctime = time.tv_sec + 30; + bp->b_synctime = time_second + 30; s = splbio(); if (bdirties.tqh_first == bp) { if (timeout_triggered(&wakeup_timeout)) diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 7374786db6d..1106506a099 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: inode.h,v 1.25 2004/01/20 03:44:06 tedu Exp $ */ +/* $OpenBSD: inode.h,v 1.26 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: inode.h,v 1.8 1995/06/15 23:22:50 cgd Exp $ */ /* @@ -274,7 +274,7 @@ struct indir { (ip)->i_modrev++; \ } \ if ((ip)->i_flag & IN_CHANGE) \ - (ip)->i_ffs_ctime = time.tv_sec; \ + (ip)->i_ffs_ctime = time_second; \ (ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \ } \ } @@ -289,7 +289,7 @@ struct indir { (ip)->i_modrev++; \ } \ if ((ip)->i_flag & IN_CHANGE) \ - (ip)->i_e2fs_ctime = time.tv_sec; \ + (ip)->i_e2fs_ctime = time_second; \ (ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \ } \ } diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 63c9610a9fe..1659cfd306e 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_quota.c,v 1.16 2004/01/20 03:44:06 tedu Exp $ */ +/* $OpenBSD: ufs_quota.c,v 1.17 2004/06/21 23:50:38 tholo Exp $ */ /* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */ /* @@ -285,7 +285,7 @@ chkdqchg(ip, change, cred, type) */ if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) { if (dq->dq_curblocks < dq->dq_bsoftlimit) { - dq->dq_btime = time.tv_sec + + dq->dq_btime = time_second + ip->i_ump->um_btime[type]; if (ip->i_ffs_uid == cred->cr_uid) uprintf("\n%s: warning, %s %s\n", @@ -293,7 +293,7 @@ chkdqchg(ip, change, cred, type) quotatypes[type], "disk quota exceeded"); return (0); } - if (time.tv_sec > dq->dq_btime) { + if (time_second > dq->dq_btime) { if ((dq->dq_flags & DQ_BLKS) == 0 && ip->i_ffs_uid == cred->cr_uid) { uprintf("\n%s: write failed, %s %s\n", @@ -408,7 +408,7 @@ chkiqchg(ip, change, cred, type) */ if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) { if (dq->dq_curinodes < dq->dq_isoftlimit) { - dq->dq_itime = time.tv_sec + + dq->dq_itime = time_second + ip->i_ump->um_itime[type]; if (ip->i_ffs_uid == cred->cr_uid) uprintf("\n%s: warning, %s %s\n", @@ -416,7 +416,7 @@ chkiqchg(ip, change, cred, type) quotatypes[type], "inode quota exceeded"); return (0); } - if (time.tv_sec > dq->dq_itime) { + if (time_second > dq->dq_itime) { if ((dq->dq_flags & DQ_INODS) == 0 && ip->i_ffs_uid == cred->cr_uid) { uprintf("\n%s: write failed, %s %s\n", @@ -678,11 +678,11 @@ setquota(mp, id, type, addr) if (newlim.dqb_bsoftlimit && dq->dq_curblocks >= newlim.dqb_bsoftlimit && (dq->dq_bsoftlimit == 0 || dq->dq_curblocks < dq->dq_bsoftlimit)) - newlim.dqb_btime = time.tv_sec + ump->um_btime[type]; + newlim.dqb_btime = time_second + ump->um_btime[type]; if (newlim.dqb_isoftlimit && dq->dq_curinodes >= newlim.dqb_isoftlimit && (dq->dq_isoftlimit == 0 || dq->dq_curinodes < dq->dq_isoftlimit)) - newlim.dqb_itime = time.tv_sec + ump->um_itime[type]; + newlim.dqb_itime = time_second + ump->um_itime[type]; dq->dq_dqb = newlim; if (dq->dq_curblocks < dq->dq_bsoftlimit) dq->dq_flags &= ~DQ_BLKS; @@ -730,10 +730,10 @@ setuse(mp, id, type, addr) */ if (dq->dq_bsoftlimit && dq->dq_curblocks < dq->dq_bsoftlimit && usage.dqb_curblocks >= dq->dq_bsoftlimit) - dq->dq_btime = time.tv_sec + ump->um_btime[type]; + dq->dq_btime = time_second + ump->um_btime[type]; if (dq->dq_isoftlimit && dq->dq_curinodes < dq->dq_isoftlimit && usage.dqb_curinodes >= dq->dq_isoftlimit) - dq->dq_itime = time.tv_sec + ump->um_itime[type]; + dq->dq_itime = time_second + ump->um_itime[type]; dq->dq_curblocks = usage.dqb_curblocks; dq->dq_curinodes = usage.dqb_curinodes; if (dq->dq_curblocks < dq->dq_bsoftlimit) @@ -938,9 +938,9 @@ dqget(vp, id, ump, type, dqp) dq->dq_flags |= DQ_FAKE; if (dq->dq_id != 0) { if (dq->dq_btime == 0) - dq->dq_btime = time.tv_sec + ump->um_btime[type]; + dq->dq_btime = time_second + ump->um_btime[type]; if (dq->dq_itime == 0) - dq->dq_itime = time.tv_sec + ump->um_itime[type]; + dq->dq_itime = time_second + ump->um_itime[type]; } *dqp = dq; return (0); |