diff options
author | pfg <pfg@FreeBSD.org> | 2013-07-01 03:00:15 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-07-01 03:00:15 +0000 |
commit | 5eeda65400daadfcae0484d6e00abf8b37c2be21 (patch) | |
tree | bc01175493e103eb5471e847d6d525fa988d944c /sys/ufs/ffs | |
parent | 8a0279994de9e2e860de4a740b1a7b6dfec51e3e (diff) | |
download | FreeBSD-src-5eeda65400daadfcae0484d6e00abf8b37c2be21.zip FreeBSD-src-5eeda65400daadfcae0484d6e00abf8b37c2be21.tar.gz |
Change i_gen in UFS to an unsigned type.
In UFS, i_gen is a random generated value and there is not way for
it to be negative. Actually, the value of i_gen is just used to
match bit patterns and it is of not consequence if the values are
signed or not.
Following other filesystems, set it to unsigned and use it as such,
Discussed by: mckusick
Reviewed by: mckusick (previous version)
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 57f092c..19b5615 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() / 2 + 1; + ip->i_gen = arc4random() + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); |