dlm_device.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /******************************************************************************
  2. *******************************************************************************
  3. **
  4. ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
  5. ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  6. **
  7. ** This copyrighted material is made available to anyone wishing to use,
  8. ** modify, copy, or redistribute it subject to the terms and conditions
  9. ** of the GNU General Public License v.2.
  10. **
  11. *******************************************************************************
  12. ******************************************************************************/
  13. /* This is the device interface for dlm, most users will use a library
  14. * interface.
  15. */
  16. #define DLM_USER_LVB_LEN 32
  17. /* Version of the device interface */
  18. #define DLM_DEVICE_VERSION_MAJOR 6
  19. #define DLM_DEVICE_VERSION_MINOR 0
  20. #define DLM_DEVICE_VERSION_PATCH 0
  21. /* struct passed to the lock write */
  22. struct dlm_lock_params {
  23. __u8 mode;
  24. __u8 namelen;
  25. __u16 unused;
  26. __u32 flags;
  27. __u32 lkid;
  28. __u32 parent;
  29. __u64 xid;
  30. __u64 timeout;
  31. void __user *castparam;
  32. void __user *castaddr;
  33. void __user *bastparam;
  34. void __user *bastaddr;
  35. struct dlm_lksb __user *lksb;
  36. char lvb[DLM_USER_LVB_LEN];
  37. char name[0];
  38. };
  39. struct dlm_lspace_params {
  40. __u32 flags;
  41. __u32 minor;
  42. char name[0];
  43. };
  44. struct dlm_purge_params {
  45. __u32 nodeid;
  46. __u32 pid;
  47. };
  48. struct dlm_write_request {
  49. __u32 version[3];
  50. __u8 cmd;
  51. __u8 is64bit;
  52. __u8 unused[2];
  53. union {
  54. struct dlm_lock_params lock;
  55. struct dlm_lspace_params lspace;
  56. struct dlm_purge_params purge;
  57. } i;
  58. };
  59. struct dlm_device_version {
  60. __u32 version[3];
  61. };
  62. /* struct read from the "device" fd,
  63. consists mainly of userspace pointers for the library to use */
  64. struct dlm_lock_result {
  65. __u32 version[3];
  66. __u32 length;
  67. void __user * user_astaddr;
  68. void __user * user_astparam;
  69. struct dlm_lksb __user * user_lksb;
  70. struct dlm_lksb lksb;
  71. __u8 bast_mode;
  72. __u8 unused[3];
  73. /* Offsets may be zero if no data is present */
  74. __u32 lvb_offset;
  75. };
  76. /* Commands passed to the device */
  77. #define DLM_USER_LOCK 1
  78. #define DLM_USER_UNLOCK 2
  79. #define DLM_USER_QUERY 3
  80. #define DLM_USER_CREATE_LOCKSPACE 4
  81. #define DLM_USER_REMOVE_LOCKSPACE 5
  82. #define DLM_USER_PURGE 6
  83. #define DLM_USER_DEADLOCK 7
  84. /* Arbitrary length restriction */
  85. #define MAX_LS_NAME_LEN 64
  86. /* Lockspace flags */
  87. #define DLM_USER_LSFLG_AUTOFREE 1
  88. #define DLM_USER_LSFLG_FORCEFREE 2