From ee1472336c3e0747eef53b826985b51696d697ae Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 6 Feb 2013 07:04:10 +0530 Subject: libglusterfs: Maintain open-fd-count in inode. Change-Id: I643d02959f92e40f68a53baf165753ed20f8b3e0 BUG: 908146 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4468 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/fd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libglusterfs/src/fd.c') diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c index 0c3a52621..2f4afc5e8 100644 --- a/libglusterfs/src/fd.c +++ b/libglusterfs/src/fd.c @@ -513,6 +513,11 @@ fd_destroy (fd_t *fd) LOCK_DESTROY (&fd->lock); GF_FREE (fd->_ctx); + LOCK (&fd->inode->lock); + { + fd->inode->fd_count--; + } + UNLOCK (&fd->inode->lock); inode_unref (fd->inode); fd->inode = (inode_t *)0xaaaaaaaa; fd_lk_ctx_unref (fd->lk_ctx); @@ -552,6 +557,7 @@ __fd_bind (fd_t *fd) { list_del_init (&fd->inode_list); list_add (&fd->inode_list, &fd->inode->fd_list); + fd->inode->fd_count++; return fd; } -- cgit