summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/scheduler.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-04-06 05:34:13 +0000
committerVijay Bellur <vijay@gluster.com>2011-04-06 12:06:14 -0700
commit2b55a4904590b13ad706c069e73e1f38d92d8085 (patch)
tree69495049f2f9121cfee33f91fcbbc5bd328a3c74 /libglusterfs/src/scheduler.c
parent0b91f5be63813e6494283a8ac7d6e1e4348c9f13 (diff)
nfs: convert errno EDQUOT into appropriate nfs-errno.v3.1.4qa2
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 2607 (Fileop fails when quota is enabled) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2607
Diffstat (limited to 'libglusterfs/src/scheduler.c')
0 files changed, 0 insertions, 0 deletions
%;'/> -rw-r--r--xlators/protocol/client/src/client-handshake.c2873
-rw-r--r--xlators/protocol/client/src/client-helpers.c1032
-rw-r--r--xlators/protocol/client/src/client-lk.c748
-rw-r--r--xlators/protocol/client/src/client-mem-types.h17
-rw-r--r--xlators/protocol/client/src/client-messages.h174
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c10254
-rw-r--r--xlators/protocol/client/src/client-rpc-fops_v2.c6177
-rw-r--r--xlators/protocol/client/src/client.c4454
-rw-r--r--xlators/protocol/client/src/client.h557
13 files changed, 20876 insertions, 9958 deletions
diff --git a/xlators/protocol/client/src/Makefile.am b/xlators/protocol/client/src/Makefile.am
index cf89d42da30..785a51fc3b4 100644
--- a/xlators/protocol/client/src/Makefile.am
+++ b/xlators/protocol/client/src/Makefile.am
@@ -2,19 +2,20 @@
xlator_LTLIBRARIES = client.la
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/protocol
-client_la_LDFLAGS = -module -avoid-version
+client_la_LDFLAGS = -module $(GF_XLATOR_DEFAULT_LDFLAGS)
client_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
$(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \
$(top_builddir)/rpc/xdr/src/libgfxdr.la
client_la_SOURCES = client.c client-helpers.c client-rpc-fops.c \
- client-handshake.c client-callback.c client-lk.c
+ client-handshake.c client-callback.c client-lk.c client-common.c \
+ client-rpc-fops_v2.c
-noinst_HEADERS = client.h client-mem-types.h
+noinst_HEADERS = client.h client-mem-types.h client-messages.h client-common.h
-AM_CPPFLAGS = $(GF_CPPFLAGS) \
- -I$(top_srcdir)/libglusterfs/src \
- -I$(top_srcdir)/rpc/xdr/src -I$(top_srcdir)/rpc/rpc-lib/src/
+AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
+ -I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src \
+ -I$(top_srcdir)/rpc/rpc-lib/src/
AM_CFLAGS = -Wall $(GF_CFLAGS)
diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c
index d886862f776..d83d9c14899 100644
--- a/xlators/protocol/client/src/client-callback.c
+++ b/xlators/protocol/client/src/client-callback.c
@@ -8,49 +8,305 @@
cases as published by the Free Software Foundation.
*/
-#ifndef _CONFIG_H
-#define _CONFIG_H
-#include "config.h"
-#endif
-
#include "client.h"
#include "rpc-clnt.h"
+#include <glusterfs/defaults.h>
+#include "client-messages.h"
-int
-client_cbk_null (struct rpc_clnt *rpc, void *mydata, void *data)
+static int
+client_cbk_null(struct rpc_clnt *rpc, void *mydata, void *data)
{
- gf_log (THIS->name, GF_LOG_WARNING,
- "this function should not be called");
- return 0;
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR, NULL);
+ return 0;
}
-int
-client_cbk_fetchspec (struct rpc_clnt *rpc, void *mydata, void *data)
+static int
+client_cbk_fetchspec(struct rpc_clnt *rpc, void *mydata, void *data)
{
- gf_log (THIS->name, GF_LOG_WARNING,
- "this function should not be called");
- return 0;
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR, NULL);
+ return 0;
}
-int
-client_cbk_ino_flush (struct rpc_clnt *rpc, void *mydata, void *data)
+static int
+client_cbk_ino_flush(struct rpc_clnt *rpc, void *mydata, void *data)
{
- gf_log (THIS->name, GF_LOG_WARNING,
- "this function should not be called");
- return 0;
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR, NULL);
+ return 0;
}
-rpcclnt_cb_actor_t gluster_cbk_actors[] = {
- [GF_CBK_NULL] = {"NULL", GF_CBK_NULL, client_cbk_null },
- [GF_CBK_FETCHSPEC] = {"FETCHSPEC", GF_CBK_FETCHSPEC, client_cbk_fetchspec },
- [GF_CBK_INO_FLUSH] = {"INO_FLUSH", GF_CBK_INO_FLUSH, client_cbk_ino_flush },
-};
+static int
+client_cbk_recall_lease(struct rpc_clnt *rpc, void *mydata, void *data)
+{
+ int ret = -1;
+ struct iovec *iov = NULL;
+ struct gf_upcall upcall_data = {
+ 0,
+ };
+ struct gf_upcall_recall_lease rl_data = {
+ 0,
+ };
+ gfs3_recall_lease_req recall_lease = {
+ {
+ 0,
+ },
+ };
+
+ GF_VALIDATE_OR_GOTO("client-callback", data, out);
+
+ iov = (struct iovec *)data;
+ ret = xdr_to_generic(*iov, &recall_lease,
+ (xdrproc_t)xdr_gfs3_recall_lease_req);
+
+ if (ret < 0) {
+ gf_smsg(THIS->name, GF_LOG_WARNING, -ret, PC_MSG_RECALL_LEASE_FAIL,
+ NULL);
+ goto out;
+ }
+
+ upcall_data.data = &rl_data;
+ ret = gf_proto_recall_lease_to_upcall(&recall_lease, &upcall_data);
+ if (ret < 0)
+ goto out;
+
+ upcall_data.event_type = GF_UPCALL_RECALL_LEASE;
+
+ gf_msg_trace(THIS->name, 0, "Upcall gfid = %s, ret = %d", recall_lease.gfid,
+ ret);
+
+ default_notify(THIS, GF_EVENT_UPCALL, &upcall_data);
+
+out:
+ if (recall_lease.xdata.xdata_val)
+ free(recall_lease.xdata.xdata_val);
+
+ if (rl_data.dict)
+ dict_unref(rl_data.dict);
+
+ return ret;
+}
+
+static int
+client_cbk_cache_invalidation(struct rpc_clnt *rpc, void *mydata, void *data)
+{
+ int ret = -1;
+ struct iovec *iov = NULL;
+ struct gf_upcall upcall_data = {
+ 0,
+ };
+ struct gf_upcall_cache_invalidation ca_data = {
+ 0,
+ };
+ gfs3_cbk_cache_invalidation_req ca_req = {
+ 0,
+ };
+
+ gf_msg_trace(THIS->name, 0, "Upcall callback is called");
+
+ if (!data)
+ goto out;
+
+ iov = (struct iovec *)data;
+ ret = xdr_to_generic(*iov, &ca_req,
+ (xdrproc_t)xdr_gfs3_cbk_cache_invalidation_req);
+
+ if (ret < 0) {
+ gf_smsg(THIS->name, GF_LOG_WARNING, -ret,
+ PC_MSG_CACHE_INVALIDATION_FAIL, NULL);
+ goto out;
+ }
+
+ upcall_data.data = &ca_data;
+ ret = gf_proto_cache_invalidation_to_upcall(THIS, &ca_req, &upcall_data);
+ if (ret < 0)
+ goto out;
+
+ gf_msg_trace(THIS->name, 0,
+ "Cache invalidation cbk received for gfid:"
+ " %s, ret = %d",
+ ca_req.gfid, ret);
+
+ default_notify(THIS, GF_EVENT_UPCALL, &upcall_data);
+
+out:
+ if (ca_req.gfid)
+ free(ca_req.gfid);
+
+ if (ca_req.xdata.xdata_val)
+ free(ca_req.xdata.xdata_val);
+
+ if (ca_data.dict)
+ dict_unref(ca_data.dict);
+
+ return 0;
+}
+
+static int
+client_cbk_child_up(struct rpc_clnt *rpc, void *mydata, void *data)
+{
+ clnt_conf_t *conf = NULL;
+ xlator_t *this = THIS;
+
+ GF_VALIDATE_OR_GOTO("client", this, out);
+ conf = this->private;
+ GF_VALIDATE_OR_GOTO(this->name, conf, out);
+
+ gf_msg_debug(this->name, 0, "Received CHILD_UP");
+ conf->child_up = _gf_true;
+
+ this->notify(this, GF_EVENT_CHILD_UP, NULL);
+out:
+ return 0;
+}
+static int
+client_cbk_child_down(struct rpc_clnt *rpc, void *mydata, void *data)
+{
+ clnt_conf_t *conf = NULL;
+ xlator_t *this = THIS;
+
+ GF_VALIDATE_OR_GOTO("client", this, out);
+ conf = this->private;
+ GF_VALIDATE_OR_GOTO(this->name, conf, out);
+
+ gf_msg_debug(this->name, 0, "Received CHILD_DOWN");
+ conf->child_up = _gf_false;
+
+ this->notify(this, GF_EVENT_CHILD_DOWN, NULL);
+out:
+ return 0;
+}
+
+static int
+client_cbk_inodelk_contention(struct rpc_clnt *rpc, void *mydata, void *data)
+{
+ int ret = -1