Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153502735
D25694.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25694.id.diff
View Options
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(§orsize, (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)§orsize, 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
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 12:11 PM (20 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31977983
Default Alt Text
D25694.id.diff (1 KB)
Attached To
Mode
D25694: Make linux(4) support BLKPBSZGET
Attached
Detach File
Event Timeline
Log In to Comment