logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

pr.h (1630B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _PR_H
  3. #define _PR_H
  4. #include <linux/types.h>
  5. enum pr_status {
  6. PR_STS_SUCCESS = 0x0,
  7. /*
  8. * The following error codes are based on SCSI, because the interface
  9. * was originally created for it and has existing users.
  10. */
  11. /* Generic device failure. */
  12. PR_STS_IOERR = 0x2,
  13. PR_STS_RESERVATION_CONFLICT = 0x18,
  14. /* Temporary path failure that can be retried. */
  15. PR_STS_RETRY_PATH_FAILURE = 0xe0000,
  16. /* The request was failed due to a fast failure timer. */
  17. PR_STS_PATH_FAST_FAILED = 0xf0000,
  18. /* The path cannot be reached and has been marked as failed. */
  19. PR_STS_PATH_FAILED = 0x10000,
  20. };
  21. enum pr_type {
  22. PR_WRITE_EXCLUSIVE = 1,
  23. PR_EXCLUSIVE_ACCESS = 2,
  24. PR_WRITE_EXCLUSIVE_REG_ONLY = 3,
  25. PR_EXCLUSIVE_ACCESS_REG_ONLY = 4,
  26. PR_WRITE_EXCLUSIVE_ALL_REGS = 5,
  27. PR_EXCLUSIVE_ACCESS_ALL_REGS = 6,
  28. };
  29. struct pr_reservation {
  30. __u64 key;
  31. __u32 type;
  32. __u32 flags;
  33. };
  34. struct pr_registration {
  35. __u64 old_key;
  36. __u64 new_key;
  37. __u32 flags;
  38. __u32 __pad;
  39. };
  40. struct pr_preempt {
  41. __u64 old_key;
  42. __u64 new_key;
  43. __u32 type;
  44. __u32 flags;
  45. };
  46. struct pr_clear {
  47. __u64 key;
  48. __u32 flags;
  49. __u32 __pad;
  50. };
  51. #define PR_FL_IGNORE_KEY (1 << 0) /* ignore existing key */
  52. #define IOC_PR_REGISTER _IOW('p', 200, struct pr_registration)
  53. #define IOC_PR_RESERVE _IOW('p', 201, struct pr_reservation)
  54. #define IOC_PR_RELEASE _IOW('p', 202, struct pr_reservation)
  55. #define IOC_PR_PREEMPT _IOW('p', 203, struct pr_preempt)
  56. #define IOC_PR_PREEMPT_ABORT _IOW('p', 204, struct pr_preempt)
  57. #define IOC_PR_CLEAR _IOW('p', 205, struct pr_clear)
  58. #endif /* _PR_H */