Just increment the generation count. Using the time is bogus and defeats

fsirand(8).
This commit is contained in:
mycroft 1997-03-10 06:18:28 +00:00
parent 72b0837ae3
commit 66c4e32b11
4 changed files with 6 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_alloc.c,v 1.13 1996/10/12 21:58:44 christos Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.14 1997/03/10 06:18:28 mycroft Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -53,8 +53,6 @@
#include <ufs/ffs/fs.h>
#include <ufs/ffs/ffs_extern.h>
extern u_long nextgennumber;
static daddr_t ffs_alloccg __P((struct inode *, int, daddr_t, int));
static daddr_t ffs_alloccgblk __P((struct fs *, struct cg *, daddr_t));
static daddr_t ffs_clusteralloc __P((struct inode *, int, daddr_t, int));
@ -563,9 +561,7 @@ ffs_valloc(v)
/*
* Set up a new generation number for this inode.
*/
if (++nextgennumber < (u_long)time.tv_sec)
nextgennumber = time.tv_sec;
ip->i_gen = nextgennumber;
ip->i_gen++;
return (0);
noinodes:
ffs_fserr(fs, ap->a_cred->cr_uid, "out of inodes");

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vfsops.c,v 1.23 1997/01/31 03:05:31 thorpej Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.24 1997/03/10 06:18:29 mycroft Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@ -80,8 +80,6 @@ struct vfsops ffs_vfsops = {
ffs_mountroot,
};
extern u_long nextgennumber;
/*
* Called by main() when ufs is going to be mounted as root.
*
@ -847,17 +845,6 @@ ffs_vget(mp, ino, vpp)
*/
ip->i_devvp = ump->um_devvp;
VREF(ip->i_devvp);
/*
* Set up a generation number for this inode if it does not
* already have one. This should only happen on old filesystems.
*/
if (ip->i_gen == 0) {
if (++nextgennumber < (u_long)time.tv_sec)
nextgennumber = time.tv_sec;
ip->i_gen = nextgennumber;
if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0)
ip->i_flag |= IN_MODIFIED;
}
/*
* Ensure that uid and gid are correct. This is a temporary
* fix until fsck has been changed to do the update.

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_alloc.c,v 1.6 1996/10/12 21:58:49 christos Exp $ */
/* $NetBSD: lfs_alloc.c,v 1.7 1997/03/10 06:18:30 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -54,8 +54,6 @@
#include <ufs/lfs/lfs.h>
#include <ufs/lfs/lfs_extern.h>
extern u_long nextgennumber;
/* Allocate a new inode. */
/* ARGSUSED */
int
@ -131,9 +129,7 @@ lfs_valloc(v)
ip->i_din.di_inumber = new_ino;
/* Set a new generation number for this inode. */
if (++nextgennumber < (u_long)time.tv_sec)
nextgennumber = time.tv_sec;
ip->i_gen = nextgennumber;
ip->i_gen++;
/* Insert into the inode hash table. */
ufs_ihashins(ip);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_inode.c,v 1.7 1996/05/11 18:27:52 mycroft Exp $ */
/* $NetBSD: ufs_inode.c,v 1.8 1997/03/10 06:18:31 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -54,8 +54,6 @@
#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/ufs_extern.h>
u_long nextgennumber; /* Next generation number to assign. */
void
ufs_init()
{