patch-2.4.0-test4 linux/include/linux/poll.h

Next file: linux/include/linux/rtc.h
Previous file: linux/include/linux/pci_ids.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/include/linux/poll.h linux/include/linux/poll.h
@@ -17,13 +17,18 @@
 	wait_queue_head_t * wait_address;
 };
 
-typedef struct poll_table_struct {
-	struct poll_table_struct * next;
+struct poll_table_page {
+	struct poll_table_page * next;
 	unsigned int nr;
 	struct poll_table_entry * entry;
+};
+
+typedef struct poll_table_struct {
+	int error;
+	struct poll_table_page * table;
 } poll_table;
 
-#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (poll_table)) / sizeof (struct poll_table_entry))
+#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (struct poll_table_page)) / sizeof (struct poll_table_entry))
 
 extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
 
@@ -33,22 +38,13 @@
 		__pollwait(filp, wait_address, p);
 }
 
-/*
- * For the kernel fd_set we use a fixed set-size for allocation purposes.
- * This set-size doesn't necessarily bear any relation to the size the user
- * uses, but should preferably obviously be larger than any possible user
- * size (NR_OPEN bits).
- *
- * We need 6 bitmaps (in/out/ex for both incoming and outgoing), and we
- * allocate one page for all the bitmaps. Thus we have 8*PAGE_SIZE bits,
- * to be divided by 6. And we'd better make sure we round to a full
- * long-word (in fact, we'll round to 64 bytes).
- */
-
-
-#define KFDS_64BLOCK ((PAGE_SIZE/(6*64))*64)
-#define KFDS_NR (KFDS_64BLOCK*8 > NR_OPEN ? NR_OPEN : KFDS_64BLOCK*8)
-typedef unsigned long kernel_fd_set[KFDS_NR/__NFDBITS];
+static inline void poll_initwait(poll_table* pt)
+{
+	pt->error = 0;
+	pt->table = NULL;
+}
+extern void poll_freewait(poll_table* pt);
+
 
 /*
  * Scaleable version of the fd_set.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)