Print this page
    
6198 Let's EOL cachefs
    
      
        | Split | Close | 
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/lib/lvm/libmeta/common/meta_mount.c
          +++ new/usr/src/lib/lvm/libmeta/common/meta_mount.c
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  
    | ↓ 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 2006 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      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27   27  
  28   28  /*
  29   29   * return mount association with meta device
  30   30   */
  31   31  
  32   32  #include <meta.h>
  33   33  
  34   34  #include <sys/mnttab.h>
  35   35  
  36   36  #include "meta_lib_prv.h"
  37   37  
  38   38  /*
  39   39   * return associated mount point with this mdname_t
  40   40   */
  41   41  char *
  42   42  meta_get_mountp(
  43   43          mdsetname_t     *sp,
  44   44          mdname_t        *np,
  45   45          md_error_t      *ep
  46   46  )
  47   47  {
  48   48          FILE            *mfp;
  49   49          struct mnttab    m;
  50   50          char            *mountp = NULL;
  51   51          char            mnt_mountp[MNT_LINE_MAX];
  52   52          char            mnt_special[MNT_LINE_MAX];
  53   53  
  54   54          /* should have a set */
  55   55          assert(sp != NULL);
  56   56  
  57   57          /* look in mnttab */
  58   58          if ((mfp = open_mnttab()) == NULL) {
  59   59                  (void) mdsyserror(ep, errno, MNTTAB);
  60   60                  return (NULL);
  61   61          }
  62   62  
  63   63          while ((!mountp) && (getmntent(mfp, &m) == 0)) {
  64   64                  mdname_t        *mnp;
  65   65  
  
    | ↓ open down ↓ | 29 lines elided | ↑ open up ↑ | 
  66   66                  if ((m.mnt_special == NULL) || (m.mnt_mountp == NULL))
  67   67                          continue;
  68   68  
  69   69                  if (m.mnt_mountp[0] != '/')
  70   70                          continue;
  71   71  
  72   72                  if ((strcmp(m.mnt_fstype, "nfs") == 0) ||
  73   73                      (strcmp(m.mnt_fstype, "autofs") == 0) ||
  74   74                      (strcmp(m.mnt_fstype, "proc") == 0) ||
  75   75                      (strcmp(m.mnt_fstype, "tmpfs") == 0) ||
  76      -                    (strcmp(m.mnt_fstype, "cachefs") == 0) ||
  77   76                      (strcmp(m.mnt_fstype, "lofs") == 0) ||
  78   77                      (strcmp(m.mnt_fstype, "rfs") == 0) ||
  79   78                      (strcmp(m.mnt_fstype, "fd") == 0))
  80   79                          continue;
  81   80  
  82   81                  (void) strcpy(mnt_mountp, m.mnt_mountp);
  83   82                  (void) strcpy(mnt_special, m.mnt_special);
  84   83                  if ((mnp = metaname(&sp, mnt_special, UNKNOWN, ep)) == NULL) {
  85   84                          mdclrerror(ep);
  86   85                          continue;
  87   86                  }
  88   87  
  89   88                  if (np->dev == mnp->dev) {
  90   89                          mountp = mnt_mountp;
  91   90                  }
  92   91          }
  93   92  
  94   93          /* return success, if found */
  95   94          return (mountp? Strdup(mountp): NULL);
  96   95  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX