diff options
| author | Eric Paris <eparis@redhat.com> | 2009-12-17 21:24:24 -0500 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:54 -0400 |
| commit | ef5e2b785fb3216269e6d0656d38ec286b98dbe5 (patch) | |
| tree | 6adf1f49a217c77e9ab28a5c57d1ed2c150008a8 /fs/notify | |
| parent | 000285deb99a5e0636fdd3c6a2483a5d039ee2c2 (diff) | |
dnotify: rename mark_entry to mark
nomenclature change. Used to call things 'entries' but now we just call
them 'marks.' Do those changes for dnotify.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify')
| -rw-r--r-- | fs/notify/dnotify/dnotify.c | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c index b202bc590c61..3efb8b9a572d 100644 --- a/fs/notify/dnotify/dnotify.c +++ b/fs/notify/dnotify/dnotify.c | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | int dir_notify_enable __read_mostly = 1; | 29 | int dir_notify_enable __read_mostly = 1; |
| 30 | 30 | ||
| 31 | static struct kmem_cache *dnotify_struct_cache __read_mostly; | 31 | static struct kmem_cache *dnotify_struct_cache __read_mostly; |
| 32 | static struct kmem_cache *dnotify_mark_entry_cache __read_mostly; | 32 | static struct kmem_cache *dnotify_mark_cache __read_mostly; |
| 33 | static struct fsnotify_group *dnotify_group __read_mostly; | 33 | static struct fsnotify_group *dnotify_group __read_mostly; |
| 34 | static DEFINE_MUTEX(dnotify_mark_mutex); | 34 | static DEFINE_MUTEX(dnotify_mark_mutex); |
| 35 | 35 | ||
| @@ -38,8 +38,8 @@ static DEFINE_MUTEX(dnotify_mark_mutex); | |||
| 38 | * is being watched by dnotify. If multiple userspace applications are watching | 38 | * is being watched by dnotify. If multiple userspace applications are watching |
| 39 | * the same directory with dnotify their information is chained in dn | 39 | * the same directory with dnotify their information is chained in dn |
| 40 | */ | 40 | */ |
| 41 | struct dnotify_mark_entry { | 41 | struct dnotify_mark { |
| 42 | struct fsnotify_mark fsn_entry; | 42 | struct fsnotify_mark fsn_mark; |
| 43 | struct dnotify_struct *dn; | 43 | struct dnotify_struct *dn; |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| @@ -51,27 +51,27 @@ struct dnotify_mark_entry { | |||
| 51 | * it calls the fsnotify function so it can update the set of all events relevant | 51 | * it calls the fsnotify function so it can update the set of all events relevant |
| 52 | * to this inode. | 52 | * to this inode. |
| 53 | */ | 53 | */ |
| 54 | static void dnotify_recalc_inode_mask(struct fsnotify_mark *entry) | 54 | static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark) |
| 55 | { | 55 | { |
| 56 | __u32 new_mask, old_mask; | 56 | __u32 new_mask, old_mask; |
| 57 | struct dnotify_struct *dn; | 57 | struct dnotify_struct *dn; |
| 58 | struct dnotify_mark_entry *dnentry = container_of(entry, | 58 | struct dnotify_mark *dn_mark = container_of(fsn_mark, |
| 59 | struct dnotify_mark_entry, | 59 | struct dnotify_mark, |
| 60 | fsn_entry); | 60 | fsn_mark); |
| 61 | 61 | ||
| 62 | assert_spin_locked(&entry->lock); | 62 | assert_spin_locked(&fsn_mark->lock); |
| 63 | 63 | ||
| 64 | old_mask = entry->mask; | 64 | old_mask = fsn_mark->mask; |
| 65 | new_mask = 0; | 65 | new_mask = 0; |
| 66 | for (dn = dnentry->dn; dn != NULL; dn = dn->dn_next) | 66 | for (dn = dn_mark->dn; dn != NULL; dn = dn->dn_next) |
| 67 | new_mask |= (dn->dn_mask & ~FS_DN_MULTISHOT); | 67 | new_mask |= (dn->dn_mask & ~FS_DN_MULTISHOT); |
| 68 | entry->mask = new_mask; | 68 | fsn_mark->mask = new_mask; |
| 69 | 69 | ||
| 70 | if (old_mask == new_mask) | 70 | if (old_mask == new_mask) |
| 71 | return; | 71 | return; |
| 72 | 72 | ||
| 73 | if (entry->i.inode) | 73 | if (fsn_mark->i.inode) |
| 74 | fsnotify_recalc_inode_mask(entry->i.inode); | 74 | fsnotify_recalc_inode_mask(fsn_mark->i.inode); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | /* | 77 | /* |
| @@ -85,8 +85,8 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark *entry) | |||
| 85 | static int dnotify_handle_event(struct fsnotify_group *group, | 85 | static int dnotify_handle_event(struct fsnotify_group *group, |
| 86 | struct fsnotify_event *event) | 86 | struct fsnotify_event *event) |
| 87 | { | 87 | { |
| 88 | struct fsnotify_mark *entry = NULL; | 88 | struct fsnotify_mark *fsn_mark = NULL; |
| 89 | struct dnotify_mark_entry *dnentry; | 89 | struct dnotify_mark *dn_mark; |
| 90 | struct inode *to_tell; | 90 | struct inode *to_tell; |
| 91 | struct dnotify_struct *dn; | 91 | struct dnotify_struct *dn; |
| 92 | struct dnotify_struct **prev; | 92 | struct dnotify_struct **prev; |
| @@ -96,16 +96,16 @@ static int dnotify_handle_event(struct fsnotify_group *group, | |||
| 96 | to_tell = event->to_tell; | 96 | to_tell = event->to_tell; |
| 97 | 97 | ||
| 98 | spin_lock(&to_tell->i_lock); | 98 | spin_lock(&to_tell->i_lock); |
| 99 | entry = fsnotify_find_mark(group, to_tell); | 99 | fsn_mark = fsnotify_find_mark(group, to_tell); |
| 100 | spin_unlock(&to_tell->i_lock); | 100 | spin_unlock(&to_tell->i_lock); |
| 101 | 101 | ||
| 102 | /* unlikely since we alreay passed dnotify_should_send_event() */ | 102 | /* unlikely since we alreay passed dnotify_should_send_event() */ |
| 103 | if (unlikely(!entry)) | 103 | if (unlikely(!fsn_mark)) |
| 104 | return 0; | 104 | return 0; |
| 105 | dnentry = container_of(entry, struct dnotify_mark_entry, fsn_entry); | 105 | dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark); |
| 106 | 106 | ||
| 107 | spin_lock(&entry->lock); | 107 | spin_lock(&fsn_mark->lock); |
| 108 | prev = &dnentry->dn; | 108 | prev = &dn_mark->dn; |
| 109 | while ((dn = *prev) != NULL) { | 109 | while ((dn = *prev) != NULL) { |
| 110 | if ((dn->dn_mask & test_mask) == 0) { | 110 | if ((dn->dn_mask & test_mask) == 0) { |
| 111 | prev = &dn->dn_next; | 111 | prev = &dn->dn_next; |
| @@ -118,12 +118,12 @@ static int dnotify_handle_event(struct fsnotify_group *group, | |||
| 118 | else { | 118 | else { |
| 119 | *prev = dn->dn_next; | 119 | *prev = dn->dn_next; |
| 120 | kmem_cache_free(dnotify_struct_cache, dn); | 120 | kmem_cache_free(dnotify_struct_cache, dn); |
| 121 | dnotify_recalc_inode_mask(entry); | 121 | dnotify_recalc_inode_mask(fsn_mark); |
| 122 | } | 122 | } |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | spin_unlock(&entry->lock); | 125 | spin_unlock(&fsn_mark->lock); |
| 126 | fsnotify_put_mark(entry); | 126 | fsnotify_put_mark(fsn_mark); |
| 127 | 127 | ||
| 128 | return 0; | 128 | return 0; |
| 129 | } | 129 | } |
| @@ -136,7 +136,7 @@ static bool dnotify_should_send_event(struct fsnotify_group *group, | |||
| 136 | struct inode *inode, struct vfsmount *mnt, | 136 | struct inode *inode, struct vfsmount *mnt, |
| 137 | __u32 mask, void *data, int data_type) | 137 | __u32 mask, void *data, int data_type) |
| 138 | { | 138 | { |
| 139 | struct fsnotify_mark *entry; | 139 | struct fsnotify_mark *fsn_mark; |
| 140 | bool send; | 140 | bool send; |
| 141 | 141 | ||
| 142 | /* !dir_notify_enable should never get here, don't waste time checking | 142 | /* !dir_notify_enable should never get here, don't waste time checking |
| @@ -148,30 +148,30 @@ static bool dnotify_should_send_event(struct fsnotify_group *group, | |||
| 148 | return false; | 148 | return false; |
| 149 | 149 | ||
| 150 | spin_lock(&inode->i_lock); | 150 | spin_lock(&inode->i_lock); |
| 151 | entry = fsnotify_find_mark(group, inode); | 151 | fsn_mark = fsnotify_find_mark(group, inode); |
| 152 | spin_unlock(&inode->i_lock); | 152 | spin_unlock(&inode->i_lock); |
| 153 | 153 | ||
| 154 | /* no mark means no dnotify watch */ | 154 | /* no mark means no dnotify watch */ |
| 155 | if (!entry) | 155 | if (!fsn_mark) |
| 156 | return false; | 156 | return false; |
| 157 | 157 | ||
| 158 | mask = (mask & ~FS_EVENT_ON_CHILD); | 158 | mask = (mask & ~FS_EVENT_ON_CHILD); |
| 159 | send = (mask & entry->mask); | 159 | send = (mask & fsn_mark->mask); |
| 160 | 160 | ||
| 161 | fsnotify_put_mark(entry); /* matches fsnotify_find_mark */ | 161 | fsnotify_put_mark(fsn_mark); /* matches fsnotify_find_mark */ |
| 162 | 162 | ||
| 163 | return send; | 163 | return send; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | static void dnotify_free_mark(struct fsnotify_mark *entry) | 166 | static void dnotify_free_mark(struct fsnotify_mark *fsn_mark) |
| 167 | { | 167 | { |
| 168 | struct dnotify_mark_entry *dnentry = container_of(entry, | 168 | struct dnotify_mark *dn_mark = container_of(fsn_mark, |
| 169 | struct dnotify_mark_entry, | 169 | struct dnotify_mark, |
| 170 | fsn_entry); | 170 | fsn_mark); |
| 171 | 171 | ||
