root/daemons/based/based_operation.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. based_get_op_function

   1 /*
   2  * Copyright 2008-2024 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU General Public License version 2
   7  * or later (GPLv2+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #include <crm_internal.h>
  11 
  12 #include <glib.h>
  13 
  14 #include <crm/crm.h>
  15 #include <crm/cib.h>
  16 #include <pacemaker-based.h>
  17 
  18 static const cib__op_fn_t cib_op_functions[] = {
  19     [cib__op_abs_delete]       = cib_process_delete_absolute,
  20     [cib__op_apply_patch]      = cib_server_process_diff,
  21     [cib__op_bump]             = cib_process_bump,
  22     [cib__op_commit_transact]  = cib_process_commit_transaction,
  23     [cib__op_create]           = cib_process_create,
  24     [cib__op_delete]           = cib_process_delete,
  25     [cib__op_erase]            = cib_process_erase,
  26     [cib__op_is_primary]       = cib_process_readwrite,
  27     [cib__op_modify]           = cib_process_modify,
  28     [cib__op_noop]             = cib_process_noop,
  29     [cib__op_ping]             = cib_process_ping,
  30     [cib__op_primary]          = cib_process_readwrite,
  31     [cib__op_query]            = cib_process_query,
  32     [cib__op_replace]          = cib_process_replace_svr,
  33     [cib__op_secondary]        = cib_process_readwrite,
  34     [cib__op_shutdown]         = cib_process_shutdown_req,
  35     [cib__op_sync_all]         = cib_process_sync,
  36     [cib__op_sync_one]         = cib_process_sync_one,
  37     [cib__op_upgrade]          = cib_process_upgrade_server,
  38     [cib__op_schemas]          = cib_process_schemas,
  39 };
  40 
  41 /*!
  42  * \internal
  43  * \brief Get the function that performs a given server-side CIB operation
  44  *
  45  * \param[in] operation  Operation whose function to look up
  46  *
  47  * \return Function that performs \p operation within \c pacemaker-based
  48  */
  49 cib__op_fn_t
  50 based_get_op_function(const cib__operation_t *operation)
     /* [previous][next][first][last][top][bottom][index][help] */
  51 {
  52     enum cib__op_type type = operation->type;
  53 
  54     pcmk__assert(type >= 0);
  55 
  56     if (type >= PCMK__NELEM(cib_op_functions)) {
  57         return NULL;
  58     }
  59     return cib_op_functions[type];
  60 }

/* [previous][next][first][last][top][bottom][index][help] */