Make it compile post time-counter merge

This commit is contained in:
martin 2006-07-01 08:42:39 +00:00
parent 2006fdaf3e
commit c627e877cf
3 changed files with 24 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bfs.c,v 1.2 2006/01/26 16:27:43 tsutsui Exp $ */
/* $NetBSD: bfs.c,v 1.3 2006/07/01 08:42:39 martin Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bfs.c,v 1.2 2006/01/26 16:27:43 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: bfs.c,v 1.3 2006/07/01 08:42:39 martin Exp $");
#define BFS_DEBUG
#include <sys/param.h>
@ -283,6 +283,9 @@ bfs_file_write(struct bfs *bfs, const char *fname, void *buf,
struct bfs_dirent *dirent;
int8_t name[BFS_FILENAME_MAXLEN];
int err;
#ifdef _KERNEL
struct timespec ts;
#endif
strncpy(name, fname, BFS_FILENAME_MAXLEN);
@ -301,9 +304,10 @@ bfs_file_write(struct bfs *bfs, const char *fname, void *buf,
} else {
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
#ifdef _KERNEL
attr.atime = time.tv_sec;
attr.ctime = time.tv_sec;
attr.mtime = time.tv_sec;
getnanotime(&ts);
attr.atime = ts.tv_sec;
attr.ctime = ts.tv_sec;
attr.mtime = ts.tv_sec;
#endif
if ((err = bfs_file_create(bfs, name, buf, bufsz, &attr)) != 0)
return err;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysvbfs.c,v 1.1 2005/12/29 14:53:45 tsutsui Exp $ */
/* $NetBSD: sysvbfs.c,v 1.2 2006/07/01 08:42:39 martin Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -37,9 +37,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysvbfs.c,v 1.1 2005/12/29 14:53:45 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysvbfs.c,v 1.2 2006/07/01 08:42:39 martin Exp $");
#include <sys/resource.h>
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <miscfs/genfs/genfs.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysvbfs_vnops.c,v 1.3 2006/05/15 12:51:21 yamt Exp $ */
/* $NetBSD: sysvbfs_vnops.c,v 1.4 2006/07/01 08:42:39 martin Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.3 2006/05/15 12:51:21 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.4 2006/07/01 08:42:39 martin Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -237,17 +237,19 @@ sysvbfs_close(void *arg)
struct vnode *v = a->a_vp;
struct sysvbfs_node *bnode = v->v_data;
struct bfs_fileattr attr;
struct timespec ts;
DPRINTF("%s:\n", __FUNCTION__);
uvm_vnp_setsize(v, bnode->size);
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
getnanotime(&ts);
if (bnode->update_atime)
attr.atime = time.tv_sec;
attr.atime = ts.tv_sec;
if (bnode->update_ctime)
attr.ctime = time.tv_sec;
attr.ctime = ts.tv_sec;
if (bnode->update_mtime)
attr.mtime = time.tv_sec;
attr.mtime = ts.tv_sec;
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);
VOP_FSYNC(a->a_vp, a->a_cred, FSYNC_WAIT, 0, 0, a->a_l);
@ -799,19 +801,21 @@ sysvbfs_update(struct vnode *vp, const struct timespec *acc,
{
struct sysvbfs_node *bnode = vp->v_data;
struct bfs_fileattr attr;
struct timespec ts;
DPRINTF("%s:\n", __FUNCTION__);
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
getnanotime(&ts);
if (bnode->update_atime) {
attr.atime = acc ? acc->tv_sec : time.tv_sec;
attr.atime = acc ? acc->tv_sec : ts.tv_sec;
bnode->update_atime = FALSE;
}
if (bnode->update_ctime) {
attr.ctime = time.tv_sec;
attr.ctime = ts.tv_sec;
bnode->update_ctime = FALSE;
}
if (bnode->update_mtime) {
attr.mtime = mod ? mod->tv_sec : time.tv_sec;
attr.mtime = mod ? mod->tv_sec : ts.tv_sec;
bnode->update_mtime = FALSE;
}
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);