glusterfs  8.6
About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 8.x.
  Fossies Dox: glusterfs-8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

glusterd-locks.c File Reference
#include <glusterfs/common-utils.h>
#include "cli1-xdr.h"
#include "xdr-generic.h"
#include "glusterd.h"
#include "glusterd-op-sm.h"
#include "glusterd-store.h"
#include "glusterd-utils.h"
#include "glusterd-volgen.h"
#include "glusterd-locks.h"
#include "glusterd-errno.h"
#include <glusterfs/run.h>
#include <glusterfs/syscall.h>
#include "glusterd-messages.h"
#include <signal.h>
Include dependency graph for glusterd-locks.c:

Go to the source code of this file.

Macros

#define GF_MAX_LOCKING_ENTITIES   3
 

Functions

static bool glusterd_mgmt_v3_is_type_valid (char *type)
 
int32_t glusterd_mgmt_v3_lock_init ()
 
void glusterd_mgmt_v3_lock_fini ()
 
int32_t glusterd_mgmt_v3_lock_timer_init ()
 
void glusterd_mgmt_v3_lock_timer_fini ()
 
static int32_t glusterd_get_mgmt_v3_lock_owner (char *key, uuid_t *uuid)
 
static int32_t glusterd_release_multiple_locks_per_entity (dict_t *dict, uuid_t uuid, int32_t locked_count, char *type)
 
static int32_t glusterd_acquire_multiple_locks_per_entity (dict_t *dict, uuid_t uuid, uint32_t *op_errno, int32_t count, char *type)
 
static int32_t glusterd_mgmt_v3_unlock_entity (dict_t *dict, uuid_t uuid, char *type, bool default_value)
 
static int32_t glusterd_mgmt_v3_lock_entity (dict_t *dict, uuid_t uuid, uint32_t *op_errno, char *type, bool default_value)
 
int32_t glusterd_multiple_mgmt_v3_unlock (dict_t *dict, uuid_t uuid)
 
int32_t glusterd_multiple_mgmt_v3_lock (dict_t *dict, uuid_t uuid, uint32_t *op_errno)
 
int32_t glusterd_mgmt_v3_lock (const char *name, uuid_t uuid, uint32_t *op_errno, char *type)
 
void gd_mgmt_v3_unlock_timer_cbk (void *data)
 
int32_t glusterd_mgmt_v3_unlock (const char *name, uuid_t uuid, char *type)
 

Variables

glusterd_valid_entities valid_types []
 

Macro Definition Documentation

◆ GF_MAX_LOCKING_ENTITIES

#define GF_MAX_LOCKING_ENTITIES   3

Definition at line 26 of file glusterd-locks.c.

Function Documentation

◆ gd_mgmt_v3_unlock_timer_cbk()

◆ glusterd_acquire_multiple_locks_per_entity()

static int32_t glusterd_acquire_multiple_locks_per_entity ( dict_t dict,
uuid_t  uuid,
uint32_t *  op_errno,
int32_t  count,
char *  type 
)
static

◆ glusterd_get_mgmt_v3_lock_owner()

static int32_t glusterd_get_mgmt_v3_lock_owner ( char *  key,
uuid_t *  uuid 
)
static

◆ glusterd_mgmt_v3_is_type_valid()

static bool glusterd_mgmt_v3_is_type_valid ( char *  type)
static

◆ glusterd_mgmt_v3_lock()

◆ glusterd_mgmt_v3_lock_entity()

static int32_t glusterd_mgmt_v3_lock_entity ( dict_t dict,
uuid_t  uuid,
uint32_t *  op_errno,
char *  type,
bool  default_value 
)
static

◆ glusterd_mgmt_v3_lock_fini()

void glusterd_mgmt_v3_lock_fini ( )

Definition at line 81 of file glusterd-locks.c.

References dict_unref(), GF_ASSERT, glusterd_conf_t::mgmt_v3_lock, and THIS.

Referenced by fini().

◆ glusterd_mgmt_v3_lock_init()

int32_t glusterd_mgmt_v3_lock_init ( )

Definition at line 58 of file glusterd-locks.c.

References dict_new(), GF_ASSERT, glusterd_conf_t::mgmt_v3_lock, out, and THIS.

Referenced by init().

◆ glusterd_mgmt_v3_lock_timer_fini()

void glusterd_mgmt_v3_lock_timer_fini ( )

Definition at line 122 of file glusterd-locks.c.

References dict_unref(), GF_VALIDATE_OR_GOTO, glusterd_conf_t::mgmt_v3_lock_timer, out, and THIS.

Referenced by fini().

◆ glusterd_mgmt_v3_lock_timer_init()

int32_t glusterd_mgmt_v3_lock_timer_init ( )

Definition at line 98 of file glusterd-locks.c.

References dict_new(), GF_VALIDATE_OR_GOTO, glusterd_conf_t::mgmt_v3_lock_timer, out, and THIS.

Referenced by init().

◆ glusterd_mgmt_v3_unlock()

◆ glusterd_mgmt_v3_unlock_entity()

◆ glusterd_multiple_mgmt_v3_lock()

◆ glusterd_multiple_mgmt_v3_unlock()

◆ glusterd_release_multiple_locks_per_entity()

static int32_t glusterd_release_multiple_locks_per_entity ( dict_t dict,
uuid_t  uuid,
int32_t  locked_count,
char *  type 
)
static

Variable Documentation

◆ valid_types

glusterd_valid_entities valid_types[]
Initial value:
= {
{"vol", true },
{"snap", false },
{"global", false },
{NULL},
}

Definition at line 31 of file glusterd-locks.c.

Referenced by glusterd_mgmt_v3_is_type_valid(), glusterd_multiple_mgmt_v3_lock(), and glusterd_multiple_mgmt_v3_unlock().