Make it compile post time-counter merge
This commit is contained in:
parent
2006fdaf3e
commit
c627e877cf
|
@ -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.
|
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#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
|
#define BFS_DEBUG
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -283,6 +283,9 @@ bfs_file_write(struct bfs *bfs, const char *fname, void *buf,
|
||||||
struct bfs_dirent *dirent;
|
struct bfs_dirent *dirent;
|
||||||
int8_t name[BFS_FILENAME_MAXLEN];
|
int8_t name[BFS_FILENAME_MAXLEN];
|
||||||
int err;
|
int err;
|
||||||
|
#ifdef _KERNEL
|
||||||
|
struct timespec ts;
|
||||||
|
#endif
|
||||||
|
|
||||||
strncpy(name, fname, BFS_FILENAME_MAXLEN);
|
strncpy(name, fname, BFS_FILENAME_MAXLEN);
|
||||||
|
|
||||||
|
@ -301,9 +304,10 @@ bfs_file_write(struct bfs *bfs, const char *fname, void *buf,
|
||||||
} else {
|
} else {
|
||||||
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
|
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
attr.atime = time.tv_sec;
|
getnanotime(&ts);
|
||||||
attr.ctime = time.tv_sec;
|
attr.atime = ts.tv_sec;
|
||||||
attr.mtime = time.tv_sec;
|
attr.ctime = ts.tv_sec;
|
||||||
|
attr.mtime = ts.tv_sec;
|
||||||
#endif
|
#endif
|
||||||
if ((err = bfs_file_create(bfs, name, buf, bufsz, &attr)) != 0)
|
if ((err = bfs_file_create(bfs, name, buf, bufsz, &attr)) != 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -37,9 +37,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#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/resource.h>
|
||||||
|
#include <sys/param.h>
|
||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <miscfs/genfs/genfs.h>
|
#include <miscfs/genfs/genfs.h>
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#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/param.h>
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
|
@ -237,17 +237,19 @@ sysvbfs_close(void *arg)
|
||||||
struct vnode *v = a->a_vp;
|
struct vnode *v = a->a_vp;
|
||||||
struct sysvbfs_node *bnode = v->v_data;
|
struct sysvbfs_node *bnode = v->v_data;
|
||||||
struct bfs_fileattr attr;
|
struct bfs_fileattr attr;
|
||||||
|
struct timespec ts;
|
||||||
|
|
||||||
DPRINTF("%s:\n", __FUNCTION__);
|
DPRINTF("%s:\n", __FUNCTION__);
|
||||||
uvm_vnp_setsize(v, bnode->size);
|
uvm_vnp_setsize(v, bnode->size);
|
||||||
|
|
||||||
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
|
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
|
||||||
|
getnanotime(&ts);
|
||||||
if (bnode->update_atime)
|
if (bnode->update_atime)
|
||||||
attr.atime = time.tv_sec;
|
attr.atime = ts.tv_sec;
|
||||||
if (bnode->update_ctime)
|
if (bnode->update_ctime)
|
||||||
attr.ctime = time.tv_sec;
|
attr.ctime = ts.tv_sec;
|
||||||
if (bnode->update_mtime)
|
if (bnode->update_mtime)
|
||||||
attr.mtime = time.tv_sec;
|
attr.mtime = ts.tv_sec;
|
||||||
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);
|
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);
|
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 sysvbfs_node *bnode = vp->v_data;
|
||||||
struct bfs_fileattr attr;
|
struct bfs_fileattr attr;
|
||||||
|
struct timespec ts;
|
||||||
|
|
||||||
DPRINTF("%s:\n", __FUNCTION__);
|
DPRINTF("%s:\n", __FUNCTION__);
|
||||||
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
|
memset(&attr, 0xff, sizeof attr); /* Set VNOVAL all */
|
||||||
|
getnanotime(&ts);
|
||||||
if (bnode->update_atime) {
|
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;
|
bnode->update_atime = FALSE;
|
||||||
}
|
}
|
||||||
if (bnode->update_ctime) {
|
if (bnode->update_ctime) {
|
||||||
attr.ctime = time.tv_sec;
|
attr.ctime = ts.tv_sec;
|
||||||
bnode->update_ctime = FALSE;
|
bnode->update_ctime = FALSE;
|
||||||
}
|
}
|
||||||
if (bnode->update_mtime) {
|
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;
|
bnode->update_mtime = FALSE;
|
||||||
}
|
}
|
||||||
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);
|
bfs_inode_set_attr(bnode->bmp->bfs, bnode->inode, &attr);
|
||||||
|
|
Loading…
Reference in New Issue