Add VINUM_MOVE ioctl.
Fix transfer lengths for some ioctls. Rearrange file: put structs first, then ioctl requests.
This commit is contained in:
parent
f54047e7f4
commit
233fb3be1e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55441
@ -37,40 +37,20 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define L 'F' /* ID letter of our ioctls */
|
||||
|
||||
#ifdef VINUMDEBUG
|
||||
#define MAX_IOCTL_REPLY 1024
|
||||
#else
|
||||
#define MAX_IOCTL_REPLY 256
|
||||
#endif
|
||||
|
||||
#define L 'F' /* ID letter of our ioctls */
|
||||
/* VINUM_CREATE returns a buffer of this kind */
|
||||
struct _ioctl_reply {
|
||||
int error;
|
||||
char msg[MAX_IOCTL_REPLY];
|
||||
};
|
||||
|
||||
/* ioctl requests */
|
||||
#define BUFSIZE 1024 /* size of buffer, including continuations */
|
||||
#define VINUM_CREATE _IOC(IOC_IN | IOC_OUT, L, 64, BUFSIZE) /* configure vinum */
|
||||
#define VINUM_GETCONFIG _IOR(L, 65, struct _vinum_conf) /* get global config */
|
||||
#define VINUM_DRIVECONFIG _IOWR(L, 66, struct drive) /* get drive config */
|
||||
#define VINUM_SDCONFIG _IOWR(L, 67, struct sd) /* get subdisk config */
|
||||
#define VINUM_PLEXCONFIG _IOWR(L, 68, struct plex) /* get plex config */
|
||||
#define VINUM_VOLCONFIG _IOWR(L, 69, struct volume) /* get volume config */
|
||||
#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct sd) /* get sd config for plex (plex, sdno) */
|
||||
#define VINUM_GETFREELIST _IOWR(L, 71, struct drive_freelist) /* get freelist element (drive, fe) */
|
||||
#define VINUM_SAVECONFIG _IOW(L, 72, int) /* write config to disk */
|
||||
#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
|
||||
#define VINUM_INIT _IOC(0, L, 74, 0) /* read config from disk */
|
||||
#ifdef VINUMDEBUG
|
||||
|
||||
struct debuginfo {
|
||||
int changeit;
|
||||
int param;
|
||||
};
|
||||
|
||||
#define VINUM_DEBUG _IOWR(L, 75, struct debuginfo) /* call the debugger from ioctl () */
|
||||
#endif
|
||||
|
||||
enum objecttype {
|
||||
@ -82,18 +62,8 @@ enum objecttype {
|
||||
};
|
||||
|
||||
/*
|
||||
* Start an object. Pass two integers:
|
||||
* msg [0] index in vinum_conf.<object>
|
||||
* msg [1] type of object (see below)
|
||||
*
|
||||
* Return ioctl_reply
|
||||
*/
|
||||
#define VINUM_SETSTATE _IOC(IOC_IN | IOC_OUT, L, 76, MAX_IOCTL_REPLY) /* start an object */
|
||||
|
||||
/*
|
||||
* The state to set with VINUM_SETSTATE. Since
|
||||
* each object has a different set of states, we
|
||||
* need to translate later
|
||||
* The state to set with VINUM_SETSTATE. Since each object has a
|
||||
* different set of states, we need to translate later.
|
||||
*/
|
||||
enum objectstate {
|
||||
object_down,
|
||||
@ -121,6 +91,44 @@ struct vinum_ioctl_msg {
|
||||
int blocksize; /* size of block to revive (bytes) */
|
||||
};
|
||||
|
||||
/* VINUM_CREATE returns a buffer of this kind */
|
||||
struct _ioctl_reply {
|
||||
int error;
|
||||
char msg[MAX_IOCTL_REPLY];
|
||||
};
|
||||
|
||||
struct vinum_rename_msg {
|
||||
int index;
|
||||
int recurse; /* rename subordinate objects too */
|
||||
enum objecttype type;
|
||||
char newname[MAXNAME]; /* new name to give to object */
|
||||
};
|
||||
|
||||
/* ioctl requests */
|
||||
#define BUFSIZE 1024 /* size of buffer, including continuations */
|
||||
#define VINUM_CREATE _IOC(IOC_IN | IOC_OUT, L, 64, BUFSIZE) /* configure vinum */
|
||||
#define VINUM_GETCONFIG _IOR(L, 65, struct _vinum_conf) /* get global config */
|
||||
#define VINUM_DRIVECONFIG _IOWR(L, 66, struct drive) /* get drive config */
|
||||
#define VINUM_SDCONFIG _IOWR(L, 67, struct sd) /* get subdisk config */
|
||||
#define VINUM_PLEXCONFIG _IOWR(L, 68, struct plex) /* get plex config */
|
||||
#define VINUM_VOLCONFIG _IOWR(L, 69, struct volume) /* get volume config */
|
||||
#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct sd) /* get sd config for plex (plex, sdno) */
|
||||
#define VINUM_GETFREELIST _IOWR(L, 71, struct drive_freelist) /* get freelist element (drive, fe) */
|
||||
#define VINUM_SAVECONFIG _IOW(L, 72, int) /* write config to disk */
|
||||
#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
|
||||
#define VINUM_INIT _IOC(0, L, 74, 0) /* read config from disk */
|
||||
#ifdef VINUMDEBUG
|
||||
#define VINUM_DEBUG _IOWR(L, 75, struct debuginfo) /* call the debugger from ioctl () */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Start an object. Pass two integers:
|
||||
* msg [0] index in vinum_conf.<object>
|
||||
* msg [1] type of object (see below)
|
||||
*
|
||||
* Return ioctl_reply
|
||||
*/
|
||||
#define VINUM_SETSTATE _IOC(IOC_IN | IOC_OUT, L, 76, MAX_IOCTL_REPLY) /* start an object */
|
||||
#define VINUM_RELEASECONFIG _IOC(0, L, 77, 0) /* release locks and write config to disk */
|
||||
#define VINUM_STARTCONFIG _IOW(L, 78, int) /* start a configuration operation */
|
||||
#define VINUM_MEMINFO _IOR(L, 79, struct meminfo) /* get memory usage summary */
|
||||
@ -134,15 +142,8 @@ struct vinum_ioctl_msg {
|
||||
#define VINUM_ATTACH _IOWR(L, 87, struct _ioctl_reply) /* attach an object */
|
||||
#define VINUM_DETACH _IOWR(L, 88, struct _ioctl_reply) /* remove an object */
|
||||
|
||||
struct vinum_rename_msg {
|
||||
int index;
|
||||
int recurse; /* rename subordinate objects too */
|
||||
enum objecttype type;
|
||||
char newname[MAXNAME]; /* new name to give to object */
|
||||
};
|
||||
|
||||
#define VINUM_RENAME _IOWR(L, 89, struct vinum_rename_msg) /* rename an object */
|
||||
#define VINUM_REPLACE _IOWR(L, 90, struct vinum_rename_msg) /* replace an object */
|
||||
#define VINUM_RENAME _IOWR(L, 89, struct _ioctl_reply) /* rename an object */
|
||||
#define VINUM_REPLACE _IOWR(L, 90, struct _ioctl_reply) /* replace an object */
|
||||
|
||||
#ifdef VINUMDEBUG
|
||||
#define VINUM_RQINFO _IOWR(L, 91, struct rqinfo) /* get request info [i] from trace buffer */
|
||||
@ -154,3 +155,4 @@ struct vinum_rename_msg {
|
||||
#define VINUM_GETDAEMON _IOR(L, 95, int) /* get daemon flags */
|
||||
#define VINUM_CHECKPARITY _IOWR(L, 96, struct _ioctl_reply) /* check RAID-5 parity */
|
||||
#define VINUM_REBUILDPARITY _IOWR(L, 97, struct _ioctl_reply) /* rebuild RAID-5 parity */
|
||||
#define VINUM_MOVE _IOWR(L, 98, struct _ioctl_reply) /* move an object */
|
||||
|
Loading…
Reference in New Issue
Block a user