diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-06-15 13:05:52 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-30 14:36:27 -0700 |
commit | c1f2287c58e7101104756ac0ab416d989cc6b754 (patch) | |
tree | be87e73002200510299d0b01ba9d1177dc05a9ae /xlators/protocol/client/src/client-protocol.h | |
parent | abfd8436df46ca46de9766d17445e2a0cc1da590 (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.h | 14 |
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 50fa5e97b..86107f9bc 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; |