/* Two very simple procedures, poll_wait() and poll_freewait() make all the work. poll_wait() is an inline-function defined in <linux/poll.h>, as all select/poll functions have to call it to add an entry to the poll table.  */
static void __pollwait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p)
/* Two very simple procedures, poll_wait() and poll_freewait() make all the work. poll_wait() is an inline-function defined in <linux/poll.h>, as all select/poll functions have to call it to add an entry to the poll table.  */
static void __pollwait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p)
{
	struct poll_wqueues *pwq = container_of(p, struct poll_wqueues, pt);
	struct poll_table_entry *entry = poll_get_entry(pwq);
	if (!entry)
		return;
	get_file(filp);
	entry->filp = filp;
	entry->wait_address = wait_address;
	entry->key = p->key;
	init_waitqueue_func_entry(&entry->wait, pollwake);
	entry->wait.private = pwq;
	add_wait_queue(wait_address, &entry->wait);
}