]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/miscfs/devfs/devfs_vfsops.c
xnu-2422.115.4.tar.gz
[apple/xnu.git] / bsd / miscfs / devfs / devfs_vfsops.c
index c5875bd553ba771ed7a693539fb595e33d396af3..b40778e88c9cafb195e1ae693fce1d5a03b24db9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
 static int devfs_statfs( struct mount *mp, struct vfsstatfs *sbp, vfs_context_t ctx);
 static int devfs_vfs_getattr(mount_t mp, struct vfs_attr *fsap, vfs_context_t ctx);
 
+#if !defined(SECURE_KERNEL)
 extern int setup_kmem;
 __private_extern__ void devfs_setup_kmem(void);
-
+#endif
 
 /*-
  * Called from the generic VFS startups.
@@ -114,9 +115,11 @@ devfs_init(__unused struct vfsconf *vfsp)
                    UID_ROOT, GID_WHEEL, 0622, "console");
     devfs_make_node(makedev(2, 0), DEVFS_CHAR, 
                    UID_ROOT, GID_WHEEL, 0666, "tty");
+#if !defined(SECURE_KERNEL)
     if (setup_kmem) {
        devfs_setup_kmem();
     }
+#endif
     devfs_make_node(makedev(3, 2), DEVFS_CHAR, 
                    UID_ROOT, GID_WHEEL, 0666, "null");
     devfs_make_node(makedev(3, 3), DEVFS_CHAR, 
@@ -131,6 +134,7 @@ devfs_init(__unused struct vfsconf *vfsp)
     return 0;
 }
 
+#if !defined(SECURE_KERNEL)
 __private_extern__ void
 devfs_setup_kmem(void)
 {
@@ -139,6 +143,7 @@ devfs_setup_kmem(void)
        devfs_make_node(makedev(3, 1), DEVFS_CHAR, 
                    UID_ROOT, GID_KMEM, 0640, "kmem");
 }
+#endif
 
 
 /*-
@@ -495,10 +500,10 @@ devfs_kernel_mount(char * mntname)
        /*
         * Get vnode to be covered
         */
-       NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE,
+       NDINIT(&nd, LOOKUP, OP_MOUNT, FOLLOW | LOCKLEAF, UIO_SYSSPACE,
            CAST_USER_ADDR_T(mntname), ctx);
        if ((error = namei(&nd))) {
-           printf("devfs_kernel_mount: failed to find directory '%s', %d", 
+           printf("devfs_kernel_mount: failed to find directory '%s', %d\n", 
                   mntname, error);
            return (error);
        }
@@ -562,7 +567,7 @@ devfs_kernel_mount(char * mntname)
        error = devfs_mount(mp, NULL, USER_ADDR_NULL, ctx);
 
        if (error) {
-           printf("devfs_kernel_mount: mount %s failed: %d", mntname, error);
+           printf("devfs_kernel_mount: mount %s failed: %d\n", mntname, error);
            mp->mnt_vtable->vfc_refcount--;
 
            vfs_unbusy(mp);