Add VINUM_SETSTATE_FORCE ioctl for diddling individual object states.

This is a repair tool which can also be used for panicing the system.
Use with utmost care if at all.
This commit is contained in:
Greg Lehey 1999-08-24 02:26:15 +00:00
parent 21c3b10bbc
commit 4fe498363c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50285
2 changed files with 15 additions and 7 deletions

View File

@ -126,7 +126,7 @@ struct vinum_ioctl_msg {
#define VINUM_INITSD _IOW(L, 82, int) /* initialize a subdisk */
#define VINUM_REMOVE _IOWR(L, 83, struct vinum_ioctl_msg) /* remove an object */
#define VINUM_READPOL _IOWR(L, 84, struct vinum_ioctl_msg) /* set read policy */
/* 85 going begging */
#define VINUM_SETSTATE_FORCE _IOC(IOC_IN | IOC_OUT, L, 85, MAX_IOCTL_REPLY) /* diddle object state */
#define VINUM_RESETSTATS _IOWR(L, 86, struct vinum_ioctl_msg) /* reset object stats */
#define VINUM_ATTACH _IOWR(L, 87, struct vinum_ioctl_msg) /* attach an object */
#define VINUM_DETACH _IOWR(L, 88, struct vinum_ioctl_msg) /* remove an object */

View File

@ -60,7 +60,7 @@ void replaceobject(struct vinum_ioctl_msg *);
jmp_buf command_fail; /* return on a failed command */
/* ioctl routine */
int
int
vinumioctl(dev_t dev,
u_long cmd,
caddr_t data,
@ -220,6 +220,14 @@ vinumioctl(dev_t dev,
setstate((struct vinum_ioctl_msg *) data); /* set an object state */
return 0;
/*
* Set state by force, without changing
* anything else.
*/
case VINUM_SETSTATE_FORCE:
setstate_by_force((struct vinum_ioctl_msg *) data); /* set an object state */
return 0;
#ifdef VINUMDEBUG
case VINUM_MEMINFO:
vinum_meminfo(data);
@ -463,7 +471,7 @@ validvol(int volno, struct _ioctl_reply *reply)
}
/* reset an object's stats */
void
void
resetstats(struct vinum_ioctl_msg *msg)
{
struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
@ -542,7 +550,7 @@ resetstats(struct vinum_ioctl_msg *msg)
}
/* attach an object to a superior object */
void
void
attachobject(struct vinum_ioctl_msg *msg)
{
struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
@ -623,7 +631,7 @@ attachobject(struct vinum_ioctl_msg *msg)
}
/* detach an object from a superior object */
void
void
detachobject(struct vinum_ioctl_msg *msg)
{
struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
@ -751,7 +759,7 @@ detachobject(struct vinum_ioctl_msg *msg)
}
}
void
void
renameobject(struct vinum_rename_msg *msg)
{
struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
@ -832,7 +840,7 @@ renameobject(struct vinum_rename_msg *msg)
* message->index is the drive number of the old drive
* message->otherobject is the drive number of the new drive
*/
void
void
replaceobject(struct vinum_ioctl_msg *msg)
{
struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;