Add mnt_reservedvnlist so we can MFC to 4.x, in order to make all mount

structure changes now rather then piecemeal later on.  mnt_nvnodelist
currently holds all the vnodes under the mount point.  This will eventually
be split into a 'dirty' and 'clean' list.  This way we only break kld's once
rather then twice.  nvnodelist will eventually turn into the dirty list
and should remain compatible with the klds.
This commit is contained in:
Matthew Dillon 2001-11-04 18:55:42 +00:00
parent c405820b59
commit 6b8bd2efc1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86037
7 changed files with 14 additions and 0 deletions

View file

@ -177,6 +177,7 @@ msdosfs_mountroot()
mp->mnt_op = &msdosfs_vfsops;
mp->mnt_flag = 0;
TAILQ_INIT(&mp->mnt_nvnodelist);
TAILQ_INIT(&mp->mnt_reservedvnlist);
args.flags = 0;
args.uid = 0;

View file

@ -142,6 +142,7 @@ ext2_mountroot()
mp = bsd_malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK);
bzero((char *)mp, (u_long)sizeof(struct mount));
TAILQ_INIT(&mp->mnt_nvnodelist);
TAILQ_INIT(&mp->mnt_reservedvnlist);
mp->mnt_op = &ext2fs_vfsops;
mp->mnt_flag = MNT_RDONLY;
if (error = ext2_mountfs(rootvp, mp, td)) {

View file

@ -142,6 +142,7 @@ ext2_mountroot()
mp = bsd_malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK);
bzero((char *)mp, (u_long)sizeof(struct mount));
TAILQ_INIT(&mp->mnt_nvnodelist);
TAILQ_INIT(&mp->mnt_reservedvnlist);
mp->mnt_op = &ext2fs_vfsops;
mp->mnt_flag = MNT_RDONLY;
if (error = ext2_mountfs(rootvp, mp, td)) {

View file

@ -341,6 +341,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata)
*/
mp = malloc(sizeof(struct mount), M_MOUNT, M_WAITOK | M_ZERO);
TAILQ_INIT(&mp->mnt_nvnodelist);
TAILQ_INIT(&mp->mnt_reservedvnlist);
lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, LK_NOPAUSE);
(void)vfs_busy(mp, LK_NOWAIT, 0, td);
mp->mnt_op = vfsp->vfc_vfsops;

View file

@ -346,6 +346,7 @@ vfs_rootmountalloc(fstypename, devname, mpp)
lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, LK_NOPAUSE);
(void)vfs_busy(mp, LK_NOWAIT, 0, td);
TAILQ_INIT(&mp->mnt_nvnodelist);
TAILQ_INIT(&mp->mnt_reservedvnlist);
mp->mnt_vfc = vfsp;
mp->mnt_op = vfsp->vfc_vfsops;
mp->mnt_flag = MNT_RDONLY;

View file

@ -341,6 +341,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata)
*/
mp = malloc(sizeof(struct mount), M_MOUNT, M_WAITOK | M_ZERO);
TAILQ_INIT(&mp->mnt_nvnodelist);
TAILQ_INIT(&mp->mnt_reservedvnlist);
lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, LK_NOPAUSE);
(void)vfs_busy(mp, LK_NOWAIT, 0, td);
mp->mnt_op = vfsp->vfc_vfsops;

View file

@ -109,6 +109,13 @@ struct statfs {
* Structure per mounted file system. Each mounted file system has an
* array of operations and an instance record. The file systems are
* put on a doubly linked list.
*
* NOTE: mnt_nvnodelist and mnt_reservedvnlist. At the moment vnodes
* are linked into mnt_nvnodelist. At some point in the near future the
* vnode list will be split into a 'dirty' and 'clean' list. mnt_nvnodelist
* will become the dirty list and mnt_reservedvnlist will become the 'clean'
* list. Filesystem kld's syncing code should remain compatible since
* they only need to scan the dirty vnode list (nvnodelist -> dirtyvnodelist).
*/
TAILQ_HEAD(vnodelst, vnode);
@ -119,6 +126,7 @@ struct mount {
struct vnode *mnt_vnodecovered; /* vnode we mounted on */
struct vnode *mnt_syncer; /* syncer vnode */
struct vnodelst mnt_nvnodelist; /* list of vnodes this mount */
struct vnodelst mnt_reservedvnlist; /* (future) dirty vnode list */
struct lock mnt_lock; /* mount structure lock */
int mnt_writeopcount; /* write syscalls in progress */
int mnt_flag; /* flags shared with user */