blkpg.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _UAPI__LINUX_BLKPG_H
  2. #define _UAPI__LINUX_BLKPG_H
  3. /*
  4. * Partition table and disk geometry handling
  5. *
  6. * A single ioctl with lots of subfunctions:
  7. *
  8. * Device number stuff:
  9. * get_whole_disk() (given the device number of a partition,
  10. * find the device number of the encompassing disk)
  11. * get_all_partitions() (given the device number of a disk, return the
  12. * device numbers of all its known partitions)
  13. *
  14. * Partition stuff:
  15. * add_partition()
  16. * delete_partition()
  17. * test_partition_in_use() (also for test_disk_in_use)
  18. *
  19. * Geometry stuff:
  20. * get_geometry()
  21. * set_geometry()
  22. * get_bios_drivedata()
  23. *
  24. * For today, only the partition stuff - aeb, 990515
  25. */
  26. #include <linux/compiler.h>
  27. #include <linux/ioctl.h>
  28. #define BLKPG _IO(0x12,105)
  29. /* The argument structure */
  30. struct blkpg_ioctl_arg {
  31. int op;
  32. int flags;
  33. int datalen;
  34. void __user *data;
  35. };
  36. /* The subfunctions (for the op field) */
  37. #define BLKPG_ADD_PARTITION 1
  38. #define BLKPG_DEL_PARTITION 2
  39. #define BLKPG_RESIZE_PARTITION 3
  40. /* Sizes of name fields. Unused at present. */
  41. #define BLKPG_DEVNAMELTH 64
  42. #define BLKPG_VOLNAMELTH 64
  43. /* The data structure for ADD_PARTITION and DEL_PARTITION */
  44. struct blkpg_partition {
  45. long long start; /* starting offset in bytes */
  46. long long length; /* length in bytes */
  47. int pno; /* partition number */
  48. char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
  49. to be used in kernel messages */
  50. char volname[BLKPG_VOLNAMELTH]; /* volume label */
  51. };
  52. #endif /* _UAPI__LINUX_BLKPG_H */