Greg Kroah-Hartman | 6f52b16 | 2017-11-01 15:08:43 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
Brian Norris | 53bb724 | 2015-09-21 13:26:59 -0700 | [diff] [blame] | 2 | #ifndef _UAPI__LINUX_BLKPG_H |
| 3 | #define _UAPI__LINUX_BLKPG_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | /* |
| 6 | * Partition table and disk geometry handling |
| 7 | * |
| 8 | * A single ioctl with lots of subfunctions: |
| 9 | * |
| 10 | * Device number stuff: |
| 11 | * get_whole_disk() (given the device number of a partition, |
| 12 | * find the device number of the encompassing disk) |
| 13 | * get_all_partitions() (given the device number of a disk, return the |
| 14 | * device numbers of all its known partitions) |
| 15 | * |
| 16 | * Partition stuff: |
| 17 | * add_partition() |
| 18 | * delete_partition() |
| 19 | * test_partition_in_use() (also for test_disk_in_use) |
| 20 | * |
| 21 | * Geometry stuff: |
| 22 | * get_geometry() |
| 23 | * set_geometry() |
| 24 | * get_bios_drivedata() |
| 25 | * |
| 26 | * For today, only the partition stuff - aeb, 990515 |
| 27 | */ |
David Woodhouse | acc429a | 2006-04-27 16:46:56 +0100 | [diff] [blame] | 28 | #include <linux/compiler.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | #include <linux/ioctl.h> |
| 30 | |
| 31 | #define BLKPG _IO(0x12,105) |
| 32 | |
| 33 | /* The argument structure */ |
| 34 | struct blkpg_ioctl_arg { |
| 35 | int op; |
| 36 | int flags; |
| 37 | int datalen; |
| 38 | void __user *data; |
| 39 | }; |
| 40 | |
| 41 | /* The subfunctions (for the op field) */ |
| 42 | #define BLKPG_ADD_PARTITION 1 |
| 43 | #define BLKPG_DEL_PARTITION 2 |
Vivek Goyal | c83f6bf | 2012-08-01 12:24:18 +0200 | [diff] [blame] | 44 | #define BLKPG_RESIZE_PARTITION 3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | /* Sizes of name fields. Unused at present. */ |
| 47 | #define BLKPG_DEVNAMELTH 64 |
| 48 | #define BLKPG_VOLNAMELTH 64 |
| 49 | |
| 50 | /* The data structure for ADD_PARTITION and DEL_PARTITION */ |
| 51 | struct blkpg_partition { |
| 52 | long long start; /* starting offset in bytes */ |
| 53 | long long length; /* length in bytes */ |
| 54 | int pno; /* partition number */ |
| 55 | char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2, |
| 56 | to be used in kernel messages */ |
| 57 | char volname[BLKPG_VOLNAMELTH]; /* volume label */ |
| 58 | }; |
| 59 | |
Brian Norris | 53bb724 | 2015-09-21 13:26:59 -0700 | [diff] [blame] | 60 | #endif /* _UAPI__LINUX_BLKPG_H */ |