downcall.h 3.0 KB

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