Print this page
6198 Let's EOL cachefs

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fs.d/umount.c
          +++ new/usr/src/cmd/fs.d/umount.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   28  /*        All Rights Reserved   */
  28   29  
  29   30  
  30   31  #include        <stdio.h>
  31   32  #include        <stdio_ext.h>
  32   33  #include        <limits.h>
  33   34  #include        <unistd.h>
↓ open down ↓ 38 lines elided ↑ open up ↑
  72   73  char    *oarg, *farg;
  73   74  int     maxrun, nrun;
  74   75  int     no_mnttab;
  75   76  int     lofscnt;                /* presence of lofs prohibits parallel */
  76   77                                  /* umounting */
  77   78  int     exitcode;
  78   79  char    resolve[MAXPATHLEN];
  79   80  static  char ibuf[BUFSIZ];
  80   81  
  81   82  /*
  82      - * Currently, mounting cachefs's simultaneous uncovers various problems.
  83      - * For the short term, we serialize cachefs activity while we fix
  84      - * these cachefs bugs.
  85      - */
  86      -#define CACHEFS_BUG
  87      -#ifdef  CACHEFS_BUG
  88      -#include        <sys/fs/cachefs_fs.h>   /* for BACKMNT_NAME */
  89      -int     cachefs_running;        /* parallel cachefs not supported yet */
  90      -#endif
  91      -
  92      -/*
  93   83   * The basic mount struct that describes an mnttab entry.
  94   84   * It is used both in an array and as a linked list elem.
  95   85   */
  96   86  
  97   87  typedef struct mountent {
  98   88          struct mnttab   ment;           /* the mnttab data */
  99   89          int             mlevel;         /* mount level of the mount pt */
 100   90          pid_t           pid;            /* the pid of this mount process */
 101   91  #define RDPIPE          0
 102   92  #define WRPIPE          1
↓ open down ↓ 708 lines elided ↑ open up ↑
 811  801                          mp = *ml;       /* possible first entry */
 812  802                          lofscnt--;      /* so we don't do this again */
 813  803                  }
 814  804  
 815  805                  while (setup_iopipe(mp) == -1 && (dowait() != -1))
 816  806                          ;
 817  807  
 818  808                  while (nrun >= maxrun && (dowait() != -1))      /* throttle */
 819  809                          ;
 820  810  
 821      -#ifdef CACHEFS_BUG
 822      -                /*
 823      -                 * If this is the back file system, then let cachefs/umount
 824      -                 * unmount it.
 825      -                 */
 826      -                if (strstr(mp->ment.mnt_mountp, BACKMNT_NAME))
 827      -                        continue;
 828      -
 829      -
 830      -                if (mp->ment.mnt_fstype &&
 831      -                    (strcmp(mp->ment.mnt_fstype, "cachefs") == 0)) {
 832      -                        while (cachefs_running && (dowait() != -1))
 833      -                                        ;
 834      -                        cachefs_running = 1;
 835      -                }
 836      -#endif
 837      -
 838  811                  if ((pid = fork()) == -1) {
 839  812                          perror("fork");
 840  813                          cleanup(-1);
 841  814                          /* not reached */
 842  815                  }
 843  816  #ifdef DEBUG
 844  817                  if (dflg && pid > 0) {
 845  818                          fprintf(stderr, "parent %d: umounting %d %s\n",
 846  819                              getpid(), pid, mp->ment.mnt_mountp);
 847  820                  }
↓ open down ↓ 89 lines elided ↑ open up ↑
 937  910  #endif
 938  911                  exitcode = 1;
 939  912                  return (1);
 940  913          }
 941  914          doio(mp);       /* Any output? */
 942  915  
 943  916          if (mp->ment.mnt_fstype &&
 944  917              (strcmp(mp->ment.mnt_fstype, MNTTYPE_LOFS) == 0))
 945  918                  lofscnt--;
 946  919  
 947      -#ifdef CACHEFS_BUG
 948      -        if (mp->ment.mnt_fstype &&
 949      -            (strcmp(mp->ment.mnt_fstype, "cachefs") == 0))
 950      -                cachefs_running = 0;
 951      -#endif
 952      -
 953  920          return (ret);
 954  921  }
 955  922  
 956  923  static const mountent_t zmount = { 0 };
 957  924  
 958  925  mountent_t *
 959  926  new_mountent(struct mnttab *ment)
 960  927  {
 961  928          mountent_t *new;
 962  929  
↓ open down ↓ 105 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX