summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/dnotify.h46
-rw-r--r--include/linux/fs.h8
2 files changed, 48 insertions, 6 deletions
diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h
index 5cffeedac412..f134a01975c7 100644
--- a/include/linux/dnotify.h
+++ b/include/linux/dnotify.h
@@ -1,3 +1,5 @@
+#ifndef _LINUX_DNOTIFY_H
+#define _LINUX_DNOTIFY_H
/*
* Directory notification for Linux
*
@@ -8,20 +10,54 @@
struct dnotify_struct {
struct dnotify_struct * dn_next;
- unsigned long dn_mask; /* Events to be notified
- see linux/fcntl.h */
+ unsigned long dn_mask;
int dn_fd;
struct file * dn_filp;
fl_owner_t dn_owner;
};
+#ifdef __KERNEL__
+
+#include <linux/config.h>
+
+#ifdef CONFIG_DNOTIFY
+
extern void __inode_dir_notify(struct inode *, unsigned long);
-extern void dnotify_flush(struct file *filp, fl_owner_t id);
+extern void dnotify_flush(struct file *, fl_owner_t);
extern int fcntl_dirnotify(int, struct file *, unsigned long);
-void dnotify_parent(struct dentry *dentry, unsigned long event);
+extern void dnotify_parent(struct dentry *, unsigned long);
static inline void inode_dir_notify(struct inode *inode, unsigned long event)
{
- if ((inode)->i_dnotify_mask & (event))
+ if (inode->i_dnotify_mask & (event))
__inode_dir_notify(inode, event);
}
+
+#else
+
+static inline void __inode_dir_notify(struct inode *inode, unsigned long event)
+{
+}
+
+static inline void dnotify_flush(struct file *filp, fl_owner_t id)
+{
+}
+
+static inline int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
+{
+ return -EINVAL;
+}
+
+static inline void dnotify_parent(struct dentry *dentry, unsigned long event)
+{
+}
+
+static inline void inode_dir_notify(struct inode *inode, unsigned long event)
+{
+}
+
+#endif /* CONFIG_DNOTIFY */
+
+#endif /* __KERNEL __ */
+
+#endif /* _LINUX_DNOTIFY_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 634dd30f9b37..7bbe6e3838dc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -61,7 +61,11 @@ struct inodes_stat_t {
};
extern struct inodes_stat_t inodes_stat;
-extern int leases_enable, dir_notify_enable, lease_break_time;
+extern int leases_enable, lease_break_time;
+
+#ifdef CONFIG_DNOTIFY
+extern int dir_notify_enable;
+#endif
#define NR_FILE 8192 /* this can well be larger on a larger system */
#define NR_RESERVED_FILES 10 /* reserved for root */
@@ -464,8 +468,10 @@ struct inode {
__u32 i_generation;
+#ifdef CONFIG_DNOTIFY
unsigned long i_dnotify_mask; /* Directory notify events */
struct dnotify_struct *i_dnotify; /* for directory notifications */
+#endif
unsigned long i_state;
unsigned long dirtied_when; /* jiffies of first dirtying */