summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/fd.c2
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--libglusterfs/src/inode.c2
-rw-r--r--libglusterfs/src/inode.h1
4 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index c6b1a4de611..d31b106aa8b 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -540,6 +540,7 @@ fd_unref (fd_t *fd)
if (refcount == 0) {
if (!list_empty (&fd->inode_list)) {
list_del_init (&fd->inode_list);
+ fd->inode->active_fd_count--;
bound = _gf_true;
}
}
@@ -561,6 +562,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++;
+ fd->inode->active_fd_count++;
return fd;
}
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 250d8e69a4f..28666de3da4 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -181,6 +181,7 @@
#define GLUSTERFS_WRITE_IS_APPEND "glusterfs.write-is-append"
#define GLUSTERFS_WRITE_UPDATE_ATOMIC "glusterfs.write-update-atomic"
#define GLUSTERFS_OPEN_FD_COUNT "glusterfs.open-fd-count"
+#define GLUSTERFS_ACTIVE_FD_COUNT "glusterfs.open-active-fd-count"
#define GLUSTERFS_INODELK_COUNT "glusterfs.inodelk-count"
#define GLUSTERFS_ENTRYLK_COUNT "glusterfs.entrylk-count"
#define GLUSTERFS_POSIXLK_COUNT "glusterfs.posixlk-count"
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index 1c8d1badf4a..2100ea3cad2 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -2343,6 +2343,8 @@ inode_dump (inode_t *inode, char *prefix)
gf_proc_dump_write("gfid", "%s", uuid_utoa (inode->gfid));
gf_proc_dump_write("nlookup", "%ld", inode->nlookup);
gf_proc_dump_write("fd-count", "%u", inode->fd_count);
+ gf_proc_dump_write("active-fd-count", "%u",
+ inode->active_fd_count);
gf_proc_dump_write("ref", "%u", inode->ref);
gf_proc_dump_write("ia_type", "%d", inode->ia_type);
if (inode->_ctx) {
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h
index a1b238041b4..f77778ff3ad 100644
--- a/libglusterfs/src/inode.h
+++ b/libglusterfs/src/inode.h
@@ -92,6 +92,7 @@ struct _inode {
gf_lock_t lock;
uint64_t nlookup;
uint32_t fd_count; /* Open fd count */
+ uint32_t active_fd_count; /* Active open fd count */
uint32_t ref; /* reference count on this inode */
ia_type_t ia_type; /* what kind of file */
struct list_head fd_list; /* list of open files on this inode */