Add dm module as dependency and remove module_hold/module_rele calls.

This commit is contained in:
haad 2009-01-14 00:56:15 +00:00
parent 4768b70dfe
commit 2df042407e
4 changed files with 8 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dm_target_error.c,v 1.5 2009/01/02 11:06:17 haad Exp $ */
/* $NetBSD: dm_target_error.c,v 1.6 2009/01/14 00:56:15 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -50,7 +50,7 @@
#include <sys/kernel.h>
#include <sys/module.h>
MODULE(MODULE_CLASS_MISC, dm_target_error, NULL);
MODULE(MODULE_CLASS_MISC, dm_target_error, "dm");
static int
dm_target_error_modcmd(modcmd_t cmd, void *arg)
@ -61,9 +61,6 @@ dm_target_error_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
if ((r = module_hold("dm")) != 0)
return r;
if ((dmt = dm_target_lookup("error")) != NULL)
return EEXIST;
@ -86,8 +83,6 @@ dm_target_error_modcmd(modcmd_t cmd, void *arg)
case MODULE_CMD_FINI:
r = dm_target_rem("error");
module_rele("dm"); /* release usage counter on dm module */
break;
case MODULE_CMD_STAT:

View File

@ -1,4 +1,4 @@
/*$NetBSD: dm_target_mirror.c,v 1.2 2009/01/02 22:33:51 haad Exp $*/
/*$NetBSD: dm_target_mirror.c,v 1.3 2009/01/14 00:56:15 haad Exp $*/
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -50,7 +50,7 @@
#include <sys/kernel.h>
#include <sys/module.h>
MODULE(MODULE_CLASS_MISC, dm_target_mirror, NULL);
MODULE(MODULE_CLASS_MISC, dm_target_mirror, "dm");
static int
dm_target_mirror_modcmd(modcmd_t cmd, void *arg)
@ -61,9 +61,6 @@ dm_target_mirror_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
if ((r = module_hold("dm")) != 0)
return r;
if ((dmt = dm_target_lookup("mirror")) != NULL)
return EEXIST;
@ -86,7 +83,6 @@ dm_target_mirror_modcmd(modcmd_t cmd, void *arg)
case MODULE_CMD_FINI:
r = dm_target_rem("mirror");
module_rele("dm"); /* release usage counter on dm module */
break;
case MODULE_CMD_STAT:

View File

@ -1,4 +1,4 @@
/* $NetBSD: dm_target_snapshot.c,v 1.6 2009/01/02 11:06:17 haad Exp $ */
/* $NetBSD: dm_target_snapshot.c,v 1.7 2009/01/14 00:56:15 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -96,7 +96,7 @@
#include <sys/kernel.h>
#include <sys/module.h>
MODULE(MODULE_CLASS_MISC, dm_target_snapshot, NULL);
MODULE(MODULE_CLASS_MISC, dm_target_snapshot, "dm");
static int
dm_target_snapshot_modcmd(modcmd_t cmd, void *arg)
@ -107,9 +107,6 @@ dm_target_snapshot_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
if ((r = module_hold("dm")) != 0)
return r;
if (((dmt = dm_target_lookup("snapshot")) != NULL) ||
(((dmt = dm_target_lookup("snapshot-origin")) != NULL)))
return EEXIST;
@ -153,8 +150,6 @@ dm_target_snapshot_modcmd(modcmd_t cmd, void *arg)
if ((r = dm_target_rem("snapshot")) == 0)
r = dm_target_rem("snapshot-origin");
module_rele("dm"); /* release usage counter on dm module */
break;
case MODULE_CMD_STAT:

View File

@ -1,4 +1,4 @@
/* $NetBSD: dm_target_zero.c,v 1.5 2009/01/02 11:06:17 haad Exp $ */
/* $NetBSD: dm_target_zero.c,v 1.6 2009/01/14 00:56:15 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -51,7 +51,7 @@
#include <sys/kernel.h>
#include <sys/module.h>
MODULE(MODULE_CLASS_MISC, dm_target_zero, NULL);
MODULE(MODULE_CLASS_MISC, dm_target_zero, "dm");
static int
dm_target_zero_modcmd(modcmd_t cmd, void *arg)
@ -62,9 +62,6 @@ dm_target_zero_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
if ((r = module_hold("dm")) != 0)
return r;
if ((dmt = dm_target_lookup("zero")) != NULL)
return EEXIST;
@ -86,7 +83,6 @@ dm_target_zero_modcmd(modcmd_t cmd, void *arg)
case MODULE_CMD_FINI:
r = dm_target_rem("zero");
module_rele("dm"); /* release usage counter on dm module */
break;