downcall.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * (C) 2001 Clemson University and The University of Chicago
  4. *
  5. * See COPYING in top-level directory.
  6. */
  7. /*
  8. * Definitions of downcalls used in Linux kernel module.
  9. */
  10. #ifndef __DOWNCALL_H
  11. #define __DOWNCALL_H
  12. /*
  13. * Sanitized the device-client core interaction
  14. * for clean 32-64 bit usage
  15. */
  16. struct orangefs_io_response {
  17. __s64 amt_complete;
  18. };
  19. struct orangefs_lookup_response {
  20. struct orangefs_object_kref refn;
  21. };
  22. struct orangefs_create_response {
  23. struct orangefs_object_kref refn;
  24. };
  25. struct orangefs_symlink_response {
  26. struct orangefs_object_kref refn;
  27. };
  28. struct orangefs_getattr_response {
  29. struct ORANGEFS_sys_attr_s attributes;
  30. char link_target[ORANGEFS_NAME_MAX];
  31. };
  32. struct orangefs_mkdir_response {
  33. struct orangefs_object_kref refn;
  34. };
  35. struct orangefs_statfs_response {
  36. __s64 block_size;
  37. __s64 blocks_total;
  38. __s64 blocks_avail;
  39. __s64 files_total;
  40. __s64 files_avail;
  41. };
  42. struct orangefs_fs_mount_response {
  43. __s32 fs_id;
  44. __s32 id;
  45. struct orangefs_khandle root_khandle;
  46. };
  47. /* the getxattr response is the attribute value */
  48. struct orangefs_getxattr_response {
  49. __s32 val_sz;
  50. __s32 __pad1;
  51. char val[ORANGEFS_MAX_XATTR_VALUELEN];
  52. };
  53. /* the listxattr response is an array of attribute names */
  54. struct orangefs_listxattr_response {
  55. __s32 returned_count;
  56. __s32 __pad1;
  57. __u64 token;
  58. char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN];
  59. __s32 keylen;
  60. __s32 __pad2;
  61. __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN];
  62. };
  63. struct orangefs_param_response {
  64. union {
  65. __s64 value64;
  66. __s32 value32[2];
  67. } u;
  68. };
  69. #define PERF_COUNT_BUF_SIZE 4096
  70. struct orangefs_perf_count_response {
  71. char buffer[PERF_COUNT_BUF_SIZE];
  72. };
  73. #define FS_KEY_BUF_SIZE 4096
  74. struct orangefs_fs_key_response {
  75. __s32 fs_keylen;
  76. __s32 __pad1;
  77. char fs_key[FS_KEY_BUF_SIZE];
  78. };
  79. /* 2.9.6 */
  80. struct orangefs_features_response {
  81. __u64 features;
  82. };
  83. struct orangefs_downcall_s {
  84. __s32 type;
  85. __s32 status;
  86. /* currently trailer is used only by readdir */
  87. __s64 trailer_size;
  88. char *trailer_buf;
  89. union {
  90. struct orangefs_io_response io;
  91. struct orangefs_lookup_response lookup;
  92. struct orangefs_create_response create;
  93. struct orangefs_symlink_response sym;
  94. struct orangefs_getattr_response getattr;
  95. struct orangefs_mkdir_response mkdir;
  96. struct orangefs_statfs_response statfs;
  97. struct orangefs_fs_mount_response fs_mount;
  98. struct orangefs_getxattr_response getxattr;
  99. struct orangefs_listxattr_response listxattr;
  100. struct orangefs_param_response param;
  101. struct orangefs_perf_count_response perf_count;
  102. struct orangefs_fs_key_response fs_key;
  103. struct orangefs_features_response features;
  104. } resp;
  105. };
  106. /*
  107. * The readdir response comes in the trailer. It is followed by the
  108. * directory entries as described in dir.c.
  109. */
  110. struct orangefs_readdir_response_s {
  111. __u64 token;
  112. __u64 directory_version;
  113. __u32 __pad2;
  114. __u32 orangefs_dirent_outcount;
  115. };
  116. #endif /* __DOWNCALL_H */