-
- error = ep_init(ep, hashbits);
- if (error) {
- kfree(ep);
- return error;
- }
-
- file->private_data = ep;
-
- DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_file_init() ep=%p\n",
- current, ep));
- return 0;
-}
-
-
-/*
- * Calculate the index of the hash relative to "file".
- */
-static unsigned int ep_hash_index(struct eventpoll *ep, struct file *file, int fd)
-{
- unsigned long ptr = (unsigned long) file ^ (fd << ep->hashbits);
-
- return (unsigned int) hash_ptr((void *) ptr, ep->hashbits);
-}
-
-
-/*
- * Returns the hash entry ( struct list_head * ) of the passed index.
- */
-static struct list_head *ep_hash_entry(struct eventpoll *ep, unsigned int index)
-{
-
- return (struct list_head *) (ep->hpages[index / EP_HENTRY_X_PAGE] +
- (index % EP_HENTRY_X_PAGE) * sizeof(struct list_head));
-}
-
-
-static int ep_init(struct eventpoll *ep, unsigned int hashbits)
-{
- int error;
- unsigned int i, hsize;
-