Print this page
7127  remove -Wno-missing-braces from Makefile.uts


  66 };
  67 
  68 static vfsdef_t vfw = {
  69         VFSDEF_VERSION,
  70         "proc",
  71         prinit,
  72         VSW_HASPROTO|VSW_STATS|VSW_XID|VSW_ZMOUNT,
  73         &proc_mntopts
  74 };
  75 
  76 /*
  77  * Module linkage information for the kernel.
  78  */
  79 extern struct mod_ops mod_fsops;
  80 
  81 static struct modlfs modlfs = {
  82         &mod_fsops, "filesystem for proc", &vfw
  83 };
  84 
  85 static struct modlinkage modlinkage = {
  86         MODREV_1, (void *)&modlfs, NULL
  87 };
  88 
  89 int
  90 _init(void)
  91 {
  92         return (mod_install(&modlinkage));
  93 }
  94 
  95 int
  96 _info(struct modinfo *modinfop)
  97 {
  98         return (mod_info(&modlinkage, modinfop));
  99 }
 100 
 101 /*
 102  * N.B.
 103  * No _fini routine. The module cannot be unloaded once loaded.
 104  * The NO_UNLOAD_STUB in modstubs.s must change if this module
 105  * is ever modified to become unloadable.
 106  */


 124 {
 125         struct vnode *vp;
 126 
 127         bzero((caddr_t)pnp, sizeof (*pnp));
 128         pnp->pr_vnode = vp = vn_alloc(KM_SLEEP);
 129 
 130         mutex_init(&pnp->pr_mutex, NULL, MUTEX_DEFAULT, NULL);
 131         vp->v_flag = VROOT|VNOCACHE|VNOMAP|VNOSWAP|VNOMOUNT;
 132         VN_SET_VFS_TYPE_DEV(vp, vfsp, VDIR, 0);
 133         vn_setops(vp, prvnodeops);
 134         vp->v_data = (caddr_t)pnp;
 135         pnp->pr_type = PR_PROCDIR;
 136         pnp->pr_mode = 0555; /* read-search by everyone */
 137         vn_exists(vp);
 138 }
 139 
 140 static int
 141 prinit(int fstype, char *name)
 142 {
 143         static const fs_operation_def_t pr_vfsops_template[] = {
 144                 VFSNAME_MOUNT,          { .vfs_mount = prmount },
 145                 VFSNAME_UNMOUNT,        { .vfs_unmount = prunmount },
 146                 VFSNAME_ROOT,           { .vfs_root = prroot },
 147                 VFSNAME_STATVFS,        { .vfs_statvfs = prstatvfs },
 148                 NULL,                   NULL
 149         };
 150         extern const fs_operation_def_t pr_vnodeops_template[];
 151         int error;
 152 
 153         nproc_highbit = highbit(v.v_proc);
 154         procfstype = fstype;
 155         ASSERT(procfstype != 0);
 156         /*
 157          * Associate VFS ops vector with this fstype.
 158          */
 159         error = vfs_setfsops(fstype, pr_vfsops_template, NULL);
 160         if (error != 0) {
 161                 cmn_err(CE_WARN, "prinit: bad vfs ops template");
 162                 return (error);
 163         }
 164 
 165         /*
 166          * Set up vnode ops vector too.
 167          */
 168 




  66 };
  67 
  68 static vfsdef_t vfw = {
  69         VFSDEF_VERSION,
  70         "proc",
  71         prinit,
  72         VSW_HASPROTO|VSW_STATS|VSW_XID|VSW_ZMOUNT,
  73         &proc_mntopts
  74 };
  75 
  76 /*
  77  * Module linkage information for the kernel.
  78  */
  79 extern struct mod_ops mod_fsops;
  80 
  81 static struct modlfs modlfs = {
  82         &mod_fsops, "filesystem for proc", &vfw
  83 };
  84 
  85 static struct modlinkage modlinkage = {
  86         MODREV_1, { (void *)&modlfs, NULL }
  87 };
  88 
  89 int
  90 _init(void)
  91 {
  92         return (mod_install(&modlinkage));
  93 }
  94 
  95 int
  96 _info(struct modinfo *modinfop)
  97 {
  98         return (mod_info(&modlinkage, modinfop));
  99 }
 100 
 101 /*
 102  * N.B.
 103  * No _fini routine. The module cannot be unloaded once loaded.
 104  * The NO_UNLOAD_STUB in modstubs.s must change if this module
 105  * is ever modified to become unloadable.
 106  */


 124 {
 125         struct vnode *vp;
 126 
 127         bzero((caddr_t)pnp, sizeof (*pnp));
 128         pnp->pr_vnode = vp = vn_alloc(KM_SLEEP);
 129 
 130         mutex_init(&pnp->pr_mutex, NULL, MUTEX_DEFAULT, NULL);
 131         vp->v_flag = VROOT|VNOCACHE|VNOMAP|VNOSWAP|VNOMOUNT;
 132         VN_SET_VFS_TYPE_DEV(vp, vfsp, VDIR, 0);
 133         vn_setops(vp, prvnodeops);
 134         vp->v_data = (caddr_t)pnp;
 135         pnp->pr_type = PR_PROCDIR;
 136         pnp->pr_mode = 0555; /* read-search by everyone */
 137         vn_exists(vp);
 138 }
 139 
 140 static int
 141 prinit(int fstype, char *name)
 142 {
 143         static const fs_operation_def_t pr_vfsops_template[] = {
 144                 { VFSNAME_MOUNT,        { .vfs_mount = prmount } },
 145                 { VFSNAME_UNMOUNT,      { .vfs_unmount = prunmount } },
 146                 { VFSNAME_ROOT,         { .vfs_root = prroot } },
 147                 { VFSNAME_STATVFS,      { .vfs_statvfs = prstatvfs } },
 148                 { NULL,                 { NULL } }
 149         };
 150         extern const fs_operation_def_t pr_vnodeops_template[];
 151         int error;
 152 
 153         nproc_highbit = highbit(v.v_proc);
 154         procfstype = fstype;
 155         ASSERT(procfstype != 0);
 156         /*
 157          * Associate VFS ops vector with this fstype.
 158          */
 159         error = vfs_setfsops(fstype, pr_vfsops_template, NULL);
 160         if (error != 0) {
 161                 cmn_err(CE_WARN, "prinit: bad vfs ops template");
 162                 return (error);
 163         }
 164 
 165         /*
 166          * Set up vnode ops vector too.
 167          */
 168