aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs/sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ncpfs/sock.c')
-rw-r--r--fs/ncpfs/sock.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c
index 6593a5ca88ba..8783eb7ec641 100644
--- a/fs/ncpfs/sock.c
+++ b/fs/ncpfs/sock.c
@@ -171,9 +171,9 @@ static inline void __ncp_abort_request(struct ncp_server *server, struct ncp_req
171 171
172static inline void ncp_abort_request(struct ncp_server *server, struct ncp_request_reply *req, int err) 172static inline void ncp_abort_request(struct ncp_server *server, struct ncp_request_reply *req, int err)
173{ 173{
174 down(&server->rcv.creq_sem); 174 mutex_lock(&server->rcv.creq_mutex);
175 __ncp_abort_request(server, req, err); 175 __ncp_abort_request(server, req, err);
176 up(&server->rcv.creq_sem); 176 mutex_unlock(&server->rcv.creq_mutex);
177} 177}
178 178
179static inline void __ncptcp_abort(struct ncp_server *server) 179static inline void __ncptcp_abort(struct ncp_server *server)
@@ -303,20 +303,20 @@ static inline void __ncp_start_request(struct ncp_server *server, struct ncp_req
303 303
304static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *req) 304static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *req)
305{ 305{
306 down(&server->rcv.creq_sem); 306 mutex_lock(&server->rcv.creq_mutex);
307 if (!ncp_conn_valid(server)) { 307 if (!ncp_conn_valid(server)) {
308 up(&server->rcv.creq_sem); 308 mutex_unlock(&server->rcv.creq_mutex);
309 printk(KERN_ERR "ncpfs: tcp: Server died\n"); 309 printk(KERN_ERR "ncpfs: tcp: Server died\n");
310 return -EIO; 310 return -EIO;
311 } 311 }
312 if (server->tx.creq || server->rcv.creq) { 312 if (server->tx.creq || server->rcv.creq) {
313 req->status = RQ_QUEUED; 313 req->status = RQ_QUEUED;
314 list_add_tail(&req->req, &server->tx.requests); 314 list_add_tail(&req->req, &server->tx.requests);
315 up(&server->rcv.creq_sem); 315 mutex_unlock(&server->rcv.creq_mutex);
316 return 0; 316 return 0;
317 } 317 }
318 __ncp_start_request(server, req); 318 __ncp_start_request(server, req);
319 up(&server->rcv.creq_sem); 319 mutex_unlock(&server->rcv.creq_mutex);
320 return 0; 320 return 0;
321} 321}
322 322
@@ -400,7 +400,7 @@ void ncpdgram_rcv_proc(void *s)
400 info_server(server, 0, server->unexpected_packet.data, result); 400 info_server(server, 0, server->unexpected_packet.data, result);
401 continue; 401 continue;
402 } 402 }
403 down(&server->rcv.creq_sem); 403 mutex_lock(&server->rcv.creq_mutex);
404 req = server->rcv.creq; 404 req = server->rcv.creq;
405 if (req && (req->tx_type == NCP_ALLOC_SLOT_REQUEST || (server->sequence == reply.sequence && 405 if (req && (req->tx_type == NCP_ALLOC_SLOT_REQUEST || (server->sequence == reply.sequence &&
406 server->connection == get_conn_number(&reply)))) { 406 server->connection == get_conn_number(&reply)))) {
@@ -430,11 +430,11 @@ void ncpdgram_rcv_proc(void *s)
430 server->rcv.creq = NULL; 430 server->rcv.creq = NULL;
431 ncp_finish_request(req, result); 431 ncp_finish_request(req, result);
432 __ncp_next_request(server); 432 __ncp_next_request(server);
433 up(&server->rcv.creq_sem); 433 mutex_unlock(&server->rcv.creq_mutex);
434 continue; 434 continue;
435 } 435 }
436 } 436 }
437 up(&server->rcv.creq_sem); 437 mutex_unlock(&server->rcv.creq_mutex);
438 } 438 }
439drop:; 439drop:;
440 _recv(sock, &reply, sizeof(reply), MSG_DONTWAIT); 440 _recv(sock, &reply, sizeof(reply), MSG_DONTWAIT);
@@ -472,9 +472,9 @@ static void __ncpdgram_timeout_proc(struct ncp_server *server)
472void ncpdgram_timeout_proc(void *s) 472void ncpdgram_timeout_proc(void *s)
473{ 473{
474 struct ncp_server *server = s; 474 struct ncp_server *server = s;
475 down(&server->rcv.creq_sem); 475 mutex_lock(&server->rcv.creq_mutex);
476 __ncpdgram_timeout_proc(server); 476 __ncpdgram_timeout_proc(server);
477 up(&server->rcv.creq_sem); 477 mutex_unlock(&server->rcv.creq_mutex);
478} 478}
479 479
480static inline void ncp_init_req(struct ncp_request_reply* req) 480static inline void ncp_init_req(struct ncp_request_reply* req)
@@ -657,18 +657,18 @@ void ncp_tcp_rcv_proc(void *s)
657{ 657{
658 struct ncp_server *server = s; 658 struct ncp_server *server = s;
659 659
660 down(&server->rcv.creq_sem); 660 mutex_lock(&server->rcv.creq_mutex);
661 __ncptcp_rcv_proc(server); 661 __ncptcp_rcv_proc(server);
662 up(&server->rcv.creq_sem); 662 mutex_unlock(&server->rcv.creq_mutex);
663} 663}
664 664
665void ncp_tcp_tx_proc(void *s) 665void ncp_tcp_tx_proc(void *s)
666{ 666{
667 struct ncp_server *server = s; 667 struct ncp_server *server = s;
668 668
669 down(&server->rcv.creq_sem); 669 mutex_lock(&server->rcv.creq_mutex);
670 __ncptcp_try_send(server); 670 __ncptcp_try_send(server);
671 up(&server->rcv.creq_sem); 671 mutex_unlock(&server->rcv.creq_mutex);
672} 672}
673 673
674static int do_ncp_rpc_call(struct ncp_server *server, int size, 674static int do_ncp_rpc_call(struct ncp_server *server, int size,
@@ -833,7 +833,7 @@ int ncp_disconnect(struct ncp_server *server)
833 833
834void ncp_lock_server(struct ncp_server *server) 834void ncp_lock_server(struct ncp_server *server)
835{ 835{
836 down(&server->sem); 836 mutex_lock(&server->mutex);
837 if (server->lock) 837 if (server->lock)
838 printk(KERN_WARNING "ncp_lock_server: was locked!\n"); 838 printk(KERN_WARNING "ncp_lock_server: was locked!\n");
839 server->lock = 1; 839 server->lock = 1;
@@ -846,5 +846,5 @@ void ncp_unlock_server(struct ncp_server *server)
846 return; 846 return;
847 } 847 }
848 server->lock = 0; 848 server->lock = 0;
849 up(&server->sem); 849 mutex_unlock(&server->mutex);
850} 850}