mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel: Add ioctl request for getting a storage device's block size
This commit is contained in:
parent
8d631dcd5e
commit
b2e57f555b
2 changed files with 7 additions and 0 deletions
|
@ -196,6 +196,11 @@ KResult StorageDevice::ioctl(OpenFileDescription&, unsigned request, Userspace<v
|
|||
return copy_to_user(Userspace<size_t*>(arg), &disk_size);
|
||||
break;
|
||||
}
|
||||
case STORAGE_DEVICE_GET_BLOCK_SIZE: {
|
||||
size_t size = block_size();
|
||||
return copy_to_user(Userspace<size_t*>(arg), &size);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ enum IOCtlNumber {
|
|||
SOUNDCARD_IOCTL_SET_SAMPLE_RATE,
|
||||
SOUNDCARD_IOCTL_GET_SAMPLE_RATE,
|
||||
STORAGE_DEVICE_GET_SIZE,
|
||||
STORAGE_DEVICE_GET_BLOCK_SIZE,
|
||||
};
|
||||
|
||||
#define TIOCGPGRP TIOCGPGRP
|
||||
|
@ -134,3 +135,4 @@ enum IOCtlNumber {
|
|||
#define SOUNDCARD_IOCTL_SET_SAMPLE_RATE SOUNDCARD_IOCTL_SET_SAMPLE_RATE
|
||||
#define SOUNDCARD_IOCTL_GET_SAMPLE_RATE SOUNDCARD_IOCTL_GET_SAMPLE_RATE
|
||||
#define STORAGE_DEVICE_GET_SIZE STORAGE_DEVICE_GET_SIZE
|
||||
#define STORAGE_DEVICE_GET_BLOCK_SIZE STORAGE_DEVICE_GET_BLOCK_SIZE
|
||||
|
|
Loading…
Add table
Reference in a new issue