Hi,

I would like to convert struct vfsops initializer to C99 style.
And the extern declarations should be in a header file within #ifdef
_KERNEL.

ok?

bluhm

Index: kern/vfs_init.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_init.c,v
retrieving revision 1.42
diff -u -p -r1.42 vfs_init.c
--- kern/vfs_init.c     2 Apr 2019 13:07:28 -0000       1.42
+++ kern/vfs_init.c     25 Dec 2019 22:04:05 -0000
@@ -50,47 +50,6 @@ struct pool namei_pool;
 struct vnode *rootvnode;

 /* Set up the filesystem operations for vnodes. */
-#ifdef FFS
-extern const struct vfsops ffs_vfsops;
-#endif
-
-#ifdef MFS
-extern const struct vfsops mfs_vfsops;
-#endif
-
-#ifdef MSDOSFS
-extern const struct vfsops msdosfs_vfsops;
-#endif
-
-#ifdef NFSCLIENT
-extern const struct vfsops nfs_vfsops;
-#endif
-
-#ifdef CD9660
-extern const struct vfsops cd9660_vfsops;
-#endif
-
-#ifdef EXT2FS
-extern const struct vfsops ext2fs_vfsops;
-#endif
-
-#ifdef NTFS
-extern  const struct vfsops ntfs_vfsops;
-#endif
-
-#ifdef UDF
-extern  const struct vfsops udf_vfsops;
-#endif
-
-#ifdef FUSE
-extern const struct vfsops fusefs_vfsops;
-#endif
-
-#ifdef TMPFS
-extern  const struct vfsops tmpfs_vfsops;
-#endif
-
-/* Set up the filesystem operations for vnodes. */
 static struct vfsconf vfsconflist[] = {
 #ifdef FFS
         { &ffs_vfsops, MOUNT_FFS, 1, 0, MNT_LOCAL | MNT_SWAPPABLE,
Index: sys/mount.h
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/sys/mount.h,v
retrieving revision 1.144
diff -u -p -r1.144 mount.h
--- sys/mount.h 2 Apr 2019 13:07:28 -0000       1.144
+++ sys/mount.h 25 Dec 2019 22:04:05 -0000
@@ -543,6 +543,17 @@ struct vfsops {
 #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED) \
        (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED)

+/* Set up the filesystem operations for vnodes. */
+extern const struct vfsops ffs_vfsops;
+extern const struct vfsops mfs_vfsops;
+extern const struct vfsops msdosfs_vfsops;
+extern const struct vfsops nfs_vfsops;
+extern const struct vfsops cd9660_vfsops;
+extern const struct vfsops ext2fs_vfsops;
+extern const struct vfsops ntfs_vfsops;
+extern const struct vfsops udf_vfsops;
+extern const struct vfsops fusefs_vfsops;
+extern const struct vfsops tmpfs_vfsops;

 #include <net/radix.h>
 #include <sys/socket.h>                /* XXX for AF_MAX */
Index: isofs/cd9660/cd9660_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/isofs/cd9660/cd9660_vfsops.c,v
retrieving revision 1.92
diff -u -p -r1.92 cd9660_vfsops.c
--- isofs/cd9660/cd9660_vfsops.c        25 Jul 2019 01:43:20 -0000      1.92
+++ isofs/cd9660/cd9660_vfsops.c        25 Dec 2019 22:04:05 -0000
@@ -61,19 +61,19 @@
 #include <isofs/cd9660/cd9660_node.h>

 const struct vfsops cd9660_vfsops = {
-       cd9660_mount,
-       cd9660_start,
-       cd9660_unmount,
-       cd9660_root,
-       cd9660_quotactl,
-       cd9660_statfs,
-       cd9660_sync,
-       cd9660_vget,
-       cd9660_fhtovp,
-       cd9660_vptofh,
-       cd9660_init,
-       cd9660_sysctl,
-       cd9660_check_export
+       .vfs_mount      = cd9660_mount,
+       .vfs_start      = cd9660_start,
+       .vfs_unmount    = cd9660_unmount,
+       .vfs_root       = cd9660_root,
+       .vfs_quotactl   = cd9660_quotactl,
+       .vfs_statfs     = cd9660_statfs,
+       .vfs_sync       = cd9660_sync,
+       .vfs_vget       = cd9660_vget,
+       .vfs_fhtovp     = cd9660_fhtovp,
+       .vfs_vptofh     = cd9660_vptofh,
+       .vfs_init       = cd9660_init,
+       .vfs_sysctl     = cd9660_sysctl,
+       .vfs_checkexp   = cd9660_check_export,
 };

 /*
Index: isofs/udf/udf_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/isofs/udf/udf_vfsops.c,v
retrieving revision 1.66
diff -u -p -r1.66 udf_vfsops.c
--- isofs/udf/udf_vfsops.c      25 Jul 2019 01:43:21 -0000      1.66
+++ isofs/udf/udf_vfsops.c      25 Dec 2019 22:04:05 -0000
@@ -83,19 +83,19 @@ int udf_get_mpartmap(struct umount *, st
 int udf_mountfs(struct vnode *, struct mount *, uint32_t, struct proc *);

 const struct vfsops udf_vfsops = {
-       .vfs_fhtovp =           udf_fhtovp,
-       .vfs_init =             udf_init,
-       .vfs_mount =            udf_mount,
-       .vfs_start =            udf_start,
-       .vfs_root =             udf_root,
-       .vfs_quotactl =         udf_quotactl,
-       .vfs_statfs =           udf_statfs,
-       .vfs_sync =             udf_sync,
-       .vfs_unmount =          udf_unmount,
-       .vfs_vget =             udf_vget,
-       .vfs_vptofh =           udf_vptofh,
-       .vfs_sysctl =           udf_sysctl,
-       .vfs_checkexp =         udf_checkexp,
+       .vfs_mount      = udf_mount,
+       .vfs_start      = udf_start,
+       .vfs_unmount    = udf_unmount,
+       .vfs_root       = udf_root,
+       .vfs_quotactl   = udf_quotactl,
+       .vfs_statfs     = udf_statfs,
+       .vfs_sync       = udf_sync,
+       .vfs_vget       = udf_vget,
+       .vfs_fhtovp     = udf_fhtovp,
+       .vfs_vptofh     = udf_vptofh,
+       .vfs_init       = udf_init,
+       .vfs_sysctl     = udf_sysctl,
+       .vfs_checkexp   = udf_checkexp,
 };

 int
Index: miscfs/fuse/fuse_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/miscfs/fuse/fuse_vfsops.c,v
retrieving revision 1.42
diff -u -p -r1.42 fuse_vfsops.c
--- miscfs/fuse/fuse_vfsops.c   17 Jul 2018 13:12:08 -0000      1.42
+++ miscfs/fuse/fuse_vfsops.c   25 Dec 2019 22:13:24 -0000
@@ -51,19 +51,19 @@ int fusefs_checkexp(struct mount *, stru
            struct ucred **);

 const struct vfsops fusefs_vfsops = {
-       fusefs_mount,
-       fusefs_start,
-       fusefs_unmount,
-       fusefs_root,
-       fusefs_quotactl,
-       fusefs_statfs,
-       fusefs_sync,
-       fusefs_vget,
-       fusefs_fhtovp,
-       fusefs_vptofh,
-       fusefs_init,
-       fusefs_sysctl,
-       fusefs_checkexp
+       .vfs_mount      = fusefs_mount,
+       .vfs_start      = fusefs_start,
+       .vfs_unmount    = fusefs_unmount,
+       .vfs_root       = fusefs_root,
+       .vfs_quotactl   = fusefs_quotactl,
+       .vfs_statfs     = fusefs_statfs,
+       .vfs_sync       = fusefs_sync,
+       .vfs_vget       = fusefs_vget,
+       .vfs_fhtovp     = fusefs_fhtovp,
+       .vfs_vptofh     = fusefs_vptofh,
+       .vfs_init       = fusefs_init,
+       .vfs_sysctl     = fusefs_sysctl,
+       .vfs_checkexp   = fusefs_checkexp,
 };

 struct pool fusefs_fbuf_pool;
Index: msdosfs/msdosfs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/msdosfs/msdosfs_vfsops.c,v
retrieving revision 1.91
diff -u -p -r1.91 msdosfs_vfsops.c
--- msdosfs/msdosfs_vfsops.c    25 Jul 2019 01:43:21 -0000      1.91
+++ msdosfs/msdosfs_vfsops.c    25 Dec 2019 22:04:05 -0000
@@ -791,17 +791,17 @@ msdosfs_check_export(struct mount *mp, s
                                     size_t, struct proc *))eopnotsupp)

 const struct vfsops msdosfs_vfsops = {
-       msdosfs_mount,
-       msdosfs_start,
-       msdosfs_unmount,
-       msdosfs_root,
-       msdosfs_quotactl,
-       msdosfs_statfs,
-       msdosfs_sync,
-       msdosfs_vget,
-       msdosfs_fhtovp,
-       msdosfs_vptofh,
-       msdosfs_init,
-       msdosfs_sysctl,
-       msdosfs_check_export
+       .vfs_mount      = msdosfs_mount,
+       .vfs_start      = msdosfs_start,
+       .vfs_unmount    = msdosfs_unmount,
+       .vfs_root       = msdosfs_root,
+       .vfs_quotactl   = msdosfs_quotactl,
+       .vfs_statfs     = msdosfs_statfs,
+       .vfs_sync       = msdosfs_sync,
+       .vfs_vget       = msdosfs_vget,
+       .vfs_fhtovp     = msdosfs_fhtovp,
+       .vfs_vptofh     = msdosfs_vptofh,
+       .vfs_init       = msdosfs_init,
+       .vfs_sysctl     = msdosfs_sysctl,
+       .vfs_checkexp   = msdosfs_check_export,
 };
Index: nfs/nfs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/nfs/nfs_vfsops.c,v
retrieving revision 1.122
diff -u -p -r1.122 nfs_vfsops.c
--- nfs/nfs_vfsops.c    2 Jul 2018 20:56:22 -0000       1.122
+++ nfs/nfs_vfsops.c    25 Dec 2019 22:04:05 -0000
@@ -96,19 +96,19 @@ int nfs_fhtovp(struct mount *, struct fi
  * nfs vfs operations.
  */
 const struct vfsops nfs_vfsops = {
-       nfs_mount,
-       nfs_start,
-       nfs_unmount,
-       nfs_root,
-       nfs_quotactl,
-       nfs_statfs,
-       nfs_sync,
-       nfs_vget,
-       nfs_fhtovp,
-       nfs_vptofh,
-       nfs_vfs_init,
-       nfs_sysctl,
-       nfs_checkexp
+       .vfs_mount      = nfs_mount,
+       .vfs_start      = nfs_start,
+       .vfs_unmount    = nfs_unmount,
+       .vfs_root       = nfs_root,
+       .vfs_quotactl   = nfs_quotactl,
+       .vfs_statfs     = nfs_statfs,
+       .vfs_sync       = nfs_sync,
+       .vfs_vget       = nfs_vget,
+       .vfs_fhtovp     = nfs_fhtovp,
+       .vfs_vptofh     = nfs_vptofh,
+       .vfs_init       = nfs_vfs_init,
+       .vfs_sysctl     = nfs_sysctl,
+       .vfs_checkexp   = nfs_checkexp,
 };

 /*
Index: ntfs/ntfs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/ntfs/ntfs_vfsops.c,v
retrieving revision 1.62
diff -u -p -r1.62 ntfs_vfsops.c
--- ntfs/ntfs_vfsops.c  25 Jul 2019 01:43:21 -0000      1.62
+++ ntfs/ntfs_vfsops.c  25 Dec 2019 22:04:05 -0000
@@ -782,17 +782,17 @@ ntfs_vget(struct mount *mp, ino_t ino, s
 }

 const struct vfsops ntfs_vfsops = {
-       ntfs_mount,
-       ntfs_start,
-       ntfs_unmount,
-       ntfs_root,
-       ntfs_quotactl,
-       ntfs_statfs,
-       ntfs_sync,
-       ntfs_vget,
-       ntfs_fhtovp,
-       ntfs_vptofh,
-       ntfs_init,
-       ntfs_sysctl,
-       ntfs_checkexp,
+       .vfs_mount      = ntfs_mount,
+       .vfs_start      = ntfs_start,
+       .vfs_unmount    = ntfs_unmount,
+       .vfs_root       = ntfs_root,
+       .vfs_quotactl   = ntfs_quotactl,
+       .vfs_statfs     = ntfs_statfs,
+       .vfs_sync       = ntfs_sync,
+       .vfs_vget       = ntfs_vget,
+       .vfs_fhtovp     = ntfs_fhtovp,
+       .vfs_vptofh     = ntfs_vptofh,
+       .vfs_init       = ntfs_init,
+       .vfs_sysctl     = ntfs_sysctl,
+       .vfs_checkexp   = ntfs_checkexp,
 };
Index: tmpfs/tmpfs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/tmpfs/tmpfs_vfsops.c,v
retrieving revision 1.16
diff -u -p -r1.16 tmpfs_vfsops.c
--- tmpfs/tmpfs_vfsops.c        6 Apr 2018 15:14:27 -0000       1.16
+++ tmpfs/tmpfs_vfsops.c        25 Dec 2019 22:04:05 -0000
@@ -358,18 +358,18 @@ tmpfs_sync(struct mount *mp, int waitfor
  * tmpfs vfs operations.
  */

-struct vfsops tmpfs_vfsops = {
-       tmpfs_mount,                    /* vfs_mount */
-       tmpfs_start,                    /* vfs_start */
-       tmpfs_unmount,                  /* vfs_unmount */
-       tmpfs_root,                     /* vfs_root */
-       (void *)eopnotsupp,             /* vfs_quotactl */
-       tmpfs_statfs,                   /* vfs_statfs */
-       tmpfs_sync,                     /* vfs_sync */
-       tmpfs_vget,                     /* vfs_vget */
-       tmpfs_fhtovp,                   /* vfs_fhtovp */
-       tmpfs_vptofh,                   /* vfs_vptofh */
-       tmpfs_init,                     /* vfs_init */
-       (void *)eopnotsupp,             /* vfs_sysctl */
-       (void *)eopnotsupp,
+const struct vfsops tmpfs_vfsops = {
+       .vfs_mount      = tmpfs_mount,
+       .vfs_start      = tmpfs_start,
+       .vfs_unmount    = tmpfs_unmount,
+       .vfs_root       = tmpfs_root,
+       .vfs_quotactl   = (void *)eopnotsupp,
+       .vfs_statfs     = tmpfs_statfs,
+       .vfs_sync       = tmpfs_sync,
+       .vfs_vget       = tmpfs_vget,
+       .vfs_fhtovp     = tmpfs_fhtovp,
+       .vfs_vptofh     = tmpfs_vptofh,
+       .vfs_init       = tmpfs_init,
+       .vfs_sysctl     = (void *)eopnotsupp,
+       .vfs_checkexp   = (void *)eopnotsupp,
 };
Index: ufs/ext2fs/ext2fs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/ufs/ext2fs/ext2fs_vfsops.c,v
retrieving revision 1.113
diff -u -p -r1.113 ext2fs_vfsops.c
--- ufs/ext2fs/ext2fs_vfsops.c  25 Jul 2019 01:43:21 -0000      1.113
+++ ufs/ext2fs/ext2fs_vfsops.c  25 Dec 2019 22:04:05 -0000
@@ -70,19 +70,19 @@ int ext2fs_sbupdate(struct ufsmount *, i
 static int     e2fs_sbcheck(struct ext2fs *, int);

 const struct vfsops ext2fs_vfsops = {
-       ext2fs_mount,
-       ufs_start,
-       ext2fs_unmount,
-       ufs_root,
-       ufs_quotactl,
-       ext2fs_statfs,
-       ext2fs_sync,
-       ext2fs_vget,
-       ext2fs_fhtovp,
-       ext2fs_vptofh,
-       ext2fs_init,
-       ext2fs_sysctl,
-       ufs_check_export
+       .vfs_mount      = ext2fs_mount,
+       .vfs_start      = ufs_start,
+       .vfs_unmount    = ext2fs_unmount,
+       .vfs_root       = ufs_root,
+       .vfs_quotactl   = ufs_quotactl,
+       .vfs_statfs     = ext2fs_statfs,
+       .vfs_sync       = ext2fs_sync,
+       .vfs_vget       = ext2fs_vget,
+       .vfs_fhtovp     = ext2fs_fhtovp,
+       .vfs_vptofh     = ext2fs_vptofh,
+       .vfs_init       = ext2fs_init,
+       .vfs_sysctl     = ext2fs_sysctl,
+       .vfs_checkexp   = ufs_check_export,
 };

 struct pool ext2fs_inode_pool;
Index: ufs/ffs/ffs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/ufs/ffs/ffs_vfsops.c,v
retrieving revision 1.181
diff -u -p -r1.181 ffs_vfsops.c
--- ufs/ffs/ffs_vfsops.c        25 Jul 2019 01:43:21 -0000      1.181
+++ ufs/ffs/ffs_vfsops.c        25 Dec 2019 22:04:05 -0000
@@ -73,19 +73,19 @@ void ffs1_compat_read(struct fs *, struc
 void ffs1_compat_write(struct fs *, struct ufsmount *);

 const struct vfsops ffs_vfsops = {
-       ffs_mount,
-       ufs_start,
-       ffs_unmount,
-       ufs_root,
-       ufs_quotactl,
-       ffs_statfs,
-       ffs_sync,
-       ffs_vget,
-       ffs_fhtovp,
-       ffs_vptofh,
-       ffs_init,
-       ffs_sysctl,
-       ufs_check_export
+       .vfs_mount      = ffs_mount,
+       .vfs_start      = ufs_start,
+       .vfs_unmount    = ffs_unmount,
+       .vfs_root       = ufs_root,
+       .vfs_quotactl   = ufs_quotactl,
+       .vfs_statfs     = ffs_statfs,
+       .vfs_sync       = ffs_sync,
+       .vfs_vget       = ffs_vget,
+       .vfs_fhtovp     = ffs_fhtovp,
+       .vfs_vptofh     = ffs_vptofh,
+       .vfs_init       = ffs_init,
+       .vfs_sysctl     = ffs_sysctl,
+       .vfs_checkexp   = ufs_check_export,
 };

 struct inode_vtbl ffs_vtbl = {
Index: ufs/mfs/mfs_vfsops.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/ufs/mfs/mfs_vfsops.c,v
retrieving revision 1.56
diff -u -p -r1.56 mfs_vfsops.c
--- ufs/mfs/mfs_vfsops.c        25 Nov 2019 11:33:51 -0000      1.56
+++ ufs/mfs/mfs_vfsops.c        25 Dec 2019 22:04:05 -0000
@@ -60,19 +60,19 @@ static      int mfs_minor;  /* used for buildi
  * mfs vfs operations.
  */
 const struct vfsops mfs_vfsops = {
-       mfs_mount,
-       mfs_start,
-       ffs_unmount,
-       ufs_root,
-       ufs_quotactl,
-       ffs_statfs,
-       ffs_sync,
-       ffs_vget,
-       ffs_fhtovp,
-       ffs_vptofh,
-       mfs_init,
-       ffs_sysctl,
-       mfs_checkexp
+       .vfs_mount      = mfs_mount,
+       .vfs_start      = mfs_start,
+       .vfs_unmount    = ffs_unmount,
+       .vfs_root       = ufs_root,
+       .vfs_quotactl   = ufs_quotactl,
+       .vfs_statfs     = ffs_statfs,
+       .vfs_sync       = ffs_sync,
+       .vfs_vget       = ffs_vget,
+       .vfs_fhtovp     = ffs_fhtovp,
+       .vfs_vptofh     = ffs_vptofh,
+       .vfs_init       = mfs_init,
+       .vfs_sysctl     = ffs_sysctl,
+       .vfs_checkexp   = mfs_checkexp,
 };

 /*

Reply via email to