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


  74 struct vfsops *fifo_vfsops;
  75 
  76 static vfsdef_t vfw = {
  77         VFSDEF_VERSION,
  78         "fifofs",
  79         fifoinit,
  80         VSW_ZMOUNT,
  81         NULL
  82 };
  83 
  84 /*
  85  * Module linkage information for the kernel.
  86  */
  87 extern struct mod_ops mod_fsops;
  88 
  89 static struct modlfs modlfs = {
  90         &mod_fsops, "filesystem for fifo", &vfw
  91 };
  92 
  93 static struct modlinkage modlinkage = {
  94         MODREV_1, (void *)&modlfs, NULL
  95 };
  96 
  97 int
  98 _init()
  99 {
 100         return (mod_install(&modlinkage));
 101 }
 102 
 103 int
 104 _info(struct modinfo *modinfop)
 105 {
 106         return (mod_info(&modlinkage, modinfop));
 107 }
 108 
 109 /*
 110  * Define data structures within this file.
 111  * XXX should the hash size be configurable ?
 112  */
 113 #define FIFOSHFT        5
 114 #define FIFO_HASHSZ     63


 309  */
 310 
 311 static void fifo_reinit_vp(vnode_t *vp)
 312 {
 313         vn_reinit(vp);
 314         vp->v_type = VFIFO;
 315         vp->v_flag &= VROOT;
 316         vp->v_flag |= VNOMAP | VNOSWAP;
 317 }
 318 
 319 /*
 320  * Save file system type/index, initialize vfs operations vector, get
 321  * unique device number for FIFOFS and initialize the FIFOFS hash.
 322  * Create and initialize a "generic" vfs pointer that will be placed
 323  * in the v_vfsp field of each pipe's vnode.
 324  */
 325 int
 326 fifoinit(int fstype, char *name)
 327 {
 328         static const fs_operation_def_t fifo_vfsops_template[] = {
 329                 NULL, NULL
 330         };
 331         int error;
 332         major_t dev;
 333 
 334         fifofstype = fstype;
 335         error = vfs_setfsops(fstype, fifo_vfsops_template, &fifo_vfsops);
 336         if (error != 0) {
 337                 cmn_err(CE_WARN, "fifoinit: bad vfs ops template");
 338                 return (error);
 339         }
 340 
 341         error = vn_make_ops(name, fifo_vnodeops_template, &fifo_vnodeops);
 342         if (error != 0) {
 343                 (void) vfs_freevfsops_by_type(fstype);
 344                 cmn_err(CE_WARN, "fifoinit: bad vnode ops template");
 345                 return (error);
 346         }
 347 
 348         if ((dev = getudev()) == (major_t)-1) {
 349                 cmn_err(CE_WARN, "fifoinit: can't get unique device number");




  74 struct vfsops *fifo_vfsops;
  75 
  76 static vfsdef_t vfw = {
  77         VFSDEF_VERSION,
  78         "fifofs",
  79         fifoinit,
  80         VSW_ZMOUNT,
  81         NULL
  82 };
  83 
  84 /*
  85  * Module linkage information for the kernel.
  86  */
  87 extern struct mod_ops mod_fsops;
  88 
  89 static struct modlfs modlfs = {
  90         &mod_fsops, "filesystem for fifo", &vfw
  91 };
  92 
  93 static struct modlinkage modlinkage = {
  94         MODREV_1, { (void *)&modlfs, NULL }
  95 };
  96 
  97 int
  98 _init()
  99 {
 100         return (mod_install(&modlinkage));
 101 }
 102 
 103 int
 104 _info(struct modinfo *modinfop)
 105 {
 106         return (mod_info(&modlinkage, modinfop));
 107 }
 108 
 109 /*
 110  * Define data structures within this file.
 111  * XXX should the hash size be configurable ?
 112  */
 113 #define FIFOSHFT        5
 114 #define FIFO_HASHSZ     63


 309  */
 310 
 311 static void fifo_reinit_vp(vnode_t *vp)
 312 {
 313         vn_reinit(vp);
 314         vp->v_type = VFIFO;
 315         vp->v_flag &= VROOT;
 316         vp->v_flag |= VNOMAP | VNOSWAP;
 317 }
 318 
 319 /*
 320  * Save file system type/index, initialize vfs operations vector, get
 321  * unique device number for FIFOFS and initialize the FIFOFS hash.
 322  * Create and initialize a "generic" vfs pointer that will be placed
 323  * in the v_vfsp field of each pipe's vnode.
 324  */
 325 int
 326 fifoinit(int fstype, char *name)
 327 {
 328         static const fs_operation_def_t fifo_vfsops_template[] = {
 329                 { NULL, { NULL } }
 330         };
 331         int error;
 332         major_t dev;
 333 
 334         fifofstype = fstype;
 335         error = vfs_setfsops(fstype, fifo_vfsops_template, &fifo_vfsops);
 336         if (error != 0) {
 337                 cmn_err(CE_WARN, "fifoinit: bad vfs ops template");
 338                 return (error);
 339         }
 340 
 341         error = vn_make_ops(name, fifo_vnodeops_template, &fifo_vnodeops);
 342         if (error != 0) {
 343                 (void) vfs_freevfsops_by_type(fstype);
 344                 cmn_err(CE_WARN, "fifoinit: bad vnode ops template");
 345                 return (error);
 346         }
 347 
 348         if ((dev = getudev()) == (major_t)-1) {
 349                 cmn_err(CE_WARN, "fifoinit: can't get unique device number");