--- src/sys/kern/vfs_mount.c 2008/07/14 22:16:35 1.36 +++ src/sys/kern/vfs_mount.c 2008/09/17 21:44:18 1.37 @@ -364,6 +364,26 @@ vfs_getnewfsid(struct mount *mp) } /* + * Set the FSID for a new mount point to the template. Adjust + * the FSID to avoid collisions. + */ +int +vfs_setfsid(struct mount *mp, fsid_t *template) +{ + int didmunge = 0; + + bzero(&mp->mnt_stat.f_fsid, sizeof(mp->mnt_stat.f_fsid)); + for (;;) { + if (vfs_getvfs(template) == NULL) + break; + didmunge = 1; + ++template->val[1]; + } + mp->mnt_stat.f_fsid = *template; + return(didmunge); +} + +/* * This routine is called when we have too many vnodes. It attempts * to free vnodes and will potentially free vnodes that still * have VM backing store (VM backing store is typically the cause