Some time back there was a reworking of several bits of the state machine. A struct was added to the bottom of each state machine

struct PINT_server_req_params

in this struct there are fields that obviate some of the steps in that file including 6 and maybe 7 (I don't recall)

I suggest you take one of the simpler state machine like getattr and use it as a guide.

At one time I thought someone had updated that file ... but apparently that didn't get into the right part of the repository.

Walt

Erik Nieto wrote:
Hello everybody:

I am Trying to add a new Server request to PVFS2. I was reading the documentation about it, and found a file explaining it.

     My problem is in the sixth step:

-          Update the request scheduler.

The file says that in the function PINT_req_sched_target_handle() in the source file request_scheduler.c this update must be do it.

The problem is that this function is not included in this source file.

My questions are:

-          Where i can include the new request to the server scheduler?

-          Is there another file with this information?


Thanks for yours answers.


Erik.

---------------------------------------------------------------------------------------------

This are the steps that i am following:

Steps in adding a request to the server:

1) select a request name and number

            src/proto/pvfs2-req-proto.h

2) add a request and response struct

            src/proto/pvfs2-req-proto.h

            add entry to unions: PVFS_server_req and PVFS_server_resp

2a) add endecode functions if needed

            src/proto/endecode-funcs.h

                  for each of these you add or modify you must also

                  add a stub in include/pvfs2-encode-stubs.h

2b) update the protocol version number

            src/proto/pvfs2-req-proto.h

                  increment PVFS2_PROTO_MINOR, assuming that the

                  addition of this new request does not break backwards

                  compatibility for other request types

3) add entries to decode/encode functions

            src/proto/PINT-le-bytefield.c

lebf_initialize() - need code here to set up a request so it

can be encoded and expression for extra message size if any

                  lebf_encode_req()

                  lebf_encode_resp()

                  lebf_decode_req()

                  lebf_decode_resp()

                  lebf_decode_rel() (2 places)

In this last entry, we free any resources allocated during

                        decode - specifically array items

                        This does not free resources allocated by SM code

4) add request specific scratch space to PINT_server_op

            src/server/pvfs2-server.h

                  PINT_server_op  -- only if required

5) write state machine -- se details below

            src/server/<reqname>.sm

                  each state machine added must have a delcaration in

                        src/server/pvfs2-server.h

6) update request scheduler

            src/server/request-scheduler/request-scheduler.c

                  PINT_req_sched_target_handle()

7) add entry to server operation parameters table

            src/server/pvfs2-server.c

init_req_table -- see src/server/prelude.sm <http://prelude.sm>

                  prelude_perm_check()

8) add entry in final response state machine

            src/server/final-response.sm <http://final-response.sm>

                  s_req_resp_type_map

Writing State Machines

Every state machine passes a PINT_server_op in to each state function.

      state machine initialized in src/server/pvfs2-server.c

            server_state_machine_start

                  gets the s_op set up

                  decodes request message

                  sets s_op->req, s_op->resp

Each state machine must first run the pvfs2_prelude_sm

      reads the attribs of the target object, if appropriate to s_op->attr

      does basic permission checking

      posts request to the scheduler

State machines typically submit jobs, defined in

      src/io/job/job.h

Each state machine must run the pvfs2_final_response_sm

      releases request from the scheduler

      sends response to the client

            s_op->resp must be filled in

            return status in js_p->error_code

Cleanup must free any memory allocated by SM code

State functions return 0 or 1 on error-free completion,

      0 indicates an asynchronous call has been made and must be waited for

      1 indicates no async call was made and should proceed to next state

      <0 indicates an error - use PVFS_EXXX codes defined in

            include/pvfs2-types.h


------------------------------------------------------------------------

_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to