Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Remove miscfs/syncfs and



details:   https://anonhg.NetBSD.org/src/rev/93961f6672dc
branches:  trunk
changeset: 337984:93961f6672dc
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed May 06 15:57:07 2015 +0000

description:
Remove miscfs/syncfs and

- move the syncer into kern/vfs_subr.c.

- change the syncer to process the mountlist and VFS_SYNC as appropriate.

- use an API for mount points similiar to the API for vnodes:
  - vfs_syncer_add_to_worklist(struct mount *mp) to add
  - vfs_syncer_remove_from_worklist(struct mount *mp) to remove a mount.

No objections on tech-kern@

diffstat:

 distrib/sets/lists/base/mi                |    4 +-
 distrib/sets/lists/comp/mi                |    4 +-
 external/cddl/osnet/sys/kern/vfs.c        |    9 +-
 sys/coda/coda_psdev.c                     |    6 +-
 sys/fs/puffs/puffs_msgif.c                |    6 +-
 sys/kern/files.kern                       |    4 +-
 sys/kern/init_main.c                      |    5 +-
 sys/kern/vfs_init.c                       |    6 +-
 sys/kern/vfs_mount.c                      |   26 +-
 sys/kern/vfs_subr.c                       |  380 +++++++++++++++++++++++++++++-
 sys/kern/vfs_syscalls.c                   |   13 +-
 sys/kern/vfs_trans.c                      |    5 +-
 sys/miscfs/Makefile                       |    5 +-
 sys/miscfs/genfs/genfs_io.c               |    5 +-
 sys/miscfs/syncfs/Makefile                |    7 -
 sys/miscfs/syncfs/sync_subr.c             |  345 ---------------------------
 sys/miscfs/syncfs/sync_vnops.c            |  238 ------------------
 sys/miscfs/syncfs/syncfs.h                |   67 -----
 sys/rump/librump/rumpvfs/Makefile.rumpvfs |    7 +-
 sys/rump/librump/rumpvfs/rump_vfs.c       |    5 +-
 sys/sys/fstypes.h                         |    4 +-
 sys/sys/mount.h                           |   14 +-
 sys/sys/vnode.h                           |    3 +-
 23 files changed, 431 insertions(+), 737 deletions(-)

diffs (truncated from 1610 to 300 lines):

diff -r 007217c974fb -r 93961f6672dc distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Wed May 06 09:21:22 2015 +0000
+++ b/distrib/sets/lists/base/mi        Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1102 2015/04/26 21:37:22 mrg Exp $
+# $NetBSD: mi,v 1.1103 2015/05/06 15:57:07 hannken Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -1135,7 +1135,7 @@
 ./usr/include/miscfs/procfs                    base-c-usr
 ./usr/include/miscfs/ptyfs                     base-obsolete           obsolete
 ./usr/include/miscfs/specfs                    base-c-usr
-./usr/include/miscfs/syncfs                    base-c-usr
+./usr/include/miscfs/syncfs                    base-obsolete           obsolete
 ./usr/include/miscfs/umapfs                    base-c-usr
 ./usr/include/miscfs/union                     base-c-usr
 ./usr/include/msdosfs                          base-c-usr
diff -r 007217c974fb -r 93961f6672dc distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Wed May 06 09:21:22 2015 +0000
+++ b/distrib/sets/lists/comp/mi        Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1956 2015/04/27 07:03:57 knakahara Exp $
+#      $NetBSD: mi,v 1.1957 2015/05/06 15:57:07 hannken Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2529,7 +2529,7 @@
 ./usr/include/miscfs/portal/portal.h           comp-obsolete           obsolete
 ./usr/include/miscfs/procfs/procfs.h           comp-c-include
 ./usr/include/miscfs/specfs/specdev.h          comp-c-include
-./usr/include/miscfs/syncfs/syncfs.h           comp-c-include
+./usr/include/miscfs/syncfs/syncfs.h           comp-obsolete           obsolete
 ./usr/include/miscfs/umapfs/umap.h             comp-c-include
 ./usr/include/miscfs/union/union.h             comp-c-include
 ./usr/include/mj.h                             comp-c-include          crypto
diff -r 007217c974fb -r 93961f6672dc external/cddl/osnet/sys/kern/vfs.c
--- a/external/cddl/osnet/sys/kern/vfs.c        Wed May 06 09:21:22 2015 +0000
+++ b/external/cddl/osnet/sys/kern/vfs.c        Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs.c,v 1.5 2013/11/25 22:48:05 christos Exp $ */
+/*     $NetBSD: vfs.c,v 1.6 2015/05/06 15:57:07 hannken Exp $  */
 
 /*-
  * Copyright (c) 2006-2007 Pawel Jakub Dawidek <pjd%FreeBSD.org@localhost>
@@ -332,12 +332,9 @@
                vput(mvp);
                VOP_UNLOCK(vp);
                if ((mp->mnt_flag & MNT_RDONLY) == 0)
-                       error = vfs_allocate_syncvnode(mp);
+                       vfs_syncer_add_to_worklist(mp);
                vfs_unbusy(mp, td);
-               if (error)
-                       vrele(vp);
-               else
-                       vfs_mountedfrom(mp, fspec);
+               vfs_mountedfrom(mp, fspec);
        } else {
                simple_lock(&vp->v_interlock);
                vp->v_iflag &= ~VI_MOUNT;
diff -r 007217c974fb -r 93961f6672dc sys/coda/coda_psdev.c
--- a/sys/coda/coda_psdev.c     Wed May 06 09:21:22 2015 +0000
+++ b/sys/coda/coda_psdev.c     Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_psdev.c,v 1.54 2014/12/13 15:58:39 hannken Exp $  */
+/*     $NetBSD: coda_psdev.c,v 1.55 2015/05/06 15:57:08 hannken Exp $  */
 
 /*
  *
@@ -54,7 +54,7 @@
 /* These routines are the device entry points for Venus. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_psdev.c,v 1.54 2014/12/13 15:58:39 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_psdev.c,v 1.55 2015/05/06 15:57:08 hannken Exp $");
 
 extern int coda_nc_initialized;    /* Set if cache has been initialized */
 
@@ -72,8 +72,6 @@
 #include <sys/atomic.h>
 #include <sys/module.h>
 
-#include <miscfs/syncfs/syncfs.h>
-
 #include <coda/coda.h>
 #include <coda/cnode.h>
 #include <coda/coda_namecache.h>
diff -r 007217c974fb -r 93961f6672dc sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Wed May 06 09:21:22 2015 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_msgif.c,v 1.97 2014/11/10 18:46:33 maxv Exp $    */
+/*     $NetBSD: puffs_msgif.c,v 1.98 2015/05/06 15:57:08 hannken Exp $ */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.97 2014/11/10 18:46:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.98 2015/05/06 15:57:08 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -51,8 +51,6 @@
 #include <fs/puffs/puffs_msgif.h>
 #include <fs/puffs/puffs_sys.h>
 
-#include <miscfs/syncfs/syncfs.h> /* XXX: for syncer_mutex reference */
-
 /*
  * waitq data structures
  */
diff -r 007217c974fb -r 93961f6672dc sys/kern/files.kern
--- a/sys/kern/files.kern       Wed May 06 09:21:22 2015 +0000
+++ b/sys/kern/files.kern       Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.kern,v 1.4 2015/05/02 12:57:19 mlelstv Exp $
+#      $NetBSD: files.kern,v 1.5 2015/05/06 15:57:08 hannken Exp $
 
 #
 # kernel sources
@@ -226,5 +226,3 @@
 file   miscfs/genfs/layer_vnops.c      layerfs
 
 file   miscfs/specfs/spec_vnops.c      vfs
-file   miscfs/syncfs/sync_subr.c       vfs
-file   miscfs/syncfs/sync_vnops.c      vfs
diff -r 007217c974fb -r 93961f6672dc sys/kern/init_main.c
--- a/sys/kern/init_main.c      Wed May 06 09:21:22 2015 +0000
+++ b/sys/kern/init_main.c      Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_main.c,v 1.466 2015/04/30 15:22:32 nat Exp $      */
+/*     $NetBSD: init_main.c,v 1.467 2015/05/06 15:57:08 hannken Exp $  */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.466 2015/04/30 15:22:32 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.467 2015/05/06 15:57:08 hannken Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -216,7 +216,6 @@
 #include <ufs/ufs/quota.h>
 
 #include <miscfs/genfs/genfs.h>
-#include <miscfs/syncfs/syncfs.h>
 #include <miscfs/specfs/specdev.h>
 
 #include <sys/cpu.h>
diff -r 007217c974fb -r 93961f6672dc sys/kern/vfs_init.c
--- a/sys/kern/vfs_init.c       Wed May 06 09:21:22 2015 +0000
+++ b/sys/kern/vfs_init.c       Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_init.c,v 1.47 2014/02/25 18:30:11 pooka Exp $      */
+/*     $NetBSD: vfs_init.c,v 1.48 2015/05/06 15:57:08 hannken Exp $    */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.47 2014/02/25 18:30:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.48 2015/05/06 15:57:08 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -107,13 +107,11 @@
 extern const struct vnodeopv_desc dead_vnodeop_opv_desc;
 extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
 extern const struct vnodeopv_desc spec_vnodeop_opv_desc;
-extern const struct vnodeopv_desc sync_vnodeop_opv_desc;
 
 const struct vnodeopv_desc * const vfs_special_vnodeopv_descs[] = {
        &dead_vnodeop_opv_desc,
        &fifo_vnodeop_opv_desc,
        &spec_vnodeop_opv_desc,
-       &sync_vnodeop_opv_desc,
        NULL,
 };
 
diff -r 007217c974fb -r 93961f6672dc sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c      Wed May 06 09:21:22 2015 +0000
+++ b/sys/kern/vfs_mount.c      Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_mount.c,v 1.34 2015/04/20 13:44:16 riastradh Exp $ */
+/*     $NetBSD: vfs_mount.c,v 1.35 2015/05/06 15:57:08 hannken Exp $   */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.34 2015/04/20 13:44:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.35 2015/05/06 15:57:08 hannken Exp $");
 
 #define _VFS_VNODE_PRIVATE
 
@@ -93,7 +93,6 @@
 #include <sys/vnode.h>
 
 #include <miscfs/genfs/genfs.h>
-#include <miscfs/syncfs/syncfs.h>
 #include <miscfs/specfs/specdev.h>
 
 /* Root filesystem. */
@@ -722,12 +721,9 @@
        TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
        mutex_exit(&mountlist_lock);
        if ((mp->mnt_flag & (MNT_RDONLY | MNT_ASYNC)) == 0)
-               error = vfs_allocate_syncvnode(mp);
-       if (error == 0)
-               vp->v_mountedhere = mp;
+               vfs_syncer_add_to_worklist(mp);
+       vp->v_mountedhere = mp;
        vput(nd.ni_vp);
-       if (error != 0)
-               goto err_onmountlist;
 
        mount_checkdirs(vp);
        mutex_exit(&mp->mnt_updating);
@@ -746,12 +742,6 @@
        *vpp = NULL;
        return error;
 
-err_onmountlist:
-       mutex_enter(&mountlist_lock);
-       TAILQ_REMOVE(&mountlist, mp, mnt_list);
-       mp->mnt_iflag |= IMNT_GONE;
-       mutex_exit(&mountlist_lock);
-
 err_mounted:
        if (VFS_UNMOUNT(mp, MNT_FORCE) != 0)
                panic("Unmounting fresh file system failed");
@@ -808,7 +798,7 @@
                return ENOENT;
        }
 
-       used_syncer = (mp->mnt_syncer != NULL);
+       used_syncer = (mp->mnt_iflag & IMNT_ONWORKLIST) != 0;
        used_extattr = mp->mnt_flag & MNT_EXTATTR;
 
        /*
@@ -831,8 +821,8 @@
        async = mp->mnt_flag & MNT_ASYNC;
        mp->mnt_flag &= ~MNT_ASYNC;
        cache_purgevfs(mp);     /* remove cache entries for this file sys */
-       if (mp->mnt_syncer != NULL)
-               vfs_deallocate_syncvnode(mp);
+       if (used_syncer)
+               vfs_syncer_remove_from_worklist(mp);
        error = 0;
        if ((mp->mnt_flag & MNT_RDONLY) == 0) {
                error = VFS_SYNC(mp, MNT_WAIT, l->l_cred);
@@ -844,7 +834,7 @@
                mp->mnt_iflag &= ~IMNT_UNMOUNT;
                mutex_exit(&mp->mnt_unmounting);
                if ((mp->mnt_flag & (MNT_RDONLY | MNT_ASYNC)) == 0)
-                       (void) vfs_allocate_syncvnode(mp);
+                       vfs_syncer_add_to_worklist(mp);
                mp->mnt_flag |= async;
                mutex_exit(&mp->mnt_updating);
                if (used_syncer)
diff -r 007217c974fb -r 93961f6672dc sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Wed May 06 09:21:22 2015 +0000
+++ b/sys/kern/vfs_subr.c       Wed May 06 15:57:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_subr.c,v 1.445 2014/09/05 05:57:21 matt Exp $      */
+/*     $NetBSD: vfs_subr.c,v 1.446 2015/05/06 15:57:08 hannken Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -6,7 +6,8 @@
  *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
- * NASA Ames Research Center, by Charles M. Hannum, and by Andrew Doran.
+ * NASA Ames Research Center, by Charles M. Hannum, by Andrew Doran,
+ * by Marshall Kirk McKusick and Greg Ganger at the University of Michigan.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -67,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.445 2014/09/05 05:57:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.446 2015/05/06 15:57:08 hannken Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -92,7 +93,6 @@
 #include <sys/module.h>



Home | Main Index | Thread Index | Old Index