From proff@iq.org  Thu Oct  2 12:03:18 1997
Received: from iq.org (proff@profane.iq.org [203.4.184.222])
          by hub.freebsd.org (8.8.7/8.8.7) with SMTP id MAA15639
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 2 Oct 1997 12:03:10 -0700 (PDT)
Received: (qmail 960 invoked by uid 110); 2 Oct 1997 19:02:56 -0000
Message-Id: <19971002190256.959.qmail@iq.org>
Date: 2 Oct 1997 19:02:56 -0000
From: proff@iq.org
Reply-To: proff@iq.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: <Synopsis of the problem (one line)> lkm version of vn.c
X-Send-Pr-Version: 3.2

>Number:         4680
>Category:       kern
>Synopsis:       lkm version of vn.c
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct  2 12:10:00 PDT 1997
>Closed-Date:    Mon Mar 29 17:58:22 PST 1999
>Last-Modified:  Mon Mar 29 17:58:52 PST 1999
>Originator:     Julian Assange
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
>Environment:

	

>Description:

	

	I sumitted this god knows how long ago (when vn.c had no DEVFS support - which I added).
	Now vn.c has DEVFS support so my lkm patch conflicted. this is a new one without DEVFS
	(not needed anymore)

>How-To-Repeat:

	

>Fix:
	

#      $Id: Makefile,v 1.5 1996/10/06 22:17:16 proff Exp $

.PATH:          ${.CURDIR}/../../sys/dev/vn
KMOD            = vn_mod
SRCS            = vn.c vn.h vnode_if.h
NOMAN           =
CFLAGS         += -nostdinc -I. -DDEVFS
CLEANFILES     += $(KMOD) machine vn.h vnode_if.h vnode_if.c
LN              = ln -f -s

load:	${PROG}
	${MODLOAD} -u -e vn $(PROG)

unload:	${PROG}
	${MODUNLOAD} -n vn

vn.h:
	echo "#define NVN 8" > vn.h

.c.o:
	-@$(LN) /sys/i386/include machine
	$(CC) $(CFLAGS) -c $<
	-@rm -f machine

.include <bsd.kmod.mk>

--- vn.c.orig	Fri Aug 15 12:38:10 1997
+++ vn.c	Fri Oct  3 04:56:11 1997
@@ -653,5 +653,46 @@
 
 SYSINIT(vndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,vn_drvinit,NULL)
 
+#ifdef ACTUALLY_LKM_NOT_KERNEL
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <sys/lkm.h>
+
+MOD_MISC(vn);
+
+static int vn_action (struct lkm_table *lkmtp, int cmd)
+{
+       int     error;
+       switch (cmd) {
+       case LKM_E_LOAD:
+               vn_drvinit(NULL);
+               error = 0;
+               break;
+       case LKM_E_UNLOAD:
+               vnshutdown(0, NULL);
+               /* not a real shutdown, so remove the hook */
+               rm_at_shutdown(&vnshutdown, NULL);
+               error = 0;
+               break;
+       case LKM_E_STAT:
+               error = 0;
+               break;
+       default:
+               error = EIO;
+       }
+       return error;
+}
+
+int vn_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+#ifdef MOD_DISPATCH
+       MOD_DISPATCH(vn, lkmtp, cmd, ver, vn_action, vn_action, vn_action);
+#else
+# define _module vn_module
+       DISPATCH(lkmtp, cmd, ver, vn_action, vn_action, vn_action);
+#endif
+}
+#endif /* !ACTUALLY_LKM_NOT_KERNEL */
 
 #endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: max 
Responsible-Changed-When: Thu Oct 2 15:50:31 PDT 1997 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Mar 29 17:58:22 PST 1999 
State-Changed-Why:  
vn kld added 1999/01/21 
>Unformatted:
