lkml.org 
[lkml]   [2008]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH =-v3 17/21] fanotify: add option to clear all fastpaths
Date
fanotify users because of a change in decision policy may need to clear all
fastpath entries. This simply adds a new setsockopt call which will do
exactly that.

Signed-off-by: Eric Paris <eparis@redhat.com>
---

include/linux/fanotify.h | 1 +
net/fanotify/af_fanotify.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index 14ad6f9..b7ab01f 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -89,6 +89,7 @@ struct fanotify_so_access {
/* fanotify setsockopt optvals */
#define FANOTIFY_SET_FASTPATH 1
#define FANOTIFY_SEND_RESPONSE 2
+#define FANOTIFY_CLEAR_ALL_FASTPATH 3

#ifdef __KERNEL__

diff --git a/net/fanotify/af_fanotify.c b/net/fanotify/af_fanotify.c
index eef7e2a..7c98a22 100644
--- a/net/fanotify/af_fanotify.c
+++ b/net/fanotify/af_fanotify.c
@@ -192,6 +192,9 @@ static int fan_setsockopt(struct socket *sock, int level, int optname, char __us
return ret;
ret = fanotify_process_access_response(group, data.access.cookie, data.access.response);
break;
+ case FANOTIFY_CLEAR_ALL_FASTPATH:
+ fanotify_fastpath_clear_group(group);
+ break;
default:
return -ENOPROTOOPT;
}


\
 
 \ /
  Last update: 2008-11-12 17:19    [W:0.282 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site