/* Given an inode and mask determine if dnotify would be interested in sending userspace notification for that pair.  */
static bool dnotify_should_send_event(struct fsnotify_group *group, struct inode *inode, __u32 mask)
/* Given an inode and mask determine if dnotify would be interested in sending userspace notification for that pair.  */
static bool dnotify_should_send_event(struct fsnotify_group *group, struct inode *inode, __u32 mask)
{
	struct fsnotify_mark_entry *entry;
	bool send;
	if (!S_ISDIR(inode->i_mode))
		return false;
	spin_lock(&inode->i_lock);
	entry = fsnotify_find_mark_entry(group, inode);
	spin_unlock(&inode->i_lock);
	if (!entry)
		return false;
	mask = (mask & ~FS_EVENT_ON_CHILD);
	send = (mask & entry->mask);
	fsnotify_put_mark(entry);
	return send;
}