downcall.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. struct orangefs_statfs_response {
  35. __s64 block_size;
  36. __s64 blocks_total;
  37. __s64 blocks_avail;
  38. __s64 files_total;
  39. __s64 files_avail;
  40. };
  41. struct orangefs_fs_mount_response {
  42. __s32 fs_id;
  43. __s32 id;
  44. struct orangefs_khandle root_khandle;
  45. };
  46. /* the getxattr response is the attribute value */
  47. struct orangefs_getxattr_response {
  48. __s32 val_sz;
  49. __s32 __pad1;
  50. char val[ORANGEFS_MAX_XATTR_VALUELEN];
  51. };
  52. /* the listxattr response is an array of attribute names */
  53. struct orangefs_listxattr_response {
  54. __s32 returned_count;
  55. __s32 __pad1;
  56. __u64 token;
  57. char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN];
  58. __s32 keylen;
  59. __s32 __pad2;
  60. __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN];
  61. };
  62. struct orangefs_param_response {
  63. union {
  64. __s64 value64;
  65. __s32 value32[2];
  66. } u;
  67. };
  68. #define PERF_COUNT_BUF_SIZE 4096
  69. struct orangefs_perf_count_response {
  70. char buffer[PERF_COUNT_BUF_SIZE];
  71. };
  72. #define FS_KEY_BUF_SIZE 4096
  73. struct orangefs_fs_key_response {
  74. __s32 fs_keylen;
  75. __s32 __pad1;
  76. char fs_key[FS_KEY_BUF_SIZE];
  77. };
  78. /* 2.9.6 */
  79. struct orangefs_features_response {
  80. __u64 features;
  81. };
  82. struct orangefs_downcall_s {
  83. __s32 type;
  84. __s32 status;
  85. /* currently trailer is used only by readdir */
  86. __s64 trailer_size;
  87. char *trailer_buf;
  88. union {
  89. struct orangefs_io_response io;
  90. struct orangefs_lookup_response lookup;
  91. struct orangefs_create_response create;
  92. struct orangefs_symlink_response sym;
  93. struct orangefs_getattr_response getattr;
  94. struct orangefs_mkdir_response mkdir;
  95. struct orangefs_statfs_response statfs;
  96. struct orangefs_fs_mount_response fs_mount;
  97. struct orangefs_getxattr_response getxattr;
  98. struct orangefs_listxattr_response listxattr;
  99. struct orangefs_param_response param;
  100. struct orangefs_perf_count_response perf_count;
  101. struct orangefs_fs_key_response fs_key;
  102. struct orangefs_features_response features;
  103. } resp;
  104. };
  105. /*
  106. * The readdir response comes in the trailer. It is followed by the
  107. * directory entries as described in dir.c.
  108. */
  109. struct orangefs_readdir_response_s {
  110. __u64 token;
  111. __u64 directory_version;
  112. __u32 __pad2;
  113. __u32 orangefs_dirent_outcount;
  114. };
  115. #endif /* __DOWNCALL_H */