]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/fsnotify_backend.h
fsnotify: new fsnotify hooks and events types for access decisions
[net-next-2.6.git] / include / linux / fsnotify_backend.h
index afc69019297220bc3eecb683064fcadfc4f27afa..c34728e7d8cb9cb5ef13f6518f441aa056be72a2 100644 (file)
@@ -41,6 +41,9 @@
 #define FS_Q_OVERFLOW          0x00004000      /* Event queued overflowed */
 #define FS_IN_IGNORED          0x00008000      /* last inotify event here */
 
+#define FS_OPEN_PERM           0x00010000      /* open event in an permission hook */
+#define FS_ACCESS_PERM         0x00020000      /* access event in a permissions hook */
+
 #define FS_IN_ISDIR            0x40000000      /* event occurred against dir */
 #define FS_IN_ONESHOT          0x80000000      /* only send event once */
 
@@ -220,7 +223,7 @@ struct fsnotify_event {
        __u32 mask;             /* the type of access, bitwise OR for FS_* event types */
 
        u32 sync_cookie;        /* used to corrolate events, namely inotify mv events */
-       char *file_name;
+       const unsigned char *file_name;
        size_t name_len;
        struct pid *tgid;
 
@@ -282,8 +285,8 @@ struct fsnotify_mark {
 /* called from the vfs helpers */
 
 /* main fsnotify call to send events */
-extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
-                    const char *name, u32 cookie);
+extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
+                   const unsigned char *name, u32 cookie);
 extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask);
 extern void __fsnotify_inode_delete(struct inode *inode);
 extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt);
@@ -402,7 +405,8 @@ extern void fsnotify_unmount_inodes(struct list_head *list);
 
 /* put here because inotify does some weird stuff when destroying watches */
 extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
-                                                   void *data, int data_is, const char *name,
+                                                   void *data, int data_is,
+                                                   const unsigned char *name,
                                                    u32 cookie, gfp_t gfp);
 
 /* fanotify likes to change events after they are on lists... */
@@ -412,9 +416,11 @@ extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder,
 
 #else
 
-static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
-                           const char *name, u32 cookie)
-{}
+static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
+                          const unsigned char *name, u32 cookie)
+{
+       return 0;
+}
 
 static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
 {}