summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/fd.h
diff options
context:
space:
mode:
authorZhang Huan <zhanghuan@open-fs.com>2017-10-25 11:42:37 +0800
committerXavier Hernandez <jahernan@redhat.com>2017-11-30 12:34:25 +0000
commitaba2b775bd4bd5528fcefcceb02fd70d858ec2d5 (patch)
tree271d75e4f76cceb9b088e67784f2c0e34ae9f245 /libglusterfs/src/fd.h
parent7ae126dcd967a953a64102a96de8e0678331e548 (diff)
libglusterfs: use rwlock for fdtable
To resolve a fd from client requests, need to take a mutex lock for the fdtable to do the lookup. When a client is busy doing read and write, the mutex lock could introduce contention. Therefore, use rwlock instead of mutex to reduce the contention. Change-Id: Ic833aed738a178a7ea1abafed7eb13814989d28c BUG: 1518582 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
Diffstat (limited to 'libglusterfs/src/fd.h')
-rw-r--r--libglusterfs/src/fd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/fd.h b/libglusterfs/src/fd.h
index 31f494a7e8f..3b4acf762ae 100644
--- a/libglusterfs/src/fd.h
+++ b/libglusterfs/src/fd.h
@@ -65,7 +65,7 @@ typedef struct fd_table_entry fdentry_t;
struct _fdtable {
int refcount;
uint32_t max_fds;
- pthread_mutex_t lock;
+ pthread_rwlock_t lock;
fdentry_t *fdentries;
int first_free;
};