summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-protocol.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-06-15 13:05:52 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-15 23:44:37 -0700
commitbb4e14b213a39e9d403be9790ef0a75388496dee (patch)
treee53e186c68d25f22a121d00d7a8e8bfa9d73520c /xlators/protocol/client/src/client-protocol.h
parentefcce990960fb91d422630fc7b310b216a500fed (diff)
client: Replace saved_fds dict with list
Thhie change removes a huge inefficiency in file open path where every open resulted in dictionary operations in order to let the client maintain a list of fd_t's being used over a particular client context. Resolves: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=16 Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/protocol/client/src/client-protocol.h')
-rw-r--r--xlators/protocol/client/src/client-protocol.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/xlators/protocol/client/src/client-protocol.h b/xlators/protocol/client/src/client-protocol.h
index 1cbb22ef1df..24769e8e420 100644
--- a/xlators/protocol/client/src/client-protocol.h
+++ b/xlators/protocol/client/src/client-protocol.h
@@ -65,6 +65,18 @@ typedef struct client_connection client_connection_t;
#include "transport.h"
#include "protocol.h"
+typedef struct _client_fd_ctx {
+ int remote_fd;
+ struct list_head sfd_pos; /* Stores the reference to this
+ fd's position in the saved_fds list.
+ */
+ fd_t *fd; /* Reverse reference to the fd itself.
+ This is needed to delete this fdctx
+ from the fd's context in
+ protocol_client_mark_fd_bad.
+ */
+} client_fd_ctx_t;
+
struct _client_conf {
transport_t *transport[CHANNEL_MAX];
@@ -76,7 +88,7 @@ struct _client_conf {
uint32_t frames_in_transit;
gf_lock_t lock;
} forget;
- dict_t *saved_fds;
+ struct list_head saved_fds;
struct timeval last_sent;
struct timeval last_received;
pthread_mutex_t mutex;