Print this page
6198 Let's EOL cachefs

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fs.d/mount.c
          +++ new/usr/src/cmd/fs.d/mount.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  22   22  /*        All Rights Reserved   */
  23   23  
  24   24  
  25   25  /*
  26   26   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  /*
  30      - * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
       30 + * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  31   31   */
  32   32  
  33   33  #include        <stdio.h>
  34   34  #include        <stdio_ext.h>
  35   35  #include        <limits.h>
  36   36  #include        <fcntl.h>
  37   37  #include        <unistd.h>
  38   38  #include        <stdlib.h>
  39   39  #include        <string.h>
  40   40  #include        <stdarg.h>
↓ open down ↓ 91 lines elided ↑ open up ↑
 132  132  int     maxrun;
 133  133  int     nrun;
 134  134  int     failcnt;                /* total count of failures */
 135  135  int     lofscnt;                /* presence of lofs prohibits parallel */
 136  136                                  /* mounting */
 137  137  int     lofsfail;               /* count of failures of lofs mounts */
 138  138  int     exitcode;
 139  139  int     aflg, cflg, fflg, Fflg, gflg, oflg, pflg, rflg, vflg, Vflg, mflg, Oflg,
 140  140          dashflg, questflg, dflg, qflg;
 141  141  
 142      -/*
 143      - * Currently, mounting cachefs instances simultaneously uncovers various
 144      - * problems.  For the short term, we serialize cachefs activity while we fix
 145      - * these cachefs bugs.
 146      - */
 147      -#define CACHEFS_BUG
 148      -#ifdef  CACHEFS_BUG
 149      -int     cachefs_running;        /* parallel cachefs not supported yet */
 150      -#endif
 151  142  
 152  143  /*
 153  144   * Each vfsent_t describes a vfstab entry.  It is used to manage and cleanup
 154  145   * each child that performs the particular mount for the entry.
 155  146   */
 156  147  
 157  148  typedef struct vfsent {
 158  149          struct vfstab   v;              /* the vfstab entry */
 159  150          char            *rpath;         /* resolved pathname so far */
 160  151          int             mlevel;         /* how deep is this mount point */
↓ open down ↓ 1127 lines elided ↑ open up ↑
1288 1279  
1289 1280                  /*
1290 1281                   * This should never really fail.
1291 1282                   */
1292 1283                  while (setup_iopipe(vp) == -1 && (dowait() != -1))
1293 1284                          ;
1294 1285  
1295 1286                  while (nrun >= maxrun && (dowait() != -1))      /* throttle */
1296 1287                          ;
1297 1288  
1298      -#ifdef  CACHEFS_BUG
1299      -                if (vp->v.vfs_fstype &&
1300      -                    (strcmp(vp->v.vfs_fstype, "cachefs") == 0)) {
1301      -                        while (cachefs_running && (dowait() != -1))
1302      -                                ;
1303      -                        cachefs_running = 1;
1304      -                }
1305      -#endif
1306      -
1307 1289                  if ((child = fork()) == -1) {
1308 1290                          perror("fork");
1309 1291                          cleanup(-1);
1310 1292                          /* not reached */
1311 1293                  }
1312 1294                  if (child == 0) {               /* child */
1313 1295                          signal(SIGHUP, SIG_IGN);
1314 1296                          signal(SIGQUIT, SIG_IGN);
1315 1297                          signal(SIGINT, SIG_IGN);
1316 1298                          setup_output(vp);
↓ open down ↓ 150 lines elided ↑ open up ↑
1467 1449          }
1468 1450          doio(vp);       /* Any output? */
1469 1451  
1470 1452          if (vp->v.vfs_fstype &&
1471 1453              (strcmp(vp->v.vfs_fstype, MNTTYPE_LOFS) == 0)) {
1472 1454                  lofscnt--;
1473 1455                  if (ret)
1474 1456                          lofsfail++;
1475 1457          }
1476 1458  
1477      -#ifdef CACHEFS_BUG
1478      -        if (vp->v.vfs_fstype && (strcmp(vp->v.vfs_fstype, "cachefs") == 0))
1479      -                cachefs_running = 0;
1480      -#endif
1481      -
1482 1459          vp->exitcode = ret;
1483 1460          return (ret);
1484 1461  }
1485 1462  
1486 1463  
1487 1464  static vfsent_t zvmount = { 0 };
1488 1465  
1489 1466  vfsent_t *
1490 1467  new_vfsent(struct vfstab *vin, int order)
1491 1468  {
↓ open down ↓ 154 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX