diff options
author | Eric Paris <eparis@redhat.com> | 2009-12-17 21:24:27 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:57 -0400 |
commit | 5444e2981c31d0ed7465475e451b8437084337e5 (patch) | |
tree | 66b6d84b7aab886b44a3467a139d258d9aba09df /fs/notify/dnotify | |
parent | 32c3263221bd63316815286dccacdc7abfd7f3c4 (diff) |
fsnotify: split generic and inode specific mark code
currently all marking is done by functions in inode-mark.c. Some of this
is pretty generic and should be instead done in a generic function and we
should only put the inode specific code in inode-mark.c
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/dnotify')
-rw-r--r-- | fs/notify/dnotify/dnotify.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c index cac2eb896639..69f42df9ba45 100644 --- a/fs/notify/dnotify/dnotify.c +++ b/fs/notify/dnotify/dnotify.c | |||
@@ -95,7 +95,7 @@ static int dnotify_handle_event(struct fsnotify_group *group, | |||
95 | 95 | ||
96 | to_tell = event->to_tell; | 96 | to_tell = event->to_tell; |
97 | 97 | ||
98 | fsn_mark = fsnotify_find_mark(group, to_tell); | 98 | fsn_mark = fsnotify_find_inode_mark(group, to_tell); |
99 | if (unlikely(!fsn_mark)) | 99 | if (unlikely(!fsn_mark)) |
100 | return 0; | 100 | return 0; |
101 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); | 101 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); |
@@ -143,14 +143,14 @@ static bool dnotify_should_send_event(struct fsnotify_group *group, | |||
143 | if (!S_ISDIR(inode->i_mode)) | 143 | if (!S_ISDIR(inode->i_mode)) |
144 | return false; | 144 | return false; |
145 | 145 | ||
146 | fsn_mark = fsnotify_find_mark(group, inode); | 146 | fsn_mark = fsnotify_find_inode_mark(group, inode); |
147 | if (!fsn_mark) | 147 | if (!fsn_mark) |
148 | return false; | 148 | return false; |
149 | 149 | ||
150 | mask = (mask & ~FS_EVENT_ON_CHILD); | 150 | mask = (mask & ~FS_EVENT_ON_CHILD); |
151 | send = (mask & fsn_mark->mask); | 151 | send = (mask & fsn_mark->mask); |
152 | 152 | ||
153 | fsnotify_put_mark(fsn_mark); /* matches fsnotify_find_mark */ | 153 | fsnotify_put_mark(fsn_mark); /* matches fsnotify_find_inode_mark */ |
154 | 154 | ||
155 | return send; | 155 | return send; |
156 | } | 156 | } |
@@ -193,7 +193,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id) | |||
193 | if (!S_ISDIR(inode->i_mode)) | 193 | if (!S_ISDIR(inode->i_mode)) |
194 | return; | 194 | return; |
195 | 195 | ||
196 | fsn_mark = fsnotify_find_mark(dnotify_group, inode); | 196 | fsn_mark = fsnotify_find_inode_mark(dnotify_group, inode); |
197 | if (!fsn_mark) | 197 | if (!fsn_mark) |
198 | return; | 198 | return; |
199 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); | 199 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); |
@@ -346,12 +346,12 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) | |||
346 | mutex_lock(&dnotify_mark_mutex); | 346 | mutex_lock(&dnotify_mark_mutex); |
347 | 347 | ||
348 | /* add the new_fsn_mark or find an old one. */ | 348 | /* add the new_fsn_mark or find an old one. */ |
349 | fsn_mark = fsnotify_find_mark(dnotify_group, inode); | 349 | fsn_mark = fsnotify_find_inode_mark(dnotify_group, inode); |
350 | if (fsn_mark) { | 350 | if (fsn_mark) { |
351 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); | 351 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); |
352 | spin_lock(&fsn_mark->lock); | 352 | spin_lock(&fsn_mark->lock); |
353 | } else { | 353 | } else { |
354 | fsnotify_add_mark(new_fsn_mark, dnotify_group, inode, 0); | 354 | fsnotify_add_mark(new_fsn_mark, dnotify_group, inode, NULL, 0); |
355 | spin_lock(&new_fsn_mark->lock); | 355 | spin_lock(&new_fsn_mark->lock); |
356 | fsn_mark = new_fsn_mark; | 356 | fsn_mark = new_fsn_mark; |
357 | dn_mark = new_dn_mark; | 357 | dn_mark = new_dn_mark; |