+ /*
+ * If MNT_IOFLAGS_NOSWAP is set, opening the swap file should fail.
+ * To avoid a race on the mount we only make this check after creating the
+ * vnode.
+ */
+ if ((*vp)->v_mount->mnt_kern_flag & MNTK_NOSWAP) {
+ vnode_put(*vp);
+ vm_swapfile_close((uint64_t)path, *vp);
+ *vp = NULL;
+ return;
+ }
+