mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-15 23:37:56 +07:00
dnotify: use the mark in handler functions
dnotify now gets a mark in the should_send_event and handle_event functions. Rather than look up the mark themselves dnotify should just use the mark it was handed. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
7f6b6117e1
commit
c496313fcc
@ -86,7 +86,6 @@ static int dnotify_handle_event(struct fsnotify_group *group,
|
|||||||
struct fsnotify_mark *mark,
|
struct fsnotify_mark *mark,
|
||||||
struct fsnotify_event *event)
|
struct fsnotify_event *event)
|
||||||
{
|
{
|
||||||
struct fsnotify_mark *fsn_mark = NULL;
|
|
||||||
struct dnotify_mark *dn_mark;
|
struct dnotify_mark *dn_mark;
|
||||||
struct inode *to_tell;
|
struct inode *to_tell;
|
||||||
struct dnotify_struct *dn;
|
struct dnotify_struct *dn;
|
||||||
@ -96,12 +95,9 @@ static int dnotify_handle_event(struct fsnotify_group *group,
|
|||||||
|
|
||||||
to_tell = event->to_tell;
|
to_tell = event->to_tell;
|
||||||
|
|
||||||
fsn_mark = fsnotify_find_inode_mark(group, to_tell);
|
dn_mark = container_of(mark, struct dnotify_mark, fsn_mark);
|
||||||
if (unlikely(!fsn_mark))
|
|
||||||
return 0;
|
|
||||||
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
|
|
||||||
|
|
||||||
spin_lock(&fsn_mark->lock);
|
spin_lock(&mark->lock);
|
||||||
prev = &dn_mark->dn;
|
prev = &dn_mark->dn;
|
||||||
while ((dn = *prev) != NULL) {
|
while ((dn = *prev) != NULL) {
|
||||||
if ((dn->dn_mask & test_mask) == 0) {
|
if ((dn->dn_mask & test_mask) == 0) {
|
||||||
@ -115,12 +111,11 @@ static int dnotify_handle_event(struct fsnotify_group *group,
|
|||||||
else {
|
else {
|
||||||
*prev = dn->dn_next;
|
*prev = dn->dn_next;
|
||||||
kmem_cache_free(dnotify_struct_cache, dn);
|
kmem_cache_free(dnotify_struct_cache, dn);
|
||||||
dnotify_recalc_inode_mask(fsn_mark);
|
dnotify_recalc_inode_mask(mark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock(&fsn_mark->lock);
|
spin_unlock(&mark->lock);
|
||||||
fsnotify_put_mark(fsn_mark);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -134,7 +129,6 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
|
|||||||
struct fsnotify_mark *mark, __u32 mask,
|
struct fsnotify_mark *mark, __u32 mask,
|
||||||
void *data, int data_type)
|
void *data, int data_type)
|
||||||
{
|
{
|
||||||
struct fsnotify_mark *fsn_mark;
|
|
||||||
bool send;
|
bool send;
|
||||||
|
|
||||||
/* !dir_notify_enable should never get here, don't waste time checking
|
/* !dir_notify_enable should never get here, don't waste time checking
|
||||||
@ -145,14 +139,8 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
|
|||||||
if (!S_ISDIR(inode->i_mode))
|
if (!S_ISDIR(inode->i_mode))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
fsn_mark = fsnotify_find_inode_mark(group, inode);
|
|
||||||
if (!fsn_mark)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
mask = (mask & ~FS_EVENT_ON_CHILD);
|
mask = (mask & ~FS_EVENT_ON_CHILD);
|
||||||
send = (mask & fsn_mark->mask);
|
send = (mask & mark->mask);
|
||||||
|
|
||||||
fsnotify_put_mark(fsn_mark); /* matches fsnotify_find_inode_mark */
|
|
||||||
|
|
||||||
return send;
|
return send;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user