Print this page
6198 Let's EOL cachefs


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2012, Joyent, Inc. All rights reserved.

  24  */
  25 
  26 /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  27 /*        All Rights Reserved   */
  28 
  29 /*
  30  * University Copyright- Copyright (c) 1982, 1986, 1988
  31  * The Regents of the University of California
  32  * All Rights Reserved
  33  *
  34  * University Acknowledgment- Portions of this document are derived from
  35  * software developed by the University of California, Berkeley, and its
  36  * contributors.
  37  */
  38 
  39 #include <sys/types.h>
  40 #include <sys/t_lock.h>
  41 #include <sys/param.h>
  42 #include <sys/errno.h>
  43 #include <sys/user.h>


4638                 console_gets(name, namelen);
4639         }
4640 }
4641 
4642 /*
4643  * Init the root filesystem type (rootfs.bo_fstype) from the "fstype"
4644  * property.
4645  *
4646  * Filesystem types starting with the prefix "nfs" are diskless clients;
4647  * init the root filename name (rootfs.bo_name), too.
4648  *
4649  * If we are booting via NFS we currently have these options:
4650  *      nfs -   dynamically choose NFS V2, V3, or V4 (default)
4651  *      nfs2 -  force NFS V2
4652  *      nfs3 -  force NFS V3
4653  *      nfs4 -  force NFS V4
4654  * Because we need to maintain backward compatibility with the naming
4655  * convention that the NFS V2 filesystem name is "nfs" (see vfs_conf.c)
4656  * we need to map "nfs" => "nfsdyn" and "nfs2" => "nfs".  The dynamic
4657  * nfs module will map the type back to either "nfs", "nfs3", or "nfs4".
4658  * This is only for root filesystems, all other uses such as cachefs
4659  * will expect that "nfs" == NFS V2.
4660  */
4661 static void
4662 getrootfs(char **fstypp, char **fsmodp)
4663 {
4664         extern char *strplumb_get_netdev_path(void);
4665         char *propstr = NULL;
4666 
4667         /*
4668          * Check fstype property; for diskless it should be one of "nfs",
4669          * "nfs2", "nfs3" or "nfs4".
4670          */
4671         if (ddi_prop_lookup_string(DDI_DEV_T_ANY, ddi_root_node(),
4672             DDI_PROP_DONTPASS, "fstype", &propstr)
4673             == DDI_SUCCESS) {
4674                 (void) strncpy(rootfs.bo_fstype, propstr, BO_MAXFSNAME);
4675                 ddi_prop_free(propstr);
4676 
4677         /*
4678          * if the boot property 'fstype' is not set, but 'zfs-bootfs' is set,
4679          * assume the type of this root filesystem is 'zfs'.




   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  24  * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  25  */
  26 
  27 /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  28 /*        All Rights Reserved   */
  29 
  30 /*
  31  * University Copyright- Copyright (c) 1982, 1986, 1988
  32  * The Regents of the University of California
  33  * All Rights Reserved
  34  *
  35  * University Acknowledgment- Portions of this document are derived from
  36  * software developed by the University of California, Berkeley, and its
  37  * contributors.
  38  */
  39 
  40 #include <sys/types.h>
  41 #include <sys/t_lock.h>
  42 #include <sys/param.h>
  43 #include <sys/errno.h>
  44 #include <sys/user.h>


4639                 console_gets(name, namelen);
4640         }
4641 }
4642 
4643 /*
4644  * Init the root filesystem type (rootfs.bo_fstype) from the "fstype"
4645  * property.
4646  *
4647  * Filesystem types starting with the prefix "nfs" are diskless clients;
4648  * init the root filename name (rootfs.bo_name), too.
4649  *
4650  * If we are booting via NFS we currently have these options:
4651  *      nfs -   dynamically choose NFS V2, V3, or V4 (default)
4652  *      nfs2 -  force NFS V2
4653  *      nfs3 -  force NFS V3
4654  *      nfs4 -  force NFS V4
4655  * Because we need to maintain backward compatibility with the naming
4656  * convention that the NFS V2 filesystem name is "nfs" (see vfs_conf.c)
4657  * we need to map "nfs" => "nfsdyn" and "nfs2" => "nfs".  The dynamic
4658  * nfs module will map the type back to either "nfs", "nfs3", or "nfs4".
4659  * This is only for root filesystems, all other uses will expect
4660  * that "nfs" == NFS V2.
4661  */
4662 static void
4663 getrootfs(char **fstypp, char **fsmodp)
4664 {
4665         extern char *strplumb_get_netdev_path(void);
4666         char *propstr = NULL;
4667 
4668         /*
4669          * Check fstype property; for diskless it should be one of "nfs",
4670          * "nfs2", "nfs3" or "nfs4".
4671          */
4672         if (ddi_prop_lookup_string(DDI_DEV_T_ANY, ddi_root_node(),
4673             DDI_PROP_DONTPASS, "fstype", &propstr)
4674             == DDI_SUCCESS) {
4675                 (void) strncpy(rootfs.bo_fstype, propstr, BO_MAXFSNAME);
4676                 ddi_prop_free(propstr);
4677 
4678         /*
4679          * if the boot property 'fstype' is not set, but 'zfs-bootfs' is set,
4680          * assume the type of this root filesystem is 'zfs'.