~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/notify/inotify/inotify.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #include <linux/fsnotify_backend.h>
  3 #include <linux/inotify.h>
  4 #include <linux/slab.h> /* struct kmem_cache */
  5 
  6 struct inotify_event_info {
  7         struct fsnotify_event fse;
  8         u32 mask;
  9         int wd;
 10         u32 sync_cookie;
 11         int name_len;
 12         char name[];
 13 };
 14 
 15 struct inotify_inode_mark {
 16         struct fsnotify_mark fsn_mark;
 17         int wd;
 18 };
 19 
 20 static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
 21 {
 22         return container_of(fse, struct inotify_event_info, fse);
 23 }
 24 
 25 /*
 26  * INOTIFY_USER_FLAGS represents all of the mask bits that we expose to
 27  * userspace.  There is at least one bit (FS_EVENT_ON_CHILD) which is
 28  * used only internally to the kernel.
 29  */
 30 #define INOTIFY_USER_MASK (IN_ALL_EVENTS)
 31 
 32 static inline __u32 inotify_mark_user_mask(struct fsnotify_mark *fsn_mark)
 33 {
 34         __u32 mask = fsn_mark->mask & INOTIFY_USER_MASK;
 35 
 36         if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_EXCL_UNLINK)
 37                 mask |= IN_EXCL_UNLINK;
 38         if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_IN_ONESHOT)
 39                 mask |= IN_ONESHOT;
 40 
 41         return mask;
 42 }
 43 
 44 extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
 45                                            struct fsnotify_group *group);
 46 extern int inotify_handle_inode_event(struct fsnotify_mark *inode_mark,
 47                                       u32 mask, struct inode *inode,
 48                                       struct inode *dir,
 49                                       const struct qstr *name, u32 cookie);
 50 
 51 extern const struct fsnotify_ops inotify_fsnotify_ops;
 52 extern struct kmem_cache *inotify_inode_mark_cachep;
 53 
 54 #ifdef CONFIG_INOTIFY_USER
 55 static inline void dec_inotify_instances(struct ucounts *ucounts)
 56 {
 57         dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
 58 }
 59 
 60 static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
 61 {
 62         return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
 63 }
 64 
 65 static inline void dec_inotify_watches(struct ucounts *ucounts)
 66 {
 67         dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
 68 }
 69 #endif
 70 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php