blkpg.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef __LINUX_BLKPG_H
  2. #define __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/ioctl.h>
  27. #define BLKPG _IO(0x12,105)
  28. /* The argument structure */
  29. struct blkpg_ioctl_arg {
  30. int op;
  31. int flags;
  32. int datalen;
  33. void *data;
  34. };
  35. /* The subfunctions (for the op field) */
  36. #define BLKPG_ADD_PARTITION 1
  37. #define BLKPG_DEL_PARTITION 2
  38. #define BLKPG_RESIZE_PARTITION 3
  39. /* Sizes of name fields. Unused at present. */
  40. #define BLKPG_DEVNAMELTH 64
  41. #define BLKPG_VOLNAMELTH 64
  42. /* The data structure for ADD_PARTITION and DEL_PARTITION */
  43. struct blkpg_partition {
  44. long long start; /* starting offset in bytes */
  45. long long length; /* length in bytes */
  46. int pno; /* partition number */
  47. char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
  48. to be used in kernel messages */
  49. char volname[BLKPG_VOLNAMELTH]; /* volume label */
  50. };
  51. #endif /* __LINUX_BLKPG_H */