patch-2.4.0-test4 linux/fs/ncpfs/sock.c
Next file: linux/fs/nfs/inode.c
Previous file: linux/fs/jffs/jffs_fm.c
Back to the patch index
Back to the overall index
- Lines: 91
- Date:
Wed Jul 12 10:06:18 2000
- Orig file:
v2.4.0-test3/linux/fs/ncpfs/sock.c
- Orig date:
Mon Jul 10 16:47:26 2000
diff -u --recursive --new-file v2.4.0-test3/linux/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c
@@ -87,7 +87,6 @@
int result;
char *start = server->packet;
poll_table wait_table;
- struct poll_table_entry entry;
int init_timeout, max_timeout;
int timeout;
int retrans;
@@ -136,8 +135,7 @@
break;
}
re_select:
- wait_table.nr = 0;
- wait_table.entry = &entry;
+ poll_initwait(&wait_table);
/* mb() is not necessary because ->poll() will serialize
instructions adding the wait_table waitqueues in the
waitqueue-head before going to calculate the mask-retval. */
@@ -154,13 +152,16 @@
timeout = max_timeout;
}
timed_out = !schedule_timeout(timeout);
- remove_wait_queue(entry.wait_address, &entry.wait);
- fput(file);
+ poll_freewait(&wait_table);
current->state = TASK_RUNNING;
if (signal_pending(current)) {
result = -ERESTARTSYS;
break;
}
+ if(wait_table.error) {
+ result = wait_table.error;
+ break;
+ }
if (timed_out) {
if (n < retrans)
continue;
@@ -179,9 +180,8 @@
major_timeout_seen = 1;
continue;
}
- } else if (wait_table.nr) {
- remove_wait_queue(entry.wait_address, &entry.wait);
- fput(file);
+ } else {
+ poll_freewait(&wait_table);
}
current->state = TASK_RUNNING;
@@ -262,7 +262,6 @@
static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len) {
poll_table wait_table;
- struct poll_table_entry entry;
struct file *file;
struct socket *sock;
int init_timeout;
@@ -281,16 +280,14 @@
init_timeout = 0x7FFF0000;
while (len) {
- wait_table.nr = 0;
- wait_table.entry = &entry;
+ poll_initwait(&wait_table);
/* mb() is not necessary because ->poll() will serialize
instructions adding the wait_table waitqueues in the
waitqueue-head before going to calculate the mask-retval. */
__set_current_state(TASK_INTERRUPTIBLE);
if (!(sock->ops->poll(file, sock, &wait_table) & POLLIN)) {
init_timeout = schedule_timeout(init_timeout);
- remove_wait_queue(entry.wait_address, &entry.wait);
- fput(file);
+ poll_freewait(&wait_table);
current->state = TASK_RUNNING;
if (signal_pending(current)) {
return -ERESTARTSYS;
@@ -298,9 +295,11 @@
if (!init_timeout) {
return -EIO;
}
- } else if (wait_table.nr) {
- remove_wait_queue(entry.wait_address, &entry.wait);
- fput(file);
+ if(wait_table.error) {
+ return wait_table.error;
+ }
+ } else {
+ poll_freewait(&wait_table);
}
current->state = TASK_RUNNING;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)