1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-06 18:48:16 +01:00
Files
glusterfs/doc/developer-guide/adding-fops.md
Yaniv Kaul 55420543c2 Multiple files: cleanup common include files (#3140)
As a continuation to #3130 , there are several .h files that are included in various files.
However, many of the definitions in those include files should be local to specific files, or is simply dead code.
We can easily clean them up.
Note - there are some functions that were deemed useful as common or utilities that were meant to be shared across the codebase.
After 10 or so years, I think it's OK to move some of them that were never shared across the code,
to their own users (and make them static while at it).

This commit specifically cleaned up glusterd-utils.c

    Updates: #3137
    Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2022-02-28 08:10:54 +05:30

670 B

Adding a new FOP

Steps to be followed when adding a new FOP to GlusterFS:

  1. Edit glusterfs.h and add a GF_FOP_* constant.
  2. Edit xlator.[ch] and:
    • add the new prototype for fop and callback.
    • edit xlator_fops structure.
  3. Edit xlator.c and add to fill_defaults.
  4. Edit protocol.h and add struct necessary for the new FOP.
  5. Edit defaults.[ch] and provide default implementation.
  6. Edit call-stub.[ch] and provide stub implementation.
  7. Edit client-protocol and add your FOP.
  8. Edit server-protocol and add your FOP.
  9. Implement your FOP in any translator for which the default implementation is not sufficient.