diff options
author | Amy Griffis <amy.griffis@hp.com> | 2006-06-01 16:11:03 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-06-20 05:25:18 -0400 |
commit | a9dc971d3fdb857a2bcd6d53238125a2cd31d5f4 (patch) | |
tree | 02e8816f583b5ca40da5789ab9e8d7de9b3ed598 /include/linux/inotify.h | |
parent | 7c29772288b7026504cfe75bfd90d40fbd1574bf (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.h | 20 |
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 | ||
114 | extern struct inotify_handle *inotify_init(const struct inotify_operations *); | 114 | extern struct inotify_handle *inotify_init(const struct inotify_operations *); |
115 | extern void inotify_init_watch(struct inotify_watch *); | ||
115 | extern void inotify_destroy(struct inotify_handle *); | 116 | extern void inotify_destroy(struct inotify_handle *); |
117 | extern __s32 inotify_find_watch(struct inotify_handle *, struct inode *, | ||
118 | struct inotify_watch **); | ||
116 | extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *, | 119 | extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *, |
117 | u32); | 120 | u32); |
118 | extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, | 121 | extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, |
119 | struct inode *, __u32); | 122 | struct inode *, __u32); |
123 | extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *); | ||
120 | extern int inotify_rm_wd(struct inotify_handle *, __u32); | 124 | extern int inotify_rm_wd(struct inotify_handle *, __u32); |
121 | extern void get_inotify_watch(struct inotify_watch *); | 125 | extern void get_inotify_watch(struct inotify_watch *); |
122 | extern void put_inotify_watch(struct inotify_watch *); | 126 | extern 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 | ||
170 | static inline void inotify_init_watch(struct inotify_watch *watch) | ||
171 | { | ||
172 | } | ||
173 | |||
166 | static inline void inotify_destroy(struct inotify_handle *ih) | 174 | static inline void inotify_destroy(struct inotify_handle *ih) |
167 | { | 175 | { |
168 | } | 176 | } |
169 | 177 | ||
178 | static inline __s32 inotify_find_watch(struct inotify_handle *ih, struct inode *inode, | ||
179 | struct inotify_watch **watchp) | ||
180 | { | ||
181 | return -EOPNOTSUPP; | ||
182 | } | ||
183 | |||
170 | static inline __s32 inotify_find_update_watch(struct inotify_handle *ih, | 184 | static 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 | ||
197 | static inline int inotify_rm_watch(struct inotify_handle *ih, | ||
198 | struct inotify_watch *watch) | ||
199 | { | ||
200 | return -EOPNOTSUPP; | ||
201 | } | ||
202 | |||
183 | static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd) | 203 | static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd) |
184 | { | 204 | { |
185 | return -EOPNOTSUPP; | 205 | return -EOPNOTSUPP; |