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 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2016 Nexenta Systems, Inc.
26 * Copyright (c) 2017 by Delphix. All rights reserved.
27 */
28
29 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
30 /* All Rights Reserved */
31
32 /*
33 * University Copyright- Copyright (c) 1982, 1986, 1988
34 * The Regents of the University of California
35 * All Rights Reserved
36 *
37 * University Acknowledgment- Portions of this document are derived from
38 * software developed by the University of California, Berkeley, and its
39 * contributors.
40 */
41
42 #include <sys/types.h>
43 #include <sys/t_lock.h>
44 #include <sys/param.h>
45 #include <sys/systm.h>
46 #include <sys/bitmap.h>
47 #include <sys/sysmacros.h>
797 static int
798 mountfs(struct vfs *vfsp, enum whymountroot why, struct vnode *devvp,
799 char *path, cred_t *cr, int isroot, void *raw_argsp, int args_len)
800 {
801 dev_t dev = devvp->v_rdev;
802 struct fs *fsp;
803 struct ufsvfs *ufsvfsp = 0;
804 struct buf *bp = 0;
805 struct buf *tp = 0;
806 struct dk_cinfo ci;
807 int error = 0;
808 size_t len;
809 int needclose = 0;
810 int needtrans = 0;
811 struct inode *rip;
812 struct vnode *rvp = NULL;
813 int flags = 0;
814 kmutex_t *ihm;
815 int elapsed;
816 int status;
817 extern int maxphys;
818
819 if (args_len == sizeof (struct ufs_args) && raw_argsp)
820 flags = ((struct ufs_args *)raw_argsp)->flags;
821
822 ASSERT(vfs_lock_held(vfsp));
823
824 if (why == ROOT_INIT) {
825 /*
826 * Open block device mounted on.
827 * When bio is fixed for vnodes this can all be vnode
828 * operations.
829 */
830 error = VOP_OPEN(&devvp,
831 (vfsp->vfs_flag & VFS_RDONLY) ? FREAD : FREAD|FWRITE,
832 cr, NULL);
833 if (error)
834 goto out;
835 needclose = 1;
836
837 /*
|
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 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2016 Nexenta Systems, Inc.
26 * Copyright (c) 2017 by Delphix. All rights reserved.
27 */
28 /*
29 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
30 */
31
32 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
33 /* All Rights Reserved */
34
35 /*
36 * University Copyright- Copyright (c) 1982, 1986, 1988
37 * The Regents of the University of California
38 * All Rights Reserved
39 *
40 * University Acknowledgment- Portions of this document are derived from
41 * software developed by the University of California, Berkeley, and its
42 * contributors.
43 */
44
45 #include <sys/types.h>
46 #include <sys/t_lock.h>
47 #include <sys/param.h>
48 #include <sys/systm.h>
49 #include <sys/bitmap.h>
50 #include <sys/sysmacros.h>
800 static int
801 mountfs(struct vfs *vfsp, enum whymountroot why, struct vnode *devvp,
802 char *path, cred_t *cr, int isroot, void *raw_argsp, int args_len)
803 {
804 dev_t dev = devvp->v_rdev;
805 struct fs *fsp;
806 struct ufsvfs *ufsvfsp = 0;
807 struct buf *bp = 0;
808 struct buf *tp = 0;
809 struct dk_cinfo ci;
810 int error = 0;
811 size_t len;
812 int needclose = 0;
813 int needtrans = 0;
814 struct inode *rip;
815 struct vnode *rvp = NULL;
816 int flags = 0;
817 kmutex_t *ihm;
818 int elapsed;
819 int status;
820
821 if (args_len == sizeof (struct ufs_args) && raw_argsp)
822 flags = ((struct ufs_args *)raw_argsp)->flags;
823
824 ASSERT(vfs_lock_held(vfsp));
825
826 if (why == ROOT_INIT) {
827 /*
828 * Open block device mounted on.
829 * When bio is fixed for vnodes this can all be vnode
830 * operations.
831 */
832 error = VOP_OPEN(&devvp,
833 (vfsp->vfs_flag & VFS_RDONLY) ? FREAD : FREAD|FWRITE,
834 cr, NULL);
835 if (error)
836 goto out;
837 needclose = 1;
838
839 /*
|