From 0cd5b88553acf0611474dbaf8e43770eed268060 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 16 Jan 2006 22:14:38 -0800 Subject: [PATCH] fuse: add number of waiting requests attribute This patch adds the 'waiting' attribute which indicates how many filesystem requests are currently waiting to be completed. A non-zero value without any filesystem activity indicates a hung or deadlocked filesystem. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/fuse/inode.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fs/fuse/inode.c') diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 514b700c863d..182235923cdd 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -555,7 +555,16 @@ static struct file_system_type fuse_fs_type = { .kill_sb = kill_anon_super, }; +static ssize_t fuse_conn_waiting_show(struct fuse_conn *fc, char *page) +{ + return sprintf(page, "%i\n", atomic_read(&fc->num_waiting)); +} + +static struct fuse_conn_attr fuse_conn_waiting = + __ATTR(waiting, 0400, fuse_conn_waiting_show, NULL); + static struct attribute *fuse_conn_attrs[] = { + &fuse_conn_waiting.attr, NULL, }; -- cgit v1.2.3