jtimeout = timeout == -1 || timeout > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ? MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000; 
jtimeout = (timeout < 0 || timeout >= EP_MAX_MSTIMEO) ? MAX_SCHEDULE_TIMEOUT : (timeout * HZ + 999) / 1000; 
static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,		   int maxevents, long timeout){	int res, eavail;	unsigned long flags;	long jtimeout;	wait_queue_t wait;	/*	 * Calculate the timeout by checking for the "infinite" value ( -1 )	 * and the overflow condition. The passed timeout is in milliseconds,	 * that why (t * HZ) / 1000.	 */	jtimeout = timeout == -1 || timeout > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ?		MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000;retry:	write_lock_irqsave(&ep->lock, flags);	res = 0;	if (list_empty(&ep->rdllist)) {		/*		 * We don't have any available event to return to the caller.		 * We need to sleep here, and we will be wake up by		 * ep_poll_callback() when events will become available.		 */		init_waitqueue_entry(&wait, current);		add_wait_queue(&ep->wq, &wait);		for (;;) {			/*			 * We don't want to sleep if the ep_poll_callback() sends us			 * a wakeup in between. That's why we set the task state			 * to TASK_INTERRUPTIBLE before doing the checks.			 */			set_current_state(TASK_INTERRUPTIBLE);			if (!list_empty(&ep->rdllist) || !jtimeout)				break;			if (signal_pending(current)) {				res = -EINTR;				break;			}			write_unlock_irqrestore(&ep->lock, flags);			jtimeout = schedule_timeout(jtimeout);			write_lock_irqsave(&ep->lock, flags);		}		remove_wait_queue(&ep->wq, &wait);		set_current_state(TASK_RUNNING);	}	/* Is it worth to try to dig for events ? */	eavail = !list_empty(&ep->rdllist);	write_unlock_irqrestore(&ep->lock, flags);	/*	 * Try to transfer events to user space. In case we get 0 events and	 * there's still timeout left over, we go trying again in search of	 * more luck.	 */	if (!res && eavail &&	    !(res = ep_events_transfer(ep, events, maxevents)) && jtimeout)		goto retry;	return res;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/e3306dd5f7eb2e699f36a4a313fca4b48b18d5e1/eventpoll.c/buggy/fs/eventpoll.c