]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/bsd_init.c
xnu-6153.41.3.tar.gz
[apple/xnu.git] / bsd / kern / bsd_init.c
index 3e2052fb03016c41249ca11603dbf12e321af472..bc5b709e0f185cdf5e3038557d0b6e61c90bb260 100644 (file)
 #include <net/restricted_in_port.h> /* for restricted_in_port_init() */
 #include <kern/assert.h>                /* for assert() */
 #include <sys/kern_overrides.h>         /* for init_system_override() */
+#include <sys/lockf.h>                  /* for lf_init() */
 
 #include <net/init.h>
 
@@ -315,6 +316,8 @@ __private_extern__ int bootarg_vnode_cache_defeat = 0;
 __private_extern__ int bootarg_no_vnode_jetsam = 0;
 #endif /* CONFIG_JETSAM && (DEVELOPMENT || DEBUG) */
 
+__private_extern__ int bootarg_no_vnode_drain = 0;
+
 /*
  * Prevent kernel-based ASLR from being used, for testing.
  */
@@ -760,6 +763,10 @@ bsd_init(void)
        bsd_init_kprintf("calling vfsinit\n");
        vfsinit();
 
+       /* Initialize file locks. */
+       bsd_init_kprintf("calling lf_init\n");
+       lf_init();
+
 #if CONFIG_PROC_UUID_POLICY
        /* Initial proc_uuid_policy subsystem */
        bsd_init_kprintf("calling proc_uuid_policy_init()\n");
@@ -1331,6 +1338,9 @@ parse_bsd_args(void)
        }
 #endif /* CONFIG_JETSAM && (DEVELOPMENT || DEBUG) */
 
+       if (PE_parse_boot_argn("-no_vnode_drain", namep, sizeof(namep))) {
+               bootarg_no_vnode_drain = 1;
+       }
 
 #if CONFIG_EMBEDDED
        /*