clsync
Loading...
Searching...
No Matches
sync.c File Reference
#include "common.h"
#include "main.h"
#include "error.h"
#include "fileutils.h"
#include "malloc.h"
#include "cluster.h"
#include "sync.h"
#include "glibex.h"
#include "control.h"
#include "indexes.h"
#include "privileged.h"
#include "rules.h"
#include <stdio.h>
#include <dlfcn.h>
Include dependency graph for sync.c:

Go to the source code of this file.

Data Structures

struct  trylocked_arg
 
struct  sync_dump_arg
 

Macros

#define SEQID_WINDOW   (((unsigned int)~0)>>1)
 
#define SEQID_EQ(a, b)
 
#define SEQID_GE(a, b)
 
#define SEQID_LE(a, b)
 
#define SEQID_GT(a, b)
 
#define SEQID_LT(a, b)
 
#define SHOULD_THREAD(ctx_p)
 
#define SYNC_EXEC_ARGV(...)
 
#define debug_argv_dump(level, argv)
 
#define _sync_exec_getargv(argv, firstarg, COPYARG)
 
#define SYNC_LOOP_IDLE
 
#define SYNC_LOOP_CONTINUE_UNLOCK
 

Enumerations

enum  dump_dirfd_obj { DUMP_DIRFD_ROOT = 0 , DUMP_DIRFD_QUEUE , DUMP_DIRFD_THREAD , DUMP_DIRFD_MAX }
 
enum  dump_ltype { DUMP_LTYPE_INCLUDE , DUMP_LTYPE_EXCLUDE , DUMP_LTYPE_EVINFO }
 

Functions

static unsigned int sync_seqid ()
 
static void setenv_iteration (uint32_t iteration_num)
 
static void finish_iteration (ctx_t *ctx_p)
 
gpointer eidup (gpointer ei_gp)
 
static void evinfo_merge (ctx_t *ctx_p, eventinfo_t *evinfo_dst, eventinfo_t *evinfo_src)
 
static int _exitcode_process (ctx_t *ctx_p, int exitcode)
 
int exitcode_process (ctx_t *ctx_p, int exitcode)
 
threadsinfo_tthread_info ()
 
int exec_argv (char **argv, int *child_pid)
 
static void so_call_sync_finished (int n, api_eventinfo_t *ei)
 
static int so_call_sync (ctx_t *ctx_p, indexes_t *indexes_p, int n, api_eventinfo_t *ei)
 
static int so_call_rsync_finished (ctx_t *ctx_p, const char *inclistfile, const char *exclistfile)
 
static int so_call_rsync (ctx_t *ctx_p, indexes_t *indexes_p, const char *inclistfile, const char *exclistfile)
 
static void argv_dump (int debug_level, char **argv)
 
char * sync_path_rel2abs (ctx_t *ctx_p, const char *path_rel, ssize_t path_rel_len, size_t *path_abs_len_p, char *path_abs_oldptr)
 
char * sync_path_abs2rel (ctx_t *ctx_p, const char *path_abs, ssize_t path_abs_len, size_t *path_rel_len_p, char *path_rel_oldptr)
 
pid_t clsyncapi_fork (ctx_t *ctx_p)
 clsync's wrapper for function "fork()". Should be used instead of "fork()" directly, to notify clsync about child's pid.
 
int sync_exec_argv (ctx_t *ctx_p, indexes_t *indexes_p, thread_callbackfunct_t callback, thread_callbackfunct_arg_t *callback_arg_p, char **argv)
 
static int sync_queuesync (const char *fpath_rel, eventinfo_t *evinfo, ctx_t *ctx_p, indexes_t *indexes_p, queue_id_t queue_id)
 
static void evinfo_initialevmask (ctx_t *ctx_p, eventinfo_t *evinfo_p, int isdir)
 
static void api_evinfo_initialevmask (ctx_t *ctx_p, api_eventinfo_t *evinfo_p, int isdir)
 
int sync_dosync (const char *fpath, uint32_t evmask, ctx_t *ctx_p, indexes_t *indexes_p)
 
int sync_initialsync_walk (ctx_t *ctx_p, const char *dirpath, indexes_t *indexes_p, queue_id_t queue_id, initsync_t initsync)
 
const char * sync_parameter_get (const char *variable_name, void *_dosync_arg_p)
 
static char ** sync_customargv (ctx_t *ctx_p, struct dosync_arg *dosync_arg_p, synchandler_args_t *args_p)
 
static void argv_free (char **argv)
 
static int sync_initialsync_finish (ctx_t *ctx_p, initsync_t initsync, int ret)
 
int sync_initialsync (const char *path, ctx_t *ctx_p, indexes_t *indexes_p, initsync_t initsync)
 
int sync_notify_mark (ctx_t *ctx_p, const char *accpath, const char *path, size_t pathlen, indexes_t *indexes_p)
 
int sync_mark_walk (ctx_t *ctx_p, const char *dirpath, indexes_t *indexes_p)
 
int sync_notify_init (ctx_t *ctx_p)
 
static int sync_dosync_exec (ctx_t *ctx_p, indexes_t *indexes_p, const char *evmask_str, const char *fpath)
 
int fileischanged (ctx_t *ctx_p, indexes_t *indexes_p, const char *path_rel, stat64_t *lst_p, int is_deleted)
 
static int sync_indexes_fpath2ei_addfixed (ctx_t *ctx_p, indexes_t *indexes_p, const char *fpath, eventinfo_t *evinfo)
 
int sync_prequeue_loadmark (int monitored, ctx_t *ctx_p, indexes_t *indexes_p, const char *path_full, const char *path_rel, stat64_t *lst_p, eventobjtype_t objtype_old, eventobjtype_t objtype_new, uint32_t event_mask, int event_wd, mode_t st_mode, off_t st_size, char **path_buf_p, size_t *path_buf_len_p, eventinfo_t *evinfo)
 
void _sync_idle_dosync_collectedexcludes (gpointer fpath_gp, gpointer flags_gp, gpointer arg_gp)
 
eventinfo_tht_fpath_isincluded (GHashTable *ht, const char *const fpath)
 
int _sync_islocked (threadinfo_t *threadinfo_p, void *_fpath)
 
static int sync_islocked (const char *const fpath)
 
void _sync_idle_dosync_collectedevents (gpointer fpath_gp, gpointer evinfo_gp, gpointer arg_gp)
 
gboolean sync_trylocked (gpointer fpath_gp, gpointer evinfo_gp, gpointer arg_gp)
 
int sync_idle_dosync_collectedevents_cleanup (ctx_t *ctx_p, thread_callbackfunct_arg_t *arg_p)
 
void sync_queuesync_wrapper (gpointer fpath_gp, gpointer evinfo_gp, gpointer arg_gp)
 
int sync_prequeue_unload (ctx_t *ctx_p, indexes_t *indexes_p)
 
int sync_idle_dosync_collectedevents_aggrqueue (queue_id_t queue_id, ctx_t *ctx_p, indexes_t *indexes_p, struct dosync_arg *dosync_arg)
 
int sync_idle_dosync_collectedevents_uniqfname (ctx_t *ctx_p, char *fpath, char *name)
 
int sync_idle_dosync_collectedevents_listcreate (struct dosync_arg *dosync_arg_p, char *name)
 
void rsync_escape_cleanup ()
 
const char * rsync_escape (const char *path)
 
static int rsync_outline (FILE *outf, char *outline, eventinfo_flags_t flags)
 
gboolean rsync_aggrout (gpointer outline_gp, gpointer flags_gp, gpointer arg_gp)
 
static int rsync_listpush (indexes_t *indexes_p, const char *fpath, size_t fpath_len, eventinfo_flags_t flags, unsigned int *linescount_p)
 
gboolean sync_idle_dosync_collectedevents_rsync_exclistpush (gpointer fpath_gp, gpointer flags_gp, gpointer arg_gp)
 
int sync_idle_dosync_collectedevents_commitpart (struct dosync_arg *dosync_arg_p)
 
void sync_inclist_rotate (ctx_t *ctx_p, struct dosync_arg *dosync_arg_p)
 
void sync_idle_dosync_collectedevents_listpush (gpointer fpath_gp, gpointer evinfo_gp, gpointer arg_gp)
 
int sync_idle_dosync_collectedevents (ctx_t *ctx_p, indexes_t *indexes_p)
 
int apievinfo2rsynclist (indexes_t *indexes_p, FILE *listfile, int n, api_eventinfo_t *apievinfo)
 Writes the list to list-file for "--include-from" option of rsync using array of api_eventinfo_t.
 
int sync_idle (ctx_t *ctx_p, indexes_t *indexes_p)
 
int notify_wait (ctx_t *ctx_p, indexes_t *indexes_p)
 
void hook_preexit (ctx_t *ctx_p)
 
int sync_loop (ctx_t *ctx_p, indexes_t *indexes_p)
 
void sync_sig_int (int signal)
 
int sync_tryforcecycle (ctx_t *ctx_p, pthread_t pthread_parent)
 
int sync_switch_state (ctx_t *ctx_p, pthread_t pthread_parent, int newstate)
 
void sync_dump_liststep (gpointer fpath_gp, gpointer evinfo_gp, gpointer arg_gp)
 
int sync_dump_thread (threadinfo_t *threadinfo_p, void *_arg)
 
int sync_dump (ctx_t *ctx_p, const char *const dir_path)
 
void sync_sigchld ()
 
int sync_sighandler (sighandler_arg_t *sighandler_arg_p)
 
int sync_term (int exitcode)
 
__extension__ int sync_run (ctx_t *ctx_p)
 

Variables

pthread_t pthread_sighandler
 
static unsigned int _sync_seqid_value = 0
 
volatile state_tstate_p = NULL
 
volatile int exitcode = 0
 
size_t rsync_escape_result_size = 0
 
char * rsync_escape_result = NULL
 
int * sync_sighandler_exitcode_p = NULL
 

Macro Definition Documentation

◆ _sync_exec_getargv

#define _sync_exec_getargv ( argv,
firstarg,
COPYARG )
Value:
{\
va_list arglist;\
va_start(arglist, firstarg);\
\
int i = 0;\
do {\
char *arg;\
if(i >= MAXARGUMENTS) {\
error("Too many arguments (%i >= %i).", i, MAXARGUMENTS);\
return ENOMEM;\
}\
arg = (char *)va_arg(arglist, const char *const);\
argv[i] = arg!=NULL ? COPYARG : NULL;\
} while(argv[i++] != NULL);\
va_end(arglist);\
}
#define MAXARGUMENTS
char ** argv
Definition main.c:2725

Definition at line 971 of file sync.c.

◆ debug_argv_dump

#define debug_argv_dump ( level,
argv )
Value:
if (unlikely(ctx_p->flags[DEBUG] >= level))\
argv_dump(level, argv)
@ DEBUG
Definition ctx.h:71
#define unlikely(x)
Definition macros.h:29
ctx_t * ctx_p
Definition mon_kqueue.c:85
int flags[(1<< 10)]
Definition ctx.h:338

Definition at line 952 of file sync.c.

◆ SEQID_EQ

#define SEQID_EQ ( a,
b )
Value:
((a)==(b))

Definition at line 65 of file sync.c.

◆ SEQID_GE

#define SEQID_GE ( a,
b )
Value:
((a)-(b) < SEQID_WINDOW)
#define SEQID_WINDOW
Definition sync.c:64

Definition at line 66 of file sync.c.

◆ SEQID_GT

#define SEQID_GT ( a,
b )
Value:
((!SEQID_EQ(a, b)) && (SEQID_GE(a, b)))
#define SEQID_GE(a, b)
Definition sync.c:66
#define SEQID_EQ(a, b)
Definition sync.c:65

Definition at line 68 of file sync.c.

◆ SEQID_LE

#define SEQID_LE ( a,
b )
Value:
((b)-(a) < SEQID_WINDOW)

Definition at line 67 of file sync.c.

◆ SEQID_LT

#define SEQID_LT ( a,
b )
Value:
((!SEQID_EQ(a, b)) && (SEQID_LE(a, b)))
#define SEQID_LE(a, b)
Definition sync.c:67

Definition at line 69 of file sync.c.

◆ SEQID_WINDOW

#define SEQID_WINDOW   (((unsigned int)~0)>>1)

Definition at line 64 of file sync.c.

◆ SHOULD_THREAD

#define SHOULD_THREAD ( ctx_p)
Value:
@ PM_SAFE
Definition common.h:118
@ PM_OFF
Definition common.h:117
@ THREADING
Definition ctx.h:55
uint32_t iteration_num
Definition ctx.h:332

Definition at line 548 of file sync.c.

◆ SYNC_EXEC_ARGV

#define SYNC_EXEC_ARGV ( ...)
Value:
sync_exec_argv(__VA_ARGS__)
int sync_exec_argv(ctx_t *ctx_p, indexes_t *indexes_p, thread_callbackfunct_t callback, thread_callbackfunct_arg_t *callback_arg_p, char **argv)
Definition sync.c:1087

Definition at line 949 of file sync.c.

◆ SYNC_LOOP_CONTINUE_UNLOCK

#define SYNC_LOOP_CONTINUE_UNLOCK
Value:
{\
pthread_cond_broadcast(&threadsinfo_p->cond[PTHREAD_MUTEX_STATE]);\
debug(4, "pthread_mutex_unlock()");\
pthread_mutex_unlock(&threadsinfo_p->mutex[PTHREAD_MUTEX_STATE]);\
continue;\
}
@ PTHREAD_MUTEX_STATE
Definition common.h:153

Definition at line 3358 of file sync.c.

◆ SYNC_LOOP_IDLE

#define SYNC_LOOP_IDLE
Value:
{\
int ret;\
if((ret=sync_idle(ctx_p, indexes_p))) {\
error("got error while sync_idle().");\
return ret;\
}\
}
int sync_idle(ctx_t *ctx_p, indexes_t *indexes_p)
Definition sync.c:3196

Definition at line 3350 of file sync.c.

Enumeration Type Documentation

◆ dump_dirfd_obj

Enumerator
DUMP_DIRFD_ROOT 
DUMP_DIRFD_QUEUE 
DUMP_DIRFD_THREAD 
DUMP_DIRFD_MAX 

Definition at line 3681 of file sync.c.

◆ dump_ltype

enum dump_ltype
Enumerator
DUMP_LTYPE_INCLUDE 
DUMP_LTYPE_EXCLUDE 
DUMP_LTYPE_EVINFO 

Definition at line 3689 of file sync.c.

Function Documentation

◆ _exitcode_process()

static int _exitcode_process ( ctx_t * ctx_p,
int exitcode )
inlinestatic

Definition at line 164 of file sync.c.

Here is the caller graph for this function:

◆ _sync_idle_dosync_collectedevents()

void _sync_idle_dosync_collectedevents ( gpointer fpath_gp,
gpointer evinfo_gp,
gpointer arg_gp )

Definition at line 2427 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _sync_idle_dosync_collectedexcludes()

void _sync_idle_dosync_collectedexcludes ( gpointer fpath_gp,
gpointer flags_gp,
gpointer arg_gp )

Definition at line 2347 of file sync.c.

Here is the caller graph for this function:

◆ _sync_islocked()

int _sync_islocked ( threadinfo_t * threadinfo_p,
void * _fpath )

Definition at line 2404 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ api_evinfo_initialevmask()

static void api_evinfo_initialevmask ( ctx_t * ctx_p,
api_eventinfo_t * evinfo_p,
int isdir )
inlinestatic

Definition at line 1338 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apievinfo2rsynclist()

int apievinfo2rsynclist ( struct indexes * indexes_p,
FILE * listfile,
int n,
api_eventinfo_t * apievinfo )

Writes the list to list-file for "--include-from" option of rsync using array of api_eventinfo_t.

Parameters
[in]indexes_pPointer to "indexes"
[in]listfileFile identifier to write to
[in]nNumber of records in apievinfo
[in]apievinfoPointer to api_eventinfo_t records
Return values
zeroSuccessful
non-zeroIf got error while deleting the message. The error-code is placed into returned value.

Definition at line 3171 of file sync.c.

Here is the call graph for this function:

◆ argv_dump()

static void argv_dump ( int debug_level,
char ** argv )
inlinestatic

Definition at line 956 of file sync.c.

◆ argv_free()

static void argv_free ( char ** argv)
static

Definition at line 1639 of file sync.c.

Here is the caller graph for this function:

◆ clsyncapi_fork()

pid_t clsyncapi_fork ( struct ctx * ctx_p)

clsync's wrapper for function "fork()". Should be used instead of "fork()" directly, to notify clsync about child's pid.

Parameters
[in]ctx_pPointer to "ctx"
Return values
-1If error (see "man 2 fork", added error code "ECANCELED" if too many children)
0If child
pidPid of child of parent. (see "man 2 fork")

Definition at line 1060 of file sync.c.

◆ eidup()

gpointer eidup ( gpointer ei_gp)

Definition at line 100 of file sync.c.

Here is the caller graph for this function:

◆ evinfo_initialevmask()

static void evinfo_initialevmask ( ctx_t * ctx_p,
eventinfo_t * evinfo_p,
int isdir )
inlinestatic

Definition at line 1291 of file sync.c.

Here is the caller graph for this function:

◆ evinfo_merge()

static void evinfo_merge ( ctx_t * ctx_p,
eventinfo_t * evinfo_dst,
eventinfo_t * evinfo_src )
inlinestatic

Definition at line 108 of file sync.c.

Here is the caller graph for this function:

◆ exec_argv()

int exec_argv ( char ** argv,
int * child_pid )

Definition at line 550 of file sync.c.

Here is the caller graph for this function:

◆ exitcode_process()

int exitcode_process ( ctx_t * ctx_p,
int exitcode )

Definition at line 177 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileischanged()

int fileischanged ( ctx_t * ctx_p,
indexes_t * indexes_p,
const char * path_rel,
stat64_t * lst_p,
int is_deleted )

Definition at line 2083 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finish_iteration()

static void finish_iteration ( ctx_t * ctx_p)
inlinestatic

Definition at line 84 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hook_preexit()

void hook_preexit ( ctx_t * ctx_p)

Definition at line 3365 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ht_fpath_isincluded()

eventinfo_t * ht_fpath_isincluded ( GHashTable * ht,
const char *const fpath )

Definition at line 2357 of file sync.c.

Here is the caller graph for this function:

◆ notify_wait()

int notify_wait ( ctx_t * ctx_p,
indexes_t * indexes_p )

Definition at line 3246 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsync_aggrout()

gboolean rsync_aggrout ( gpointer outline_gp,
gpointer flags_gp,
gpointer arg_gp )

Definition at line 2755 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsync_escape()

const char * rsync_escape ( const char * path)

Definition at line 2681 of file sync.c.

Here is the caller graph for this function:

◆ rsync_escape_cleanup()

void rsync_escape_cleanup ( )

Definition at line 2675 of file sync.c.

Here is the caller graph for this function:

◆ rsync_listpush()

static int rsync_listpush ( indexes_t * indexes_p,
const char * fpath,
size_t fpath_len,
eventinfo_flags_t flags,
unsigned int * linescount_p )
inlinestatic

Definition at line 2772 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsync_outline()

static int rsync_outline ( FILE * outf,
char * outline,
eventinfo_flags_t flags )
inlinestatic

Definition at line 2734 of file sync.c.

Here is the caller graph for this function:

◆ setenv_iteration()

static void setenv_iteration ( uint32_t iteration_num)
inlinestatic

Definition at line 76 of file sync.c.

Here is the caller graph for this function:

◆ so_call_rsync()

static int so_call_rsync ( ctx_t * ctx_p,
indexes_t * indexes_p,
const char * inclistfile,
const char * exclistfile )
inlinestatic

Definition at line 858 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ so_call_rsync_finished()

static int so_call_rsync_finished ( ctx_t * ctx_p,
const char * inclistfile,
const char * exclistfile )
inlinestatic

Definition at line 781 of file sync.c.

Here is the caller graph for this function:

◆ so_call_sync()

static int so_call_sync ( ctx_t * ctx_p,
indexes_t * indexes_p,
int n,
api_eventinfo_t * ei )
inlinestatic

Definition at line 701 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ so_call_sync_finished()

static void so_call_sync_finished ( int n,
api_eventinfo_t * ei )
inlinestatic

Definition at line 633 of file sync.c.

Here is the caller graph for this function:

◆ sync_customargv()

static char ** sync_customargv ( ctx_t * ctx_p,
struct dosync_arg * dosync_arg_p,
synchandler_args_t * args_p )
static

Definition at line 1569 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_dosync()

int sync_dosync ( const char * fpath,
uint32_t evmask,
ctx_t * ctx_p,
indexes_t * indexes_p )

Definition at line 2064 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_dosync_exec()

static int sync_dosync_exec ( ctx_t * ctx_p,
indexes_t * indexes_p,
const char * evmask_str,
const char * fpath )
inlinestatic

Definition at line 2035 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_dump()

int sync_dump ( ctx_t * ctx_p,
const char *const dir_path )

Definition at line 3773 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_dump_liststep()

void sync_dump_liststep ( gpointer fpath_gp,
gpointer evinfo_gp,
gpointer arg_gp )

Definition at line 3702 of file sync.c.

Here is the caller graph for this function:

◆ sync_dump_thread()

int sync_dump_thread ( threadinfo_t * threadinfo_p,
void * _arg )

Definition at line 3738 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_exec_argv()

int sync_exec_argv ( ctx_t * ctx_p,
indexes_t * indexes_p,
thread_callbackfunct_t callback,
thread_callbackfunct_arg_t * callback_arg_p,
char ** argv )

Definition at line 1087 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle()

int sync_idle ( ctx_t * ctx_p,
indexes_t * indexes_p )

Definition at line 3196 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents()

int sync_idle_dosync_collectedevents ( ctx_t * ctx_p,
indexes_t * indexes_p )

Definition at line 3055 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_aggrqueue()

int sync_idle_dosync_collectedevents_aggrqueue ( queue_id_t queue_id,
ctx_t * ctx_p,
indexes_t * indexes_p,
struct dosync_arg * dosync_arg )

Definition at line 2575 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_cleanup()

int sync_idle_dosync_collectedevents_cleanup ( ctx_t * ctx_p,
thread_callbackfunct_arg_t * arg_p )

Definition at line 2529 of file sync.c.

Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_commitpart()

int sync_idle_dosync_collectedevents_commitpart ( struct dosync_arg * dosync_arg_p)

Definition at line 2852 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_listcreate()

int sync_idle_dosync_collectedevents_listcreate ( struct dosync_arg * dosync_arg_p,
char * name )

Definition at line 2647 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_listpush()

void sync_idle_dosync_collectedevents_listpush ( gpointer fpath_gp,
gpointer evinfo_gp,
gpointer arg_gp )

Definition at line 2973 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_rsync_exclistpush()

gboolean sync_idle_dosync_collectedevents_rsync_exclistpush ( gpointer fpath_gp,
gpointer flags_gp,
gpointer arg_gp )

Definition at line 2819 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_idle_dosync_collectedevents_uniqfname()

int sync_idle_dosync_collectedevents_uniqfname ( ctx_t * ctx_p,
char * fpath,
char * name )

Definition at line 2626 of file sync.c.

Here is the caller graph for this function:

◆ sync_inclist_rotate()

void sync_inclist_rotate ( ctx_t * ctx_p,
struct dosync_arg * dosync_arg_p )

Definition at line 2930 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_indexes_fpath2ei_addfixed()

static int sync_indexes_fpath2ei_addfixed ( ctx_t * ctx_p,
indexes_t * indexes_p,
const char * fpath,
eventinfo_t * evinfo )
inlinestatic

Definition at line 2120 of file sync.c.

Here is the caller graph for this function:

◆ sync_initialsync()

int sync_initialsync ( const char * path,
ctx_t * ctx_p,
indexes_t * indexes_p,
initsync_t initsync )

Definition at line 1671 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_initialsync_finish()

static int sync_initialsync_finish ( ctx_t * ctx_p,
initsync_t initsync,
int ret )
inlinestatic

Definition at line 1664 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_initialsync_walk()

int sync_initialsync_walk ( ctx_t * ctx_p,
const char * dirpath,
indexes_t * indexes_p,
queue_id_t queue_id,
initsync_t initsync )

Definition at line 1347 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_islocked()

static int sync_islocked ( const char *const fpath)
inlinestatic

Definition at line 2416 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_loop()

int sync_loop ( ctx_t * ctx_p,
indexes_t * indexes_p )

Definition at line 3379 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_mark_walk()

int sync_mark_walk ( ctx_t * ctx_p,
const char * dirpath,
indexes_t * indexes_p )

Definition at line 1828 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_notify_init()

int sync_notify_init ( ctx_t * ctx_p)

Definition at line 1953 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_notify_mark()

int sync_notify_mark ( ctx_t * ctx_p,
const char * accpath,
const char * path,
size_t pathlen,
indexes_t * indexes_p )

Definition at line 1787 of file sync.c.

Here is the caller graph for this function:

◆ sync_parameter_get()

const char * sync_parameter_get ( const char * variable_name,
void * _dosync_arg_p )

Definition at line 1548 of file sync.c.

Here is the caller graph for this function:

◆ sync_path_abs2rel()

char * sync_path_abs2rel ( ctx_t * ctx_p,
const char * path_abs,
ssize_t path_abs_len,
size_t * path_rel_len_p,
char * path_rel_oldptr )

Definition at line 1018 of file sync.c.

Here is the caller graph for this function:

◆ sync_path_rel2abs()

char * sync_path_rel2abs ( ctx_t * ctx_p,
const char * path_rel,
ssize_t path_rel_len,
size_t * path_abs_len_p,
char * path_abs_oldptr )

Definition at line 988 of file sync.c.

Here is the caller graph for this function:

◆ sync_prequeue_loadmark()

int sync_prequeue_loadmark ( int monitored,
ctx_t * ctx_p,
indexes_t * indexes_p,
const char * path_full,
const char * path_rel,
stat64_t * lst_p,
eventobjtype_t objtype_old,
eventobjtype_t objtype_new,
uint32_t event_mask,
int event_wd,
mode_t st_mode,
off_t st_size,
char ** path_buf_p,
size_t * path_buf_len_p,
eventinfo_t * evinfo )

Definition at line 2142 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_prequeue_unload()

int sync_prequeue_unload ( ctx_t * ctx_p,
indexes_t * indexes_p )

Definition at line 2564 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_queuesync()

static int sync_queuesync ( const char * fpath_rel,
eventinfo_t * evinfo,
ctx_t * ctx_p,
indexes_t * indexes_p,
queue_id_t queue_id )
static

Definition at line 1251 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_queuesync_wrapper()

void sync_queuesync_wrapper ( gpointer fpath_gp,
gpointer evinfo_gp,
gpointer arg_gp )

Definition at line 2554 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_run()

__extension__ int sync_run ( ctx_t * ctx_p)

Definition at line 3998 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_seqid()

static unsigned int sync_seqid ( )
inlinestatic

Definition at line 71 of file sync.c.

Here is the caller graph for this function:

◆ sync_sig_int()

void sync_sig_int ( int signal)

Definition at line 3548 of file sync.c.

Here is the caller graph for this function:

◆ sync_sigchld()

void sync_sigchld ( )

Definition at line 3866 of file sync.c.

Here is the caller graph for this function:

◆ sync_sighandler()

int sync_sighandler ( sighandler_arg_t * sighandler_arg_p)

Definition at line 3874 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_switch_state()

int sync_switch_state ( ctx_t * ctx_p,
pthread_t pthread_parent,
int newstate )

Definition at line 3597 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_term()

int sync_term ( int exitcode)

Definition at line 3991 of file sync.c.

Here is the caller graph for this function:

◆ sync_tryforcecycle()

int sync_tryforcecycle ( ctx_t * ctx_p,
pthread_t pthread_parent )

Definition at line 3557 of file sync.c.

Here is the caller graph for this function:

◆ sync_trylocked()

gboolean sync_trylocked ( gpointer fpath_gp,
gpointer evinfo_gp,
gpointer arg_gp )

Definition at line 2504 of file sync.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_info()

threadsinfo_t * thread_info ( )

Definition at line 190 of file sync.c.

Here is the caller graph for this function:

Variable Documentation

◆ _sync_seqid_value

unsigned int _sync_seqid_value = 0
static

Definition at line 70 of file sync.c.

◆ exitcode

volatile int exitcode = 0

Definition at line 547 of file sync.c.

◆ pthread_sighandler

pthread_t pthread_sighandler

Definition at line 59 of file sync.c.

◆ rsync_escape_result

char* rsync_escape_result = NULL

Definition at line 2673 of file sync.c.

◆ rsync_escape_result_size

size_t rsync_escape_result_size = 0

Definition at line 2672 of file sync.c.

◆ state_p

volatile state_t* state_p = NULL

Definition at line 546 of file sync.c.

◆ sync_sighandler_exitcode_p

int* sync_sighandler_exitcode_p = NULL

Definition at line 3873 of file sync.c.