Author: pfg
Date: Thu Dec 26 01:11:51 2013
New Revision: 259903
URL: http://svnweb.freebsd.org/changeset/base/259903

Log:
  MFC   r252397, r258904, r259780:
  Small ext2fs updates.
  
  Use the unsigned random() range in i_gen.
  Add two new reserved inodes.
  Make the hashing algorithm match the linux code.
  
  PR:           kern/183230

Modified:
  stable/9/sys/fs/ext2fs/ext2_dinode.h
  stable/9/sys/fs/ext2fs/ext2_hash.c
  stable/9/sys/fs/ext2fs/ext2_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_dinode.h        Thu Dec 26 00:11:19 2013        
(r259902)
+++ stable/9/sys/fs/ext2fs/ext2_dinode.h        Thu Dec 26 01:11:51 2013        
(r259903)
@@ -44,6 +44,8 @@
 #define        EXT2_UNDELDIRINO        ((ino_t)6)
 #define        EXT2_RESIZEINO          ((ino_t)7)
 #define        EXT2_JOURNALINO         ((ino_t)8)
+#define        EXT2_EXCLUDEINO         ((ino_t)9)
+#define        EXT2_REPLICAINO         ((ino_t)10)
 #define        EXT2_FIRSTINO           ((ino_t)11)
 
 /*

Modified: stable/9/sys/fs/ext2fs/ext2_hash.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_hash.c  Thu Dec 26 00:11:19 2013        
(r259902)
+++ stable/9/sys/fs/ext2fs/ext2_hash.c  Thu Dec 26 01:11:51 2013        
(r259903)
@@ -289,8 +289,8 @@ ext2_htree_hash(const char *name, int le
                        len -= 32;
                        name += 32;
                }
-               major = hash[0];
-               minor = hash[1];
+               major = hash[1];
+               minor = hash[2];
                break;
        default:
                goto error;

Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_vfsops.c        Thu Dec 26 00:11:19 2013        
(r259902)
+++ stable/9/sys/fs/ext2fs/ext2_vfsops.c        Thu Dec 26 01:11:51 2013        
(r259903)
@@ -1006,7 +1006,7 @@ ext2_vget(struct mount *mp, ino_t ino, i
         * already have one. This should only happen on old filesystems.
         */
        if (ip->i_gen == 0) {
-               ip->i_gen = random() / 2 + 1;
+               ip->i_gen = random() + 1;
                if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0)
                        ip->i_flag |= IN_MODIFIED;
        }
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to