aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/inotify.h
diff options
context:
space:
mode:
authorAmy Griffis <amy.griffis@hp.com>2006-06-01 16:11:03 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-06-20 05:25:18 -0400
commita9dc971d3fdb857a2bcd6d53238125a2cd31d5f4 (patch)
tree02e8816f583b5ca40da5789ab9e8d7de9b3ed598 /include/linux/inotify.h
parent7c29772288b7026504cfe75bfd90d40fbd1574bf (diff)
[PATCH] inotify (3/5): add interfaces to kernel API
Add inotify_init_watch() so caller can use inotify_watch refcounts before calling inotify_add_watch(). Add inotify_find_watch() to find an existing watch for an (ih,inode) pair. This is similar to inotify_find_update_watch(), but does not update the watch's mask if one is found. Add inotify_rm_watch() to remove a watch via the watch pointer instead of the watch descriptor. Signed-off-by: Amy Griffis <amy.griffis@hp.com> Acked-by: Robert Love <rml@novell.com> Acked-by: John McCutchan <john@johnmccutchan.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/inotify.h')
-rw-r--r--include/linux/inotify.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index e7899e7d83ad..e7e7fb7fc778 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -112,11 +112,15 @@ extern u32 inotify_get_cookie(void);
112/* Kernel Consumer API */ 112/* Kernel Consumer API */
113 113
114extern struct inotify_handle *inotify_init(const struct inotify_operations *); 114extern struct inotify_handle *inotify_init(const struct inotify_operations *);
115extern void inotify_init_watch(struct inotify_watch *);
115extern void inotify_destroy(struct inotify_handle *); 116extern void inotify_destroy(struct inotify_handle *);
117extern __s32 inotify_find_watch(struct inotify_handle *, struct inode *,
118 struct inotify_watch **);
116extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *, 119extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *,
117 u32); 120 u32);
118extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, 121extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *,
119 struct inode *, __u32); 122 struct inode *, __u32);
123extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *);
120extern int inotify_rm_wd(struct inotify_handle *, __u32); 124extern int inotify_rm_wd(struct inotify_handle *, __u32);
121extern void get_inotify_watch(struct inotify_watch *); 125extern void get_inotify_watch(struct inotify_watch *);
122extern void put_inotify_watch(struct inotify_watch *); 126extern void put_inotify_watch(struct inotify_watch *);
@@ -163,10 +167,20 @@ static inline struct inotify_handle *inotify_init(const struct inotify_operation
163 return ERR_PTR(-EOPNOTSUPP); 167 return ERR_PTR(-EOPNOTSUPP);
164} 168}
165 169
170static inline void inotify_init_watch(struct inotify_watch *watch)
171{
172}
173
166static inline void inotify_destroy(struct inotify_handle *ih) 174static inline void inotify_destroy(struct inotify_handle *ih)
167{ 175{
168} 176}
169 177
178static inline __s32 inotify_find_watch(struct inotify_handle *ih, struct inode *inode,
179 struct inotify_watch **watchp)
180{
181 return -EOPNOTSUPP;
182}
183
170static inline __s32 inotify_find_update_watch(struct inotify_handle *ih, 184static inline __s32 inotify_find_update_watch(struct inotify_handle *ih,
171 struct inode *inode, u32 mask) 185 struct inode *inode, u32 mask)
172{ 186{
@@ -180,6 +194,12 @@ static inline __s32 inotify_add_watch(struct inotify_handle *ih,
180 return -EOPNOTSUPP; 194 return -EOPNOTSUPP;
181} 195}
182 196
197static inline int inotify_rm_watch(struct inotify_handle *ih,
198 struct inotify_watch *watch)
199{
200 return -EOPNOTSUPP;
201}
202
183static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd) 203static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd)
184{ 204{
185 return -EOPNOTSUPP; 205 return -EOPNOTSUPP;