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 / server / mgmt-remove-object.sm < prev    next >
Text File  |  2008-11-19  |  2KB  |  101 lines

  1. /* 
  2.  * (C) 2001 Clemson University and The University of Chicago 
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6.  
  7. #include <string.h>
  8. #include <assert.h>
  9.  
  10. #include "server-config.h"
  11. #include "pvfs2-storage.h"
  12. #include "pvfs2-server.h"
  13. #include "pvfs2-attr.h"
  14. #include "gossip.h"
  15. #include "pvfs2-internal.h"
  16.  
  17. %%
  18.  
  19. machine pvfs2_mgmt_remove_object_sm
  20. {
  21.     state prelude
  22.     {
  23.         jump pvfs2_prelude_sm;
  24.         success => remove_dspace;
  25.         default => final_response;
  26.     }
  27.  
  28.     state remove_dspace
  29.     {
  30.         run mgmt_remove_dspace;
  31.         default => final_response;
  32.     }
  33.  
  34.     state final_response
  35.     {
  36.         jump pvfs2_final_response_sm;
  37.         default => cleanup;
  38.     }
  39.  
  40.     state cleanup
  41.     {
  42.         run mgmt_remove_cleanup;
  43.         default => terminate;
  44.     }
  45. }
  46.  
  47. %%
  48.  
  49. static PINT_sm_action mgmt_remove_dspace(
  50.         struct PINT_smcb *smcb, job_status_s *js_p)
  51. {
  52.     struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
  53.     int ret = -PVFS_EINVAL;
  54.     job_id_t j_id;
  55.     
  56.     gossip_debug(
  57.         GOSSIP_SERVER_DEBUG, "Trying to mgmt_remove object %llu,%d\n",
  58.         llu(s_op->req->u.mgmt_remove_object.handle),
  59.         s_op->req->u.mgmt_remove_object.fs_id);
  60.  
  61.     ret = job_trove_dspace_remove(
  62.         s_op->req->u.mgmt_remove_object.fs_id,
  63.         s_op->req->u.mgmt_remove_object.handle,
  64.         TROVE_SYNC,
  65.         smcb,
  66.         0,
  67.         js_p,
  68.         &j_id,
  69.         server_job_context, s_op->req->hints);
  70.  
  71.     return ret;
  72. }
  73.  
  74. static PINT_sm_action mgmt_remove_cleanup(
  75.         struct PINT_smcb *smcb, job_status_s *js_p)
  76. {
  77.     return(server_state_machine_complete(smcb));
  78. }
  79.  
  80. PINT_GET_OBJECT_REF_DEFINE(mgmt_remove_object);
  81.  
  82. struct PINT_server_req_params pvfs2_mgmt_remove_object_params =
  83. {
  84.     .string_name = "mgmt-remove-object",
  85.     .perm = PINT_SERVER_CHECK_NONE,
  86.     .access_type = PINT_server_req_modify,
  87.     .sched_policy = PINT_SERVER_REQ_SCHEDULE,
  88.     .get_object_ref = PINT_get_object_ref_mgmt_remove_object,
  89.     .state_machine = &pvfs2_mgmt_remove_object_sm
  90. };
  91.  
  92. /*
  93.  * Local variables:
  94.  *  mode: c
  95.  *  c-indent-level: 4
  96.  *  c-basic-offset: 4
  97.  * End:
  98.  *
  99.  * vim: ft=c ts=8 sts=4 sw=4 expandtab
  100.  */
  101.