summaryrefslogtreecommitdiffstats
path: root/rpc
Commit message (Expand)AuthorAgeFilesLines
* socket: reduce rate of readv failure logs due to disconnectKrishnan Parthasarathi2016-02-222-5/+7
* rpc : build_prog_details should iterate program list inside critical sectionAtin Mukherjee2016-02-221-13/+20
* glusterd: Bug fixes for IPv6 supportNithin D2016-02-202-10/+5
* all: fixes for clang compile warningsKaleb S KEITHLEY2016-02-151-4/+5
* protocol: implement seek() FOPNiels de Vos2016-02-042-0/+17
* tier/glusterd : making new tier detach command throw warninghari gowtham2015-12-151-1/+2
* glusterd: cli command implementation for bitrot scrub statusGaurav Kumar Garg2015-11-192-0/+2
* build: fix ecdh.h and dh.h depsMilind Changire2015-11-162-7/+16
* build: install and package header files more conventionallyKaleb S. KEITHLEY2015-11-163-4/+7
* core: use syscall wrappers instead of direct syscalls - miscellaneousKaleb S. KEITHLEY2015-10-281-22/+23
* cluster/tier: add pause tier for snapshotsDan Lambright2015-10-211-1/+3
* server/protocol: option for dynamic authorization of client permissionsPrasanna Kumar Kalever2015-10-042-0/+4
* rpc: Remove unused functionAnoop C S2015-10-011-8/+0
* cluster/tier: add gluster v tier <vol>Dan Lambright2015-09-091-0/+1
* all: reduce "inline" usageJeff Darcy2015-09-015-27/+27
* gluster/cli: snapshot delete all does not work with xmlRajesh Joseph2015-08-281-2/+4
* SSL improvements: do not fail if certificate purpose is setEmmanuel Dreyfus2015-08-232-0/+9
* rdma:restore device linked list structure in case of failureMohammed Rafi KC2015-08-131-3/+5
* rpc: add owner xlator argument to rpc_clnt_newKrishnan Parthasarathi2015-08-122-2/+21
* rpc-clnt: Check for transport object during rpc connection cleanupSoumya Koduri2015-08-081-3/+7
* SSL improvements: ECDH, DH, CRL, and accessible optionsEmmanuel Dreyfus2015-08-051-80/+180
* client, rpc: make ping-timeout configurable for glusterfs clientsKrishnan Parthasarathi2015-08-052-0/+16
* rpc: check for unprivileged port should start at 1024Milind Changire2015-07-301-1/+1
* rpc: fix binding brick issue while bind-insecure is enabledPrasanna Kumar Kalever2015-07-265-54/+91
* rpc,server,glusterd: Init transport list for accepted transportKaushal M2015-07-241-0/+1
* rpc-transport: socket_poller fixes for proper working of mgmt encryptionKaushal M2015-07-131-5/+8
* rpcsvc: add request's address in logKrishnan Parthasarathi2015-07-131-1/+2
* rdma : porting missing gf_log to gf_msgManikandan Selvaganesh2015-07-123-12/+18
* Revert "rpc: By default set allow-insecure, bind-insecure to on"Raghavendra G2015-07-024-52/+21
* rpc: By default set allow-insecure, bind-insecure to onPrasanna Kumar Kalever2015-06-304-21/+52
* rdma : removing duplicate printing of error string in gf_msgManikandan Selvaganesh2015-06-272-35/+27
* rpc: fix possible deadlock left behind in d448fd1Krishnan Parthasarathi2015-06-173-23/+21
* features/bitrot: tuanble object signing waiting time value for bitrotGaurav Kumar Garg2015-06-151-0/+1
* build: improve detection of new OpenSSL featuresNiels de Vos2015-06-111-1/+1
* rpc: call transport_unref only on non-NULL transportKrishnan Parthasarathi2015-06-051-2/+8
* build: fix compiling on older distributionsNiels de Vos2015-06-031-0/+18
* socket: throttle only connected transportKrishnan Parthasarathi2015-05-311-2/+15
* build: do not #include "config.h" in each fileNiels de Vos2015-05-2925-125/+0
* build: do not include rpcgen generated files in "make dist"Niels de Vos2015-05-281-3/+6
* glusterd: fix repeated connection to nfssvc failed msgsKrishnan Parthasarathi2015-05-281-0/+6
* cli/tiering: Enhance cli output for tieringMohammed Rafi KC2015-05-081-1/+2
* glusterd: remove replace brick with data migration support form cli/glusterdGaurav Kumar Garg2015-05-071-10/+0
* quota/marker: turn off inode quotas by defaultvmallika2015-05-061-0/+1
* Upcall: Send stat as part of cache_invalidation notificationsSoumya Koduri2015-05-051-0/+8
* rdma:properly handle iobuf_pool when rdma transport is unloadedMohammed Rafi KC2015-05-052-20/+62
* geo-rep: Status EnhancementsAravinda VK2015-05-051-6/+12
* rpc: Included necessary stats in 'gfs3_cbk_cache_invalidation_req'Soumya Koduri2015-05-041-0/+6
* rpc: Maintain separate xlator pointer in 'rpcsvc_state'Kotresh HR2015-05-042-5/+7
* glusterd: gluster volume status should show status of bitrot and scrubber daemonGaurav Kumar Garg2015-05-041-16/+18
* Upcall: Replaced opaque gfid with string in rpc cbk argsSoumya Koduri2015-04-302-4/+13
= "RELEASEDIR", [GF_FOP_FREMOVEXATTR]= "FREMOVEXATTR", [GF_FOP_FALLOCATE] = "FALLOCATE", [GF_FOP_DISCARD] = "DISCARD", [GF_FOP_ZEROFILL] = "ZEROFILL", [GF_FOP_IPC] = "IPC", [GF_FOP_SEEK] = "SEEK", [GF_FOP_LEASE] = "LEASE", [GF_FOP_COMPOUND] = "COMPOUND", [GF_FOP_GETACTIVELK] = "GETACTIVELK", [GF_FOP_SETACTIVELK] = "SETACTIVELK", [GF_FOP_PUT] = "PUT", [GF_FOP_ICREATE] = "ICREATE", [GF_FOP_NAMELINK] = "NAMELINK", }; const char *gf_upcall_list[GF_UPCALL_FLAGS_MAXVALUE] = { [GF_UPCALL_NULL] = "NULL", [GF_UPCALL] = "UPCALL", [GF_UPCALL_CI_STAT] = "CI_IATT", [GF_UPCALL_CI_XATTR] = "CI_XATTR", [GF_UPCALL_CI_RENAME] = "CI_RENAME", [GF_UPCALL_CI_NLINK] = "CI_UNLINK", [GF_UPCALL_CI_FORGET] = "CI_FORGET", [GF_UPCALL_LEASE_RECALL] = "LEASE_RECALL", }; /* THIS */ /* This global ctx is a bad hack to prevent some of the libgfapi crashes. * This should be removed once the patch on resource pool is accepted */ glusterfs_ctx_t *global_ctx = NULL; pthread_mutex_t global_ctx_mutex = PTHREAD_MUTEX_INITIALIZER; xlator_t global_xlator; static pthread_key_t this_xlator_key; static pthread_key_t synctask_key; static pthread_key_t uuid_buf_key; static char global_uuid_buf[GF_UUID_BUF_SIZE]; static pthread_key_t lkowner_buf_key; static char global_lkowner_buf[GF_LKOWNER_BUF_SIZE]; static pthread_key_t leaseid_buf_key; static int gf_global_mem_acct_enable = 1; static pthread_once_t globals_inited = PTHREAD_ONCE_INIT; int gf_global_mem_acct_enable_get (void) { return gf_global_mem_acct_enable; } int gf_global_mem_acct_enable_set (int val) { gf_global_mem_acct_enable = val; return 0; } void glusterfs_this_destroy (void *ptr) { FREE (ptr); } static struct xlator_cbks global_cbks = { .forget = NULL, .release = NULL, .releasedir = NULL, .invalidate = NULL, .client_destroy = NULL, .client_disconnect = NULL, .ictxmerge = NULL, .ictxsize = NULL, .fdctxsize = NULL, }; /* This is required to get through the check in graph.c */ static struct xlator_fops global_fops = { }; static int global_xl_reconfigure (xlator_t *this, dict_t *options) { int ret = -1; gf_boolean_t bool_opt = _gf_false; /* This is not added in volume dump, hence adding the options in log would be helpful for debugging later */ dict_dump_to_log (options); GF_OPTION_RECONF ("measure-latency", bool_opt, options, bool, out); this->ctx->measure_latency = bool_opt; GF_OPTION_RECONF ("metrics-dump-path", this->ctx->config.metrics_dumppath, options, str, out); /* TODO: add more things here */ ret = 0; out: return ret; } static int global_xl_init (xlator_t *this) { int ret = -1; gf_boolean_t bool_opt = false; GF_OPTION_INIT ("measure-latency", bool_opt, bool, out); this->ctx->measure_latency = bool_opt; GF_OPTION_INIT ("metrics-dump-path", this->ctx->config.metrics_dumppath, str, out); ret = 0; out: return ret; } static void global_xl_fini (xlator_t *this) { return; } struct volume_options global_xl_options[] = { { .key = {"measure-latency"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "no", .op_version = {GD_OP_VERSION_4_0_0}, .flags = OPT_FLAG_SETTABLE, .tags = {"global", "context"}, .description = "Use this option to toggle measuring latency" }, { .key = {"metrics-dump-path"}, .type = GF_OPTION_TYPE_STR, .default_value = "{{gluster_workdir}}/metrics", .op_version = {GD_OP_VERSION_4_0_0}, .flags = OPT_FLAG_SETTABLE, .tags = {"global", "context"}, .description = "Use this option to set the metrics dump path" }, { .key = {NULL},}, }; static volume_opt_list_t global_xl_opt_list; int glusterfs_this_init () { int ret = 0; ret = pthread_key_create (&this_xlator_key, glusterfs_this_destroy); if (ret != 0) { gf_msg ("", GF_LOG_WARNING, ret, LG_MSG_PTHREAD_KEY_CREATE_FAILED, "failed to create " "the pthread key"); return ret; } global_xlator.name = "glusterfs"; global_xlator.type = GF_GLOBAL_XLATOR_NAME; global_xlator.cbks = &global_cbks; global_xlator.fops = &global_fops; global_xlator.reconfigure = global_xl_reconfigure; global_xlator.init = global_xl_init; global_xlator.fini = global_xl_fini; INIT_LIST_HEAD (&global_xlator.volume_options); INIT_LIST_HEAD (&global_xl_opt_list.list); global_xl_opt_list.given_opt = global_xl_options; list_add_tail (&global_xl_opt_list.list, &global_xlator.volume_options); return ret; } xlator_t ** __glusterfs_this_location () { xlator_t **this_location = NULL; int ret = 0; this_location = pthread_getspecific (this_xlator_key); if (!this_location) { this_location = CALLOC (1, sizeof (*this_location)); if (!this_location) goto out; ret = pthread_setspecific (this_xlator_key, this_location); if (ret != 0) { FREE (this_location); this_location = NULL; goto out; } } out: if (this_location) { if (!*this_location) *this_location = &global_xlator; } return this_location; } xlator_t * glusterfs_this_get () { xlator_t **this_location = NULL; this_location = __glusterfs_this_location (); if (!this_location) return &global_xlator; return *this_location; } int glusterfs_this_set (xlator_t *this) { xlator_t **this_location = NULL; this_location = __glusterfs_this_location (); if (!this_location) return -ENOMEM; *this_location = this; return 0; } /* SYNCOPCTX */ static pthread_key_t syncopctx_key; static void syncopctx_key_destroy (void *ptr) { struct syncopctx *opctx = ptr; if (opctx) { if (opctx->groups) GF_FREE (opctx->groups); GF_FREE (opctx); } return; } void * syncopctx_getctx () { void *opctx = NULL; opctx = pthread_getspecific (syncopctx_key); return opctx; } int syncopctx_setctx (void *ctx) { int ret = 0; ret = pthread_setspecific (syncopctx_key, ctx); return ret; } static int syncopctx_init (void) { int ret; ret = pthread_key_create (&syncopctx_key, syncopctx_key_destroy); return ret; } /* SYNCTASK */ int synctask_init () { int ret = 0; ret = pthread_key_create (&synctask_key, NULL); return ret; } void * synctask_get () { void *synctask = NULL; synctask = pthread_getspecific (synctask_key); return synctask; } int synctask_set (void *synctask) { int ret = 0; pthread_setspecific (synctask_key, synctask); return ret; } //UUID_BUFFER void glusterfs_uuid_buf_destroy (void *ptr) { FREE (ptr); } int glusterfs_uuid_buf_init () { int ret = 0; ret = pthread_key_create (&uuid_buf_key, glusterfs_uuid_buf_destroy); return ret; } char * glusterfs_uuid_buf_get () { char *buf; int ret = 0; buf = pthread_getspecific (uuid_buf_key); if(!buf) { buf = MALLOC (GF_UUID_BUF_SIZE); ret = pthread_setspecific (uuid_buf_key, (void *) buf); if (ret) buf = global_uuid_buf; } return buf; } /* LKOWNER_BUFFER */ void glusterfs_lkowner_buf_destroy (void *ptr) { FREE (ptr); } int glusterfs_lkowner_buf_init () { int ret = 0; ret = pthread_key_create (&lkowner_buf_key, glusterfs_lkowner_buf_destroy); return ret; } char * glusterfs_lkowner_buf_get () { char *buf; int ret = 0; buf = pthread_getspecific (lkowner_buf_key); if(!buf) { buf = MALLOC (GF_LKOWNER_BUF_SIZE); ret = pthread_setspecific (lkowner_buf_key, (void *) buf); if (ret) buf = global_lkowner_buf; } return buf; } /* Leaseid buffer */ void glusterfs_leaseid_buf_destroy (void *ptr) { FREE (ptr); } int glusterfs_leaseid_buf_init () { int ret = 0; ret = pthread_key_create (&leaseid_buf_key, glusterfs_leaseid_buf_destroy); return ret; } char * glusterfs_leaseid_buf_get () { char *buf = NULL; int ret = 0; buf = pthread_getspecific (leaseid_buf_key); if (!buf) { buf = CALLOC (1, GF_LEASE_ID_BUF_SIZE); ret = pthread_setspecific (leaseid_buf_key, (void *) buf); if (ret) { FREE (buf); buf = NULL; } } return buf; } char * glusterfs_leaseid_exist () { return pthread_getspecific (leaseid_buf_key); } static void gf_globals_init_once () { int ret = 0; ret = glusterfs_this_init (); if (ret) { gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_TRANSLATOR_INIT_FAILED, "ERROR: glusterfs-translator init failed"); goto out; } ret = glusterfs_uuid_buf_init (); if(ret) { gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_UUID_BUF_INIT_FAILED, "ERROR: glusterfs uuid buffer init failed"); goto out; } ret = glusterfs_lkowner_buf_init (); if(ret) { gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_LKOWNER_BUF_INIT_FAILED, "ERROR: glusterfs lkowner buffer init failed"); goto out; } ret = glusterfs_leaseid_buf_init (); if (ret) { gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_LEASEID_BUF_INIT_FAILED, "ERROR: glusterfs leaseid buffer init failed"); goto out; } ret = synctask_init (); if (ret) { gf_msg ("", GF_LOG_CRITICAL, 0, LG_MSG_SYNCTASK_INIT_FAILED,