summaryrefslogtreecommitdiff
path: root/fs/notify/group.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2011-10-14 21:43:39 (GMT)
committerEric Paris <eparis@redhat.com>2012-12-11 18:44:36 (GMT)
commit0a6b6bd5919a65030b557ec8fe81f6fb3e93744a (patch)
tree940e38b5cc9d7fdb5804748842b555af554ed32f /fs/notify/group.c
parent6960b0d909cde5bdff49e4e5c1250edd10be7ebd (diff)
downloadlinux-0a6b6bd5919a65030b557ec8fe81f6fb3e93744a.tar.xz
fsnotify: make fasync generic for both inotify and fanotify
inotify is supposed to support async signal notification when information is available on the inotify fd. This patch moves that support to generic fsnotify functions so it can be used by all notification mechanisms. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/group.c')
-rw-r--r--fs/notify/group.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/notify/group.c b/fs/notify/group.c
index 1f73057..bd2625b 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -102,3 +102,10 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
return group;
}
+
+int fsnotify_fasync(int fd, struct file *file, int on)
+{
+ struct fsnotify_group *group = file->private_data;
+
+ return fasync_helper(fd, file, on, &group->fsn_fa) >= 0 ? 0 : -EIO;
+}