summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
committerphk <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
commit9b703b14551addf9806978973e2ddc427d4908b4 (patch)
tree91f2de8432f719153d0de9465a9ebeee33c29077 /sys/gnu/fs
parentadd2782c4ec0d7c4447da2b33d1413a2754f8a3e (diff)
downloadFreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.zip
FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.tar.gz
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
Diffstat (limited to 'sys/gnu/fs')
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_readwrite.c2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vnops.c10
4 files changed, 9 insertions, 9 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c
index 5231fec..92ea5bf 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode.c
@@ -109,7 +109,7 @@ ext2_update(vp, access, modify, waitfor)
ip->i_modrev++;
}
if (ip->i_flag & IN_CHANGE) {
- ip->i_ctime = time.tv_sec;
+ ip->i_ctime = time_second;
}
ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
fs = ip->i_e2fs;
@@ -171,7 +171,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
return EFBIG;
oip = VTOI(ovp);
- gettime(&tv);
+ getmicrotime(&tv);
if (ovp->v_type == VLNK &&
oip->i_size < ovp->v_mount->mnt_maxsymlinklen) {
#if DIAGNOSTIC
diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c
index 68522e5..b49666a 100644
--- a/sys/gnu/fs/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c
@@ -289,7 +289,7 @@ WRITE(ap)
uio->uio_resid = resid;
}
} else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
- gettime(&tv);
+ getmicrotime(&tv);
error = UFS_UPDATE(vp, &tv, &tv, 1);
}
return (error);
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 635876b..9a8dad14 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -837,7 +837,7 @@ ext2_sync(mp, waitfor, cred, p)
panic("update: rofs mod");
}
fs->s_dirt = 0;
- fs->s_es->s_wtime = time.tv_sec;
+ fs->s_es->s_wtime = time_second;
allerror = ext2_sbupdate(ump, waitfor);
}
/*
diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c
index bb2a373..61a0a5a 100644
--- a/sys/gnu/fs/ext2fs/ext2_vnops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vnops.c
@@ -229,7 +229,7 @@ loop:
#endif
}
splx(s);
- gettime(&tv);
+ getmicrotime(&tv);
return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
@@ -354,7 +354,7 @@ ext2_link(ap)
}
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- gettime(&tv);
+ getmicrotime(&tv);
error = UFS_UPDATE(vp, &tv, &tv, 1);
if (!error)
error = ext2_direnter(ip, tdvp, cnp);
@@ -526,7 +526,7 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- gettime(&tv);
+ getmicrotime(&tv);
if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
@@ -897,7 +897,7 @@ ext2_mkdir(ap)
ip->i_nlink = 2;
if (cnp->cn_flags & ISWHITEOUT)
ip->i_flags |= UF_OPAQUE;
- gettime(&tv);
+ getmicrotime(&tv);
error = UFS_UPDATE(tvp, &tv, &tv, 1);
/*
@@ -1178,7 +1178,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- gettime(&tv);
+ getmicrotime(&tv);
error = UFS_UPDATE(tvp, &tv, &tv, 1);
if (error)
goto bad;
OpenPOWER on IntegriCloud