mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Add two disk ioctls, giving user-level tools information about disk/array
stripe (optimal access block) size and offset.
This commit is contained in:
parent
f00919d2fc
commit
8b30323843
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200934
|
@ -323,7 +323,12 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
|
|||
return (ENOENT);
|
||||
strlcpy(data, pp->name, i);
|
||||
break;
|
||||
|
||||
case DIOCGSTRIPESIZE:
|
||||
*(off_t *)data = cp->provider->stripesize;
|
||||
break;
|
||||
case DIOCGSTRIPEOFFSET:
|
||||
*(off_t *)data = cp->provider->stripeoffset;
|
||||
break;
|
||||
default:
|
||||
if (cp->provider->geom->ioctl != NULL) {
|
||||
error = cp->provider->geom->ioctl(cp->provider, cmd, data, fflag, td);
|
||||
|
|
|
@ -104,4 +104,16 @@ void disk_err(struct bio *bp, const char *what, int blkdone, int nl);
|
|||
* must be at least MAXPATHLEN bytes long.
|
||||
*/
|
||||
|
||||
#define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */
|
||||
/*-
|
||||
* Get the size of the device's optimal access block in bytes.
|
||||
* This should be a multiple of the sectorsize.
|
||||
*/
|
||||
|
||||
#define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */
|
||||
/*-
|
||||
* Get the offset of the first device's optimal access block in bytes.
|
||||
* This should be a multiple of the sectorsize.
|
||||
*/
|
||||
|
||||
#endif /* _SYS_DISK_H_ */
|
||||
|
|
Loading…
Reference in a new issue