aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/fanotify
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-17 21:24:34 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:59:01 -0400
commitcb2d429faf2cae62d3c51e28099a181d5fe8c244 (patch)
tree401bc8d85e7228f868775269e6d97c3150f9a3a7 /fs/notify/fanotify
parent4d92604cc90aa18bbbe0f6e23b7a9fdb612836d3 (diff)
fsnotify: add group priorities
This introduces an ordering to fsnotify groups. With purely asynchronous notification based "things" implementing fsnotify (inotify, dnotify) ordering isn't particularly important. But if people want to use fsnotify for the basis of sycronous notification or blocking notification ordering becomes important. eg. A Hierarchical Storage Management listener would need to get its event before an AV scanner could get its event (since the HSM would need to bring the data in for the AV scanner to scan.) Typically asynchronous notification would want to run after the AV scanner made any relevant access decisions so as to not send notification about an event that was denied. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/fanotify')
-rw-r--r--fs/notify/fanotify/fanotify_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 9fe760baf69f..84d3e2047de3 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -463,8 +463,6 @@ SYSCALL_DEFINE3(fanotify_init, unsigned int, flags, unsigned int, event_f_flags,
463 463
464 if (event_f_flags) 464 if (event_f_flags)
465 return -EINVAL; 465 return -EINVAL;
466 if (priority)
467 return -EINVAL;
468 466
469 if (!capable(CAP_SYS_ADMIN)) 467 if (!capable(CAP_SYS_ADMIN))
470 return -EACCES; 468 return -EACCES;
@@ -483,6 +481,8 @@ SYSCALL_DEFINE3(fanotify_init, unsigned int, flags, unsigned int, event_f_flags,
483 if (IS_ERR(group)) 481 if (IS_ERR(group))
484 return PTR_ERR(group); 482 return PTR_ERR(group);
485 483
484 group->priority = priority;
485
486 fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags); 486 fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags);
487 if (fd < 0) 487 if (fd < 0)
488 goto out_put_group; 488 goto out_put_group;