diff options
author | pfg <pfg@FreeBSD.org> | 2013-07-01 21:43:40 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-07-01 21:43:40 +0000 |
commit | 185a8665597b62cfcd82e3f348aa6d6c792e63c8 (patch) | |
tree | 3ab8a2f25b5023eb2fd1820681085e407e9ce14e /sys/ufs/ffs | |
parent | 6c0077645170ac68acbd97326e4bc61088e97b70 (diff) | |
download | FreeBSD-src-185a8665597b62cfcd82e3f348aa6d6c792e63c8.zip FreeBSD-src-185a8665597b62cfcd82e3f348aa6d6c792e63c8.tar.gz |
Change i_gen in UFS to an unsigned type.
Revert the simplification of the i_gen calculation.
It is still a good idea to avoid zero values and for the case
of old filesystems there is probably no advantage in using
the complete 32 bits anyways.
Discussed with: bde
MFC after: 4 weeks
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 57d86db..890aa78 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random(); + ip->i_gen = arc4random()/2 + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); |