aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/lguest_user.c
diff options
context:
space:
mode:
authorDavide Libenzi <davidel@xmailserver.org>2009-06-30 14:41:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-30 21:55:58 -0400
commit133890103b9de08904f909995973e4b5c08a780e (patch)
tree0cda85a58dafafa0a197cf1a789124203f1e7a88 /drivers/lguest/lguest_user.c
parentf7c2df9b55212d5ec94169a4de11e44c683e0af4 (diff)
eventfd: revised interface and cleanups
Change the eventfd interface to de-couple the eventfd memory context, from the file pointer instance. Without such change, there is no clean way to racely free handle the POLLHUP event sent when the last instance of the file* goes away. Also, now the internal eventfd APIs are using the eventfd context instead of the file*. This patch is required by KVM's IRQfd code, which is still under development. Signed-off-by: Davide Libenzi <davidel@xmailserver.org> Cc: Gregory Haskins <ghaskins@novell.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: Avi Kivity <avi@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/lguest/lguest_user.c')
-rw-r--r--drivers/lguest/lguest_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 32e297121058..9f9a2953b383 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -50,7 +50,7 @@ static int add_eventfd(struct lguest *lg, unsigned long addr, int fd)
50 50
51 /* Now append new entry. */ 51 /* Now append new entry. */
52 new->map[new->num].addr = addr; 52 new->map[new->num].addr = addr;
53 new->map[new->num].event = eventfd_fget(fd); 53 new->map[new->num].event = eventfd_ctx_fdget(fd);
54 if (IS_ERR(new->map[new->num].event)) { 54 if (IS_ERR(new->map[new->num].event)) {
55 kfree(new); 55 kfree(new);
56 return PTR_ERR(new->map[new->num].event); 56 return PTR_ERR(new->map[new->num].event);
@@ -357,7 +357,7 @@ static int close(struct inode *inode, struct file *file)
357 357
358 /* Release any eventfds they registered. */ 358 /* Release any eventfds they registered. */
359 for (i = 0; i < lg->eventfds->num; i++) 359 for (i = 0; i < lg->eventfds->num; i++)
360 fput(lg->eventfds->map[i].event); 360 eventfd_ctx_put(lg->eventfds->map[i].event);
361 kfree(lg->eventfds); 361 kfree(lg->eventfds);
362 362
363 /* If lg->dead doesn't contain an error code it will be NULL or a 363 /* If lg->dead doesn't contain an error code it will be NULL or a