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-2023 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 };
  39 
  40 /*!
  41  * \internal
  42  * \brief Get the function that performs a given server-side CIB operation
  43  *
  44  * \param[in] operation  Operation whose function to look up
  45  *
  46  * \return Function that performs \p operation within \c pacemaker-based
  47  */
  48 cib__op_fn_t
  49 based_get_op_function(const cib__operation_t *operation)
     /* [previous][next][first][last][top][bottom][index][help] */
  50 {
  51     enum cib__op_type type = operation->type;
  52 
  53     CRM_ASSERT(type >= 0);
  54 
  55     if (type >= PCMK__NELEM(cib_op_functions)) {
  56         return NULL;
  57     }
  58     return cib_op_functions[type];
  59 }

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