Page MenuHomeFreeBSD

D25694.id74643.diff
No OneTemporary

D25694.id74643.diff

Index: head/sys/compat/linux/linux_ioctl.h
===================================================================
--- head/sys/compat/linux/linux_ioctl.h
+++ head/sys/compat/linux/linux_ioctl.h
@@ -58,9 +58,10 @@
#define LINUX_BLKSECTGET 0x1267
#define LINUX_BLKSSZGET 0x1268
#define LINUX_BLKGETSIZE64 0x1272
+#define LINUX_BLKPBSZGET 0x127b
#define LINUX_IOCTL_DISK_MIN LINUX_BLKROSET
-#define LINUX_IOCTL_DISK_MAX LINUX_BLKGETSIZE64
+#define LINUX_IOCTL_DISK_MAX LINUX_BLKPBSZGET
/*
* hdio
Index: head/sys/compat/linux/linux_ioctl.c
===================================================================
--- head/sys/compat/linux/linux_ioctl.c
+++ head/sys/compat/linux/linux_ioctl.c
@@ -285,9 +285,9 @@
{
struct file *fp;
int error;
- u_int sectorsize;
+ u_int sectorsize, psectorsize;
uint64_t blksize64;
- off_t mediasize;
+ off_t mediasize, stripesize;
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
if (error != 0)
@@ -327,6 +327,27 @@
return (copyout(&sectorsize, (void *)args->arg,
sizeof(sectorsize)));
break;
+ case LINUX_BLKPBSZGET:
+ error = fo_ioctl(fp, DIOCGSTRIPESIZE,
+ (caddr_t)&stripesize, td->td_ucred, td);
+ if (error != 0) {
+ fdrop(fp, td);
+ return (error);
+ }
+ if (stripesize > 0 && stripesize <= 4096) {
+ psectorsize = stripesize;
+ } else {
+ error = fo_ioctl(fp, DIOCGSECTORSIZE,
+ (caddr_t)&sectorsize, td->td_ucred, td);
+ if (error != 0) {
+ fdrop(fp, td);
+ return (error);
+ }
+ psectorsize = sectorsize;
+ }
+ fdrop(fp, td);
+ return (copyout(&psectorsize, (void *)args->arg,
+ sizeof(psectorsize)));
}
fdrop(fp, td);
return (ENOIOCTL);

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 22, 12:17 PM (20 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31977983
Default Alt Text
D25694.id74643.diff (1 KB)

Event Timeline