[PATCH =-v3 17/21] fanotify: add option to clear all fastpaths

From: Eric Paris
Date: Wed Nov 12 2008 - 11:15:28 EST


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@xxxxxxxxxx>
---

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;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/