Module Name:    src
Committed By:   ahoka
Date:           Sat Aug 27 17:06:08 UTC 2011

Modified Files:
        src/sys/dev/dm: dm_target.c

Log Message:
Add a sanity check for missing functions in dmt


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/dm/dm_target.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dm/dm_target.c
diff -u src/sys/dev/dm/dm_target.c:1.15 src/sys/dev/dm/dm_target.c:1.16
--- src/sys/dev/dm/dm_target.c:1.15	Thu Dec 23 14:58:13 2010
+++ src/sys/dev/dm/dm_target.c	Sat Aug 27 17:06:08 2011
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target.c,v 1.15 2010/12/23 14:58:13 mlelstv Exp $      */
+/*        $NetBSD: dm_target.c,v 1.16 2011/08/27 17:06:08 ahoka Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -150,6 +150,16 @@
 {
 	dm_target_t *dmt;
 
+	/* Sanity check for any missing function */
+	KASSERT(dmt->init != NULL);
+	KASSERT(dmt->status != NULL);
+	KASSERT(dmt->strategy != NULL);
+	KASSERT(dmt->deps != NULL);
+	KASSERT(dmt->destroy != NULL);
+	KASSERT(dmt->upcall != NULL);
+	KASSERT(dmt->sync != NULL);
+	KASSERT(dmt->secsize != NULL);
+
 	mutex_enter(&dm_target_mutex);
 
 	dmt = dm_target_lookup_name(dm_target->name);

Reply via email to