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)  

client-lk.c File Reference
#include <glusterfs/common-utils.h>
#include <glusterfs/xlator.h>
#include "client.h"
#include <glusterfs/lkowner.h>
#include "client-messages.h"
Include dependency graph for client-lk.c:

Go to the source code of this file.

Data Structures

struct  _values
 

Functions

static void __insert_and_merge (clnt_fd_ctx_t *fdctx, client_posix_lock_t *lock)
 
static void __dump_client_lock (client_posix_lock_t *lock)
 
static int dump_client_locks_fd (clnt_fd_ctx_t *fdctx)
 
int dump_client_locks (inode_t *inode)
 
static off_t __get_lock_length (off_t start, off_t end)
 
static client_posix_lock_tadd_locks (client_posix_lock_t *l1, client_posix_lock_t *l2)
 
static int locks_overlap (client_posix_lock_t *l1, client_posix_lock_t *l2)
 
static void __delete_client_lock (client_posix_lock_t *lock)
 
static void __destroy_client_lock (client_posix_lock_t *lock)
 
static struct _values subtract_locks (client_posix_lock_t *big, client_posix_lock_t *small)
 
static void __delete_unlck_locks (clnt_fd_ctx_t *fdctx)
 
static void __insert_lock (clnt_fd_ctx_t *fdctx, client_posix_lock_t *lock)
 
static void client_setlk (clnt_fd_ctx_t *fdctx, client_posix_lock_t *lock)
 
static void destroy_client_lock (client_posix_lock_t *lock)
 
void destroy_client_locks_from_list (struct list_head *deleted)
 
void __delete_granted_locks_owner_from_fdctx (clnt_fd_ctx_t *fdctx, gf_lkowner_t *owner, struct list_head *deleted)
 
int32_t delete_granted_locks_owner (fd_t *fd, gf_lkowner_t *owner)
 
int32_t client_cmd_to_gf_cmd (int32_t cmd, int32_t *gf_cmd)
 
static client_posix_lock_tnew_client_lock (struct gf_flock *flock, gf_lkowner_t *owner, int32_t cmd, fd_t *fd)
 
void client_save_number_fds (clnt_conf_t *conf, int count)
 
int client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock, gf_lkowner_t *owner, int32_t cmd)
 
int32_t client_dump_locks (char *name, inode_t *inode, dict_t *dict)
 
int32_t is_client_dump_locks_cmd (char *name)
 

Function Documentation

◆ __delete_client_lock()

static void __delete_client_lock ( client_posix_lock_t lock)
static

Definition at line 127 of file client-lk.c.

References list_del_init(), and lock.

Referenced by __delete_unlck_locks(), and __insert_and_merge().

◆ __delete_granted_locks_owner_from_fdctx()

void __delete_granted_locks_owner_from_fdctx ( clnt_fd_ctx_t fdctx,
gf_lkowner_t owner,
struct list_head deleted 
)

◆ __delete_unlck_locks()

static void __delete_unlck_locks ( clnt_fd_ctx_t fdctx)
static

◆ __destroy_client_lock()

static void __destroy_client_lock ( client_posix_lock_t lock)
static

Definition at line 134 of file client-lk.c.

References GF_FREE, and lock.

Referenced by __delete_unlck_locks(), and __insert_and_merge().

◆ __dump_client_lock()

static void __dump_client_lock ( client_posix_lock_t lock)
static

◆ __get_lock_length()

static off_t __get_lock_length ( off_t  start,
off_t  end 
)
static

Definition at line 85 of file client-lk.c.

References src.changelog::end, LLONG_MAX, and src.changelog::start.

Referenced by add_locks(), and subtract_locks().

◆ __insert_and_merge()

◆ __insert_lock()

static void __insert_lock ( clnt_fd_ctx_t fdctx,
client_posix_lock_t lock 
)
static

Definition at line 227 of file client-lk.c.

References list_add_tail(), lock, and _client_fd_ctx::lock_list.

Referenced by __insert_and_merge().

◆ add_locks()

◆ client_add_lock_for_recovery()

int client_add_lock_for_recovery ( fd_t fd,
struct gf_flock flock,
gf_lkowner_t owner,
int32_t  cmd 
)

◆ client_cmd_to_gf_cmd()

int32_t client_cmd_to_gf_cmd ( int32_t  cmd,
int32_t *  gf_cmd 
)

◆ client_dump_locks()

int32_t client_dump_locks ( char *  name,
inode_t inode,
dict_t dict 
)

◆ client_save_number_fds()

void client_save_number_fds ( clnt_conf_t conf,
int  count 
)

Definition at line 453 of file client-lk.c.

References LOCK, and UNLOCK.

Referenced by client_post_handshake().

◆ client_setlk()

static void client_setlk ( clnt_fd_ctx_t fdctx,
client_posix_lock_t lock 
)
static

Definition at line 310 of file client-lk.c.

References __insert_and_merge(), and lock.

Referenced by client_add_lock_for_recovery().

◆ delete_granted_locks_owner()

◆ destroy_client_lock()

static void destroy_client_lock ( client_posix_lock_t lock)
static

Definition at line 316 of file client-lk.c.

References GF_FREE, and lock.

Referenced by destroy_client_locks_from_list().

◆ destroy_client_locks_from_list()

void destroy_client_locks_from_list ( struct list_head deleted)

◆ dump_client_locks()

int dump_client_locks ( inode_t inode)

◆ dump_client_locks_fd()

static int dump_client_locks_fd ( clnt_fd_ctx_t fdctx)
static

Definition at line 36 of file client-lk.c.

References __dump_client_lock(), list_for_each_entry, lock, and _client_fd_ctx::lock_list.

Referenced by dump_client_locks().

◆ is_client_dump_locks_cmd()

int32_t is_client_dump_locks_cmd ( char *  name)

Definition at line 529 of file client-lk.c.

References CLIENT_DUMP_LOCKS.

Referenced by client3_3_getxattr(), and client4_0_getxattr().

◆ locks_overlap()

static int locks_overlap ( client_posix_lock_t l1,
client_posix_lock_t l2 
)
static

Definition at line 115 of file client-lk.c.

References _client_posix_lock::fl_end, and _client_posix_lock::fl_start.

Referenced by __insert_and_merge().

◆ new_client_lock()

◆ subtract_locks()