Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207719
b: refs/heads/master
c: 700307a
h: refs/heads/master
i:
  207717: 81b5f74
  207715: ae966f7
  207711: 6a13f05
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent b02b5a2 commit e205545
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a4c6e9961fcb9da54648d98978d33c6fdcb7bb45
refs/heads/master: 700307a29ad61090dcf1d45f8f4a135f5e9211ae
2 changes: 1 addition & 1 deletion trunk/fs/notify/inode_mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
struct hlist_node *node, *last = NULL;
int ret = 0;

mark->flags = FSNOTIFY_MARK_FLAG_INODE;
mark->flags |= FSNOTIFY_MARK_FLAG_INODE;

assert_spin_locked(&mark->lock);
assert_spin_locked(&group->mark_lock);
Expand Down
11 changes: 7 additions & 4 deletions trunk/fs/notify/mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)

group = mark->group;

/* if !group something else already marked this to die */
if (!group) {
/* something else already called this function on this mark */
if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) {
spin_unlock(&mark->lock);
return;
}

mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE;

/* 1 from caller and 1 for being on i_list/g_list */
BUG_ON(atomic_read(&mark->refcnt) < 2);

Expand All @@ -141,7 +143,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
BUG();

list_del_init(&mark->g_list);
mark->group = NULL;

fsnotify_put_mark(mark); /* for i_list and g_list */

Expand Down Expand Up @@ -229,6 +230,8 @@ int fsnotify_add_mark(struct fsnotify_mark *mark,
spin_lock(&mark->lock);
spin_lock(&group->mark_lock);

mark->flags |= FSNOTIFY_MARK_FLAG_ALIVE;

mark->group = group;
list_add(&mark->g_list, &group->marks_list);
atomic_inc(&group->num_marks);
Expand Down Expand Up @@ -258,7 +261,7 @@ int fsnotify_add_mark(struct fsnotify_mark *mark,

return ret;
err:
mark->group = NULL;
mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE;
list_del_init(&mark->g_list);
atomic_dec(&group->num_marks);
fsnotify_put_mark(mark);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/notify/vfsmount_mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark,
struct hlist_node *node, *last = NULL;
int ret = 0;

mark->flags = FSNOTIFY_MARK_FLAG_VFSMOUNT;
mark->flags |= FSNOTIFY_MARK_FLAG_VFSMOUNT;

assert_spin_locked(&mark->lock);
assert_spin_locked(&group->mark_lock);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fsnotify_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ struct fsnotify_mark {
#define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02
#define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04
#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08
#define FSNOTIFY_MARK_FLAG_ALIVE 0x10
unsigned int flags; /* vfsmount or inode mark? */
void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */
};
Expand Down

0 comments on commit e205545

Please sign in to comment.