vfs_aio.c (a739e09c6e26194cd77f364d3576571fbd0b4e7d) | vfs_aio.c (4cc20ab1f0f3d1126126327aa298ab88c974c53d) |
---|---|
1/* 2 * Copyright (c) 1997 John S. Dyson. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 1426 unchanged lines hidden (view full) --- 1435 * operation). 1436 * 1437 * If it is not ready for io, then queue the aiocbe on the 1438 * socket, and set the flags so we get a call when sbnotify() 1439 * happens. 1440 */ 1441 so = (struct socket *)fp->f_data; 1442 s = splnet(); | 1/* 2 * Copyright (c) 1997 John S. Dyson. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 1426 unchanged lines hidden (view full) --- 1435 * operation). 1436 * 1437 * If it is not ready for io, then queue the aiocbe on the 1438 * socket, and set the flags so we get a call when sbnotify() 1439 * happens. 1440 */ 1441 so = (struct socket *)fp->f_data; 1442 s = splnet(); |
1443 SOCK_LOCK(so); | |
1444 if (((opcode == LIO_READ) && (!soreadable(so))) || ((opcode == 1445 LIO_WRITE) && (!sowriteable(so)))) { | 1443 if (((opcode == LIO_READ) && (!soreadable(so))) || ((opcode == 1444 LIO_WRITE) && (!sowriteable(so)))) { |
1446 SOCK_UNLOCK(so); | |
1447 TAILQ_INSERT_TAIL(&so->so_aiojobq, aiocbe, list); 1448 TAILQ_INSERT_TAIL(&ki->kaio_sockqueue, aiocbe, plist); 1449 if (opcode == LIO_READ) 1450 so->so_rcv.sb_flags |= SB_AIO; 1451 else 1452 so->so_snd.sb_flags |= SB_AIO; 1453 aiocbe->jobstate = JOBST_JOBQGLOBAL; /* XXX */ 1454 ki->kaio_queue_count++; 1455 num_queue_count++; 1456 splx(s); 1457 error = 0; 1458 goto done; 1459 } | 1445 TAILQ_INSERT_TAIL(&so->so_aiojobq, aiocbe, list); 1446 TAILQ_INSERT_TAIL(&ki->kaio_sockqueue, aiocbe, plist); 1447 if (opcode == LIO_READ) 1448 so->so_rcv.sb_flags |= SB_AIO; 1449 else 1450 so->so_snd.sb_flags |= SB_AIO; 1451 aiocbe->jobstate = JOBST_JOBQGLOBAL; /* XXX */ 1452 ki->kaio_queue_count++; 1453 num_queue_count++; 1454 splx(s); 1455 error = 0; 1456 goto done; 1457 } |
1460 SOCK_UNLOCK(so); | |
1461 splx(s); 1462 } 1463 1464 if ((error = aio_qphysio(p, aiocbe)) == 0) 1465 goto done; 1466 if (error > 0) { 1467 suword(&job->_aiocb_private.status, 0); 1468 aiocbe->uaiocb._aiocb_private.error = error; --- 842 unchanged lines hidden --- | 1458 splx(s); 1459 } 1460 1461 if ((error = aio_qphysio(p, aiocbe)) == 0) 1462 goto done; 1463 if (error > 0) { 1464 suword(&job->_aiocb_private.status, 0); 1465 aiocbe->uaiocb._aiocb_private.error = error; --- 842 unchanged lines hidden --- |