diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-11 07:54:22 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-17 01:28:29 -0700 |
commit | 953d7146f117f19ff6c92fafaffdc79e4a14d76e (patch) | |
tree | 0cf126cb155286ff4c5c9f7892e13d7ffb3d4609 | |
parent | 8ad41d36bfc683424133407ff26559654c7ba316 (diff) |
performance/quick-read: access glusterfs_ctx from xlator instead of using glusterfs_get_ctx
- since glusterfs_get_ctx gets the global context pointer, there can be
problems in a multithreaded application running on libglusterfsclient
doing multiple glusterfs_inits. Hence use context specific to the
current xlator tree stored in each xlator object.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 240 (segmentation fault in qr_readv)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=240
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 1 | ||||
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 8b162e25435..8235e573e17 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -1267,7 +1267,6 @@ glusterfs_init (glusterfs_init_params_t *init_ctx, uint32_t fakefsid) return NULL; } - set_global_ctx_ptr (&ctx->gf_ctx); ctx->gf_ctx.process_uuid = zr_build_process_uuid (); if (xlator_graph_init (graph) == -1) { diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index ac645dd996d..9e036eb1557 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -755,7 +755,7 @@ qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } } - ctx = get_global_ctx_ptr (); + ctx = this->ctx; count = (op_ret / ctx->page_size) + 1; vector = CALLOC (count, sizeof (*vector)); |