dlm_device.h 2.5 KB

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