Date: Tue, 5 Jan 2010 13:51:23 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r201583 - in stable/8/sys: geom sys Message-ID: <201001051351.o05DpNtE014767@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Jan 5 13:51:23 2010 New Revision: 201583 URL: http://svn.freebsd.org/changeset/base/201583 Log: MFC r200934: Add two disk ioctls, giving user-level tools information about disk/array stripe (optimal access block) size and offset. Modified: stable/8/sys/geom/geom_dev.c stable/8/sys/sys/disk.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Tue Jan 5 13:50:14 2010 (r201582) +++ stable/8/sys/geom/geom_dev.c Tue Jan 5 13:51:23 2010 (r201583) @@ -323,7 +323,12 @@ g_dev_ioctl(struct cdev *dev, u_long cmd 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); Modified: stable/8/sys/sys/disk.h ============================================================================== --- stable/8/sys/sys/disk.h Tue Jan 5 13:50:14 2010 (r201582) +++ stable/8/sys/sys/disk.h Tue Jan 5 13:51:23 2010 (r201583) @@ -104,4 +104,16 @@ void disk_err(struct bio *bp, const char * 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_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001051351.o05DpNtE014767>