dlm_device.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /******************************************************************************
  2. *******************************************************************************
  3. **
  4. ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
  5. ** Copyright (C) 2004-2005 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 5
  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 flags;
  26. __u32 lkid;
  27. __u32 parent;
  28. void __user *castparam;
  29. void __user *castaddr;
  30. void __user *bastparam;
  31. void __user *bastaddr;
  32. struct dlm_lksb __user *lksb;
  33. char lvb[DLM_USER_LVB_LEN];
  34. char name[0];
  35. };
  36. struct dlm_lspace_params {
  37. __u32 flags;
  38. __u32 minor;
  39. char name[0];
  40. };
  41. struct dlm_write_request {
  42. __u32 version[3];
  43. __u8 cmd;
  44. __u8 is64bit;
  45. __u8 unused[2];
  46. union {
  47. struct dlm_lock_params lock;
  48. struct dlm_lspace_params lspace;
  49. } i;
  50. };
  51. /* struct read from the "device" fd,
  52. consists mainly of userspace pointers for the library to use */
  53. struct dlm_lock_result {
  54. __u32 length;
  55. void __user * user_astaddr;
  56. void __user * user_astparam;
  57. struct dlm_lksb __user * user_lksb;
  58. struct dlm_lksb lksb;
  59. __u8 bast_mode;
  60. __u8 unused[3];
  61. /* Offsets may be zero if no data is present */
  62. __u32 lvb_offset;
  63. };
  64. /* Commands passed to the device */
  65. #define DLM_USER_LOCK 1
  66. #define DLM_USER_UNLOCK 2
  67. #define DLM_USER_QUERY 3
  68. #define DLM_USER_CREATE_LOCKSPACE 4
  69. #define DLM_USER_REMOVE_LOCKSPACE 5
  70. /* Arbitrary length restriction */
  71. #define MAX_LS_NAME_LEN 64
  72. /* Lockspace flags */
  73. #define DLM_USER_LSFLG_AUTOFREE 1
  74. #define DLM_USER_LSFLG_FORCEFREE 2