home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / src / io / trove / trove-internal.h < prev    next >
C/C++ Source or Header  |  2010-09-08  |  14KB  |  500 lines

  1. /*
  2.  * (C) 2001 Clemson University and The University of Chicago
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6.  
  7. #ifndef __TROVE_INTERNAL_H
  8. #define __TROVE_INTERNAL_H
  9.  
  10. #include "trove-types.h"
  11.  
  12. PVFS_error trove_errno_to_trove_error(int errno_value);
  13.  
  14. int trove_get_version (TROVE_coll_id coll_id, int* major, int* minor, int* incremental);
  15. int trove_put_version (TROVE_coll_id coll_id, int major, int minor, int incremental);
  16.  
  17. /* These structures contains the function pointers that should be provided
  18.  * by valid trove "method" implementations
  19.  */
  20.  
  21. struct TROVE_bstream_ops
  22. {
  23.     int (*bstream_read_at)(
  24.                TROVE_coll_id coll_id,
  25.                TROVE_handle handle,
  26.                void *buffer,
  27.                TROVE_size *inout_size_p,
  28.                TROVE_offset offset,
  29.                TROVE_ds_flags flags,
  30.                TROVE_vtag_s *out_vtag, 
  31.                void *user_ptr,
  32.                TROVE_context_id context_id,
  33.                TROVE_op_id *out_op_id_p,
  34.                PVFS_hint hints);
  35.     
  36.     int (*bstream_write_at)(
  37.                 TROVE_coll_id coll_id,
  38.                 TROVE_handle handle,
  39.                 void *buffer,
  40.                 TROVE_size *inout_size_p,
  41.                 TROVE_offset offset,
  42.                 TROVE_ds_flags flags,
  43.                 TROVE_vtag_s *inout_vtag,
  44.                 void *user_ptr,
  45.                 TROVE_context_id context_id,
  46.                 TROVE_op_id *out_op_id_p,
  47.                 PVFS_hint hints);
  48.     
  49.     int (*bstream_resize)(
  50.               TROVE_coll_id coll_id,
  51.               TROVE_handle handle,
  52.               TROVE_size *inout_size_p,
  53.               TROVE_ds_flags flags,
  54.               TROVE_vtag_s *vtag,
  55.               void *user_ptr,
  56.               TROVE_context_id context_id,
  57.               TROVE_op_id *out_op_id_p,
  58.               PVFS_hint hints);
  59.     
  60.     int (*bstream_validate)(
  61.                 TROVE_coll_id coll_id,
  62.                 TROVE_handle handle,
  63.                 TROVE_ds_flags flags,
  64.                 TROVE_vtag_s *vtag,
  65.                 void *user_ptr,
  66.                 TROVE_context_id context_id,
  67.                 TROVE_op_id *out_op_id_p,
  68.                 PVFS_hint hints);
  69.     
  70.     int (*bstream_read_list)(
  71.                  TROVE_coll_id coll_id,
  72.                  TROVE_handle handle,
  73.                  char **mem_offset_array, 
  74.                  TROVE_size *mem_size_array,
  75.                  int mem_count,
  76.                  TROVE_offset *stream_offset_array, 
  77.                  TROVE_size *stream_size_array,
  78.                  int stream_count,
  79.                  TROVE_size *out_size_p, /* status indicates partial */
  80.                  TROVE_ds_flags flags, 
  81.                  TROVE_vtag_s *out_vtag,
  82.                  void *user_ptr,
  83.                  TROVE_context_id context_id,
  84.                  TROVE_op_id *out_op_id_p,
  85.                  PVFS_hint hints);
  86.     
  87.     int (*bstream_write_list)(
  88.                   TROVE_coll_id coll_id,
  89.                   TROVE_handle handle,
  90.                   char **mem_offset_array, 
  91.                   TROVE_size *mem_size_array,
  92.                   int mem_count,
  93.                   TROVE_offset *stream_offset_array, 
  94.                   TROVE_size *stream_size_array,
  95.                   int stream_count,
  96.                   TROVE_size *out_size_p, /* status indicates partial */
  97.                   TROVE_ds_flags flags, 
  98.                   TROVE_vtag_s *inout_vtag,
  99.                   void *user_ptr,
  100.                   TROVE_context_id context_id,
  101.                   TROVE_op_id *out_op_id_p,
  102.                   PVFS_hint hints);
  103.  
  104.      int (*bstream_flush)(
  105.             TROVE_coll_id coll_id,
  106.             TROVE_handle handle,
  107.             TROVE_ds_flags flags,
  108.             void *user_ptr,
  109.             TROVE_context_id context_id,
  110.             TROVE_op_id *out_op_id_p,
  111.             PVFS_hint hints);
  112.  
  113.      int (*bstream_cancel)(
  114.          TROVE_coll_id coll_id,
  115.          TROVE_op_id cancel_id,
  116.          TROVE_context_id context_id);
  117. };
  118.  
  119. struct TROVE_keyval_ops
  120. {
  121.     int (*keyval_read)(
  122.                TROVE_coll_id coll_id,
  123.                TROVE_handle handle,
  124.                TROVE_keyval_s *key_p,
  125.                TROVE_keyval_s *val_p,
  126.                TROVE_ds_flags flags,
  127.                TROVE_vtag_s *out_vtag, 
  128.                void *user_ptr,
  129.                TROVE_context_id context_id,
  130.                TROVE_op_id *out_op_id_p,
  131.                PVFS_hint hints);
  132.     
  133.     int (*keyval_write)(
  134.             TROVE_coll_id coll_id,
  135.             TROVE_handle handle,
  136.             TROVE_keyval_s *key_p,
  137.             TROVE_keyval_s *val_p,
  138.             TROVE_ds_flags flags,
  139.             TROVE_vtag_s *inout_vtag,
  140.             void *user_ptr,
  141.             TROVE_context_id context_id,
  142.             TROVE_op_id *out_op_id_p,
  143.             PVFS_hint hints);
  144.     
  145.     int (*keyval_remove)(
  146.              TROVE_coll_id coll_id,
  147.              TROVE_handle handle,
  148.              TROVE_keyval_s *key_p,
  149.                          TROVE_keyval_s *val_p,
  150.              TROVE_ds_flags flags,
  151.              TROVE_vtag_s *inout_vtag,
  152.              void *user_ptr,
  153.              TROVE_context_id context_id,
  154.              TROVE_op_id *out_op_id_p,
  155.              PVFS_hint hints);
  156.     
  157.     int (*keyval_remove_list)(
  158.             TROVE_coll_id coll_id,
  159.             TROVE_handle handle,
  160.             TROVE_keyval_s *key_array,
  161.             TROVE_keyval_s *val_array,
  162.                         int *error_array,
  163.                         int count,
  164.             TROVE_ds_flags flags,
  165.             TROVE_vtag_s *inout_vtag,
  166.             void *user_ptr,
  167.             TROVE_context_id context_id,
  168.             TROVE_op_id *out_op_id_p,
  169.                         PVFS_hint hints);
  170.     
  171.     int (*keyval_validate)(
  172.                TROVE_coll_id coll_id,
  173.                TROVE_handle handle,
  174.                TROVE_ds_flags flags,
  175.                TROVE_vtag_s *inout_vtag,
  176.                void* user_ptr,
  177.                TROVE_context_id context_id,
  178.                TROVE_op_id *out_op_id_p,
  179.                PVFS_hint hints);
  180.     
  181.     int (*keyval_iterate)(
  182.               TROVE_coll_id coll_id,
  183.               TROVE_handle handle,
  184.               TROVE_ds_position *inout_position_p,
  185.               TROVE_keyval_s *out_key_array,
  186.               TROVE_keyval_s *out_val_array,
  187.               int *inout_count_p,
  188.               TROVE_ds_flags flags,
  189.               TROVE_vtag_s *inout_vtag,
  190.               void *user_ptr,
  191.               TROVE_context_id context_id,
  192.               TROVE_op_id *out_op_id_p,
  193.               PVFS_hint hints);
  194.     
  195.     int (*keyval_iterate_keys)(
  196.                    TROVE_coll_id coll_id,
  197.                    TROVE_handle handle,
  198.                    TROVE_ds_position *inout_position_p,
  199.                    TROVE_keyval_s *out_key_array,
  200.                    int *inout_count_p,
  201.                    TROVE_ds_flags flags,
  202.                    TROVE_vtag_s *vtag,
  203.                    void *user_ptr,
  204.                    TROVE_context_id context_id,
  205.                    TROVE_op_id *out_op_id_p,
  206.                    PVFS_hint hints);
  207.     
  208.     int (*keyval_read_list)(
  209.                 TROVE_coll_id coll_id,
  210.                 TROVE_handle handle,
  211.                 TROVE_keyval_s *key_array,
  212.                 TROVE_keyval_s *val_array,
  213.                             TROVE_ds_state *err_array,
  214.                 int count,
  215.                 TROVE_ds_flags flags,
  216.                 TROVE_vtag_s *out_vtag,
  217.                 void *user_ptr,
  218.                 TROVE_context_id context_id,
  219.                 TROVE_op_id *out_op_id_p,
  220.                 PVFS_hint hints);
  221.     
  222.     int (*keyval_write_list)(
  223.                  TROVE_coll_id coll_id,
  224.                  TROVE_handle handle,
  225.                  TROVE_keyval_s *key_array,
  226.                  TROVE_keyval_s *val_array,
  227.                  int count,
  228.                  TROVE_ds_flags flags,
  229.                  TROVE_vtag_s *inout_vtag,
  230.                  void *user_ptr,
  231.                  TROVE_context_id context_id,
  232.                  TROVE_op_id *out_op_id_p,
  233.                  PVFS_hint hints);
  234.     int (*keyval_flush)(
  235.             TROVE_coll_id coll_id,
  236.             TROVE_handle handle,
  237.             TROVE_ds_flags flags,
  238.             void *user_ptr,
  239.             TROVE_context_id context_id,
  240.             TROVE_op_id *out_op_id_p,
  241.             PVFS_hint hints);
  242.     int (*keyval_get_handle_info)(
  243.         TROVE_coll_id coll_id,
  244.         TROVE_handle handle,
  245.         TROVE_ds_flags flags,
  246.         TROVE_keyval_handle_info *info,
  247.         void *user_ptr,
  248.         TROVE_context_id context_id,
  249.         TROVE_op_id *out_op_id_p,
  250.         PVFS_hint hints);
  251. };
  252.  
  253. struct TROVE_dspace_ops
  254. {
  255.     int (*dspace_create)(
  256.              TROVE_coll_id coll_id,
  257.                          TROVE_handle_extent_array *extent_array,
  258.              TROVE_handle *handle,
  259.              TROVE_ds_type type,
  260.              TROVE_keyval_s *hint, /* TODO: figure out what this is! */
  261.              TROVE_ds_flags flags,
  262.              void *user_ptr,
  263.              TROVE_context_id context_id,
  264.              TROVE_op_id *out_op_id_p,
  265.              PVFS_hint hints);
  266.  
  267.      int (*dspace_create_list)(
  268.              TROVE_coll_id coll_id,
  269.                          TROVE_handle_extent_array *extent_array,
  270.              TROVE_handle *handle_array,
  271.              int count,
  272.              TROVE_ds_type type,
  273.              TROVE_keyval_s *hint, /* TODO: figure out what this is! */
  274.              TROVE_ds_flags flags,
  275.              void *user_ptr,
  276.              TROVE_context_id context_id,
  277.              TROVE_op_id *out_op_id_p,
  278.                          PVFS_hint hints);
  279.     
  280.     int (*dspace_remove)(
  281.              TROVE_coll_id coll_id,
  282.              TROVE_handle handle,
  283.              TROVE_ds_flags flags,
  284.              void *user_ptr,
  285.              TROVE_context_id context_id,
  286.              TROVE_op_id *out_op_id_p,
  287.              PVFS_hint hints);
  288.  
  289.     int (*dspace_remove_list)(
  290.              TROVE_coll_id coll_id,
  291.              TROVE_handle* handle_array,
  292.                          TROVE_ds_state *error_array,
  293.                          int count,
  294.              TROVE_ds_flags flags,
  295.              void *user_ptr,
  296.              TROVE_context_id context_id,
  297.              TROVE_op_id *out_op_id_p);
  298.  
  299.  
  300.     int (*dspace_iterate_handles)(
  301.                    TROVE_coll_id coll_id,
  302.                   TROVE_ds_position *position_p,
  303.                    TROVE_handle *handle_array,
  304.                   int *inout_count_p,
  305.                    TROVE_ds_flags flags,
  306.                   TROVE_vtag_s *vtag,
  307.                   void *user_ptr,
  308.                   TROVE_context_id context_id,
  309.                   TROVE_op_id *out_op_id_p);
  310.  
  311.     int (*dspace_verify)(
  312.              TROVE_coll_id coll_id,
  313.              TROVE_handle handle,
  314.              TROVE_ds_type *type, /* TODO: define types! */
  315.              TROVE_ds_flags flags,
  316.              void *user_ptr,
  317.              TROVE_context_id context_id,
  318.              TROVE_op_id *out_op_id_p,
  319.              PVFS_hint hints);
  320.     
  321.     int (*dspace_getattr)(
  322.               TROVE_coll_id coll_id,
  323.               TROVE_handle handle,
  324.               TROVE_ds_attributes_s *ds_attr_p,
  325.               TROVE_ds_flags flags,
  326.               void *user_ptr,
  327.               TROVE_context_id context_id,
  328.               TROVE_op_id *out_op_id_p,
  329.               PVFS_hint hints);
  330.  
  331.     int (*dspace_getattr_list)(
  332.               TROVE_coll_id coll_id,
  333.                           int nhandles,
  334.               TROVE_handle *handle_array,
  335.               TROVE_ds_attributes_s *ds_attr_p,
  336.                           TROVE_ds_state *error_array,
  337.               TROVE_ds_flags flags,
  338.               void *user_ptr,
  339.               TROVE_context_id context_id,
  340.               TROVE_op_id *out_op_id_p,
  341.               PVFS_hint hints);
  342.     
  343.     int (*dspace_setattr)(
  344.               TROVE_coll_id coll_id,
  345.               TROVE_handle handle,
  346.               TROVE_ds_attributes_s *ds_attr_p, 
  347.               TROVE_ds_flags flags,
  348.               void *user_ptr,
  349.               TROVE_context_id context_id,
  350.               TROVE_op_id *out_op_id_p,
  351.               PVFS_hint hints);
  352.     
  353.     int (*dspace_cancel)(
  354.                TROVE_coll_id coll_id,
  355.                TROVE_op_id ds_id,
  356.                TROVE_context_id context_id);
  357.  
  358.     int (*dspace_test)(
  359.                TROVE_coll_id coll_id,
  360.                TROVE_op_id ds_id,
  361.                TROVE_context_id context_id,
  362.                int *out_count_p,
  363.                TROVE_vtag_s *vtag,
  364.                void **returned_user_ptr_p,
  365.                TROVE_ds_state *out_state_p,
  366.                int max_idle_time_ms);
  367.     
  368.     int (*dspace_testsome)(
  369.                TROVE_coll_id coll_id,
  370.                TROVE_context_id context_id,
  371.                TROVE_op_id *ds_id_array,
  372.                int *inout_count_p,
  373.                int *out_index_array,
  374.                TROVE_vtag_s *vtag_array,
  375.                void **returned_user_ptr_array,
  376.                TROVE_ds_state *out_state_array,
  377.                int max_idle_time_ms);
  378.  
  379.     int (*dspace_testcontext)(
  380.                TROVE_coll_id coll_id,
  381.                            TROVE_op_id *ds_id_array,
  382.                            int *inout_count_p,
  383.                            TROVE_ds_state *state_array,
  384.                            void** user_ptr_array,
  385.                            int max_idle_time_ms,
  386.                            TROVE_context_id context_id);
  387. };
  388.  
  389. struct TROVE_mgmt_ops
  390. {
  391.     int (*initialize)(
  392.               char *data_path,
  393.               char *meta_path,
  394.               TROVE_ds_flags flags);
  395.     
  396.     int (*finalize)(void);
  397.     
  398.     int (*storage_create)(
  399.               char *data_path,
  400.               char *meta_path,
  401.               void *user_ptr,
  402.               TROVE_op_id *out_op_id_p);
  403.     
  404.     int (*storage_remove)(
  405.               char *data_path,
  406.               char *meta_path,
  407.               void *user_ptr,
  408.               TROVE_op_id *out_op_id_p);
  409.     
  410.     int (*collection_create)(
  411.                  char *collname,
  412.                  TROVE_coll_id new_coll_id,
  413.                  void *user_ptr,
  414.                  TROVE_op_id *out_op_id_p);
  415.  
  416.     int (*collection_remove)(
  417.                  char *collname,
  418.                  void *user_ptr,
  419.                  TROVE_op_id *out_op_id_p);
  420.     
  421.     int (*collection_lookup)(
  422.                  char *collname,
  423.                  TROVE_coll_id *coll_id_p,
  424.                  void *user_ptr,
  425.                  TROVE_op_id *out_op_id_p);
  426.  
  427.     int (*collection_clear)(TROVE_coll_id coll_id);
  428.  
  429.     int (*collection_iterate)(TROVE_ds_position *inout_position_p,
  430.                   TROVE_keyval_s *name_array,
  431.                   TROVE_coll_id *coll_id_array,
  432.                   int *inout_count_p,
  433.                   TROVE_ds_flags flags,
  434.                   TROVE_vtag_s *vtag,
  435.                   void *user_ptr,
  436.                   TROVE_op_id *out_op_id_p);
  437.  
  438.     /* Note: setinfo and getinfo always return immediately */
  439.     int (*collection_setinfo)(
  440.                               TROVE_method_id method_id,
  441.                   TROVE_coll_id coll_id,
  442.                   TROVE_context_id context_id,
  443.                   int option,
  444.                   void *parameter);
  445.     
  446.     int (*collection_getinfo)(
  447.                   TROVE_coll_id coll_id,
  448.                   TROVE_context_id context_id,
  449.                   TROVE_coll_getinfo_options opt,
  450.                   void *parameter);
  451.     
  452.     int (*collection_seteattr)(
  453.                    TROVE_coll_id coll_id,
  454.                    TROVE_keyval_s *key_p,
  455.                    TROVE_keyval_s *val_p,
  456.                    TROVE_ds_flags flags,
  457.                    void *user_ptr,
  458.                    TROVE_context_id context_id,
  459.                    TROVE_op_id *out_op_id_p);
  460.     
  461.     int (*collection_geteattr)(
  462.                    TROVE_coll_id coll_id,
  463.                    TROVE_keyval_s *key_p,
  464.                    TROVE_keyval_s *val_p,
  465.                    TROVE_ds_flags flags,
  466.                    void *user_ptr,
  467.                    TROVE_context_id context_id,
  468.                    TROVE_op_id *out_op_id_p);
  469.  
  470.     int (*collection_deleattr)(
  471.                    TROVE_coll_id coll_id,
  472.                    TROVE_keyval_s *key_p,
  473.                    TROVE_ds_flags flags,
  474.                    void *user_ptr,
  475.                    TROVE_context_id context_id,
  476.                    TROVE_op_id *out_op_id_p);
  477. };
  478.  
  479. struct TROVE_context_ops
  480. {
  481.     int (*open_context)(
  482.                         TROVE_coll_id coll_id,
  483.                         TROVE_context_id *context_id);
  484.  
  485.     int (*close_context)(
  486.                          TROVE_coll_id coll_id,
  487.                          TROVE_context_id context_id);
  488. };
  489.  
  490. /*
  491.  * Local variables:
  492.  *  c-indent-level: 4
  493.  *  c-basic-offset: 4
  494.  * End:
  495.  *
  496.  * vim: ts=8 sts=4 sw=4 expandtab
  497.  */
  498.  
  499. #endif
  500.