vfs_aio.c (187631) | vfs_aio.c (193272) |
---|---|
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. --- 5 unchanged lines hidden (view full) --- 14 * of the author. This software is distributed AS-IS. 15 */ 16 17/* 18 * This file contains support for the POSIX 1003.1B AIO/LIO facility. 19 */ 20 21#include <sys/cdefs.h> | 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. --- 5 unchanged lines hidden (view full) --- 14 * of the author. This software is distributed AS-IS. 15 */ 16 17/* 18 * This file contains support for the POSIX 1003.1B AIO/LIO facility. 19 */ 20 21#include <sys/cdefs.h> |
22__FBSDID("$FreeBSD: head/sys/kern/vfs_aio.c 187631 2009-01-23 13:23:17Z jhb $"); | 22__FBSDID("$FreeBSD: head/sys/kern/vfs_aio.c 193272 2009-06-01 21:17:03Z jhb $"); |
23 24#include "opt_compat.h" 25 26#include <sys/param.h> 27#include <sys/systm.h> 28#include <sys/malloc.h> 29#include <sys/bio.h> 30#include <sys/buf.h> --- 1277 unchanged lines hidden (view full) --- 1308 * Wake up aio requests that may be serviceable now. 1309 */ 1310static void 1311aio_swake_cb(struct socket *so, struct sockbuf *sb) 1312{ 1313 struct aiocblist *cb, *cbn; 1314 int opcode; 1315 | 23 24#include "opt_compat.h" 25 26#include <sys/param.h> 27#include <sys/systm.h> 28#include <sys/malloc.h> 29#include <sys/bio.h> 30#include <sys/buf.h> --- 1277 unchanged lines hidden (view full) --- 1308 * Wake up aio requests that may be serviceable now. 1309 */ 1310static void 1311aio_swake_cb(struct socket *so, struct sockbuf *sb) 1312{ 1313 struct aiocblist *cb, *cbn; 1314 int opcode; 1315 |
1316 SOCKBUF_LOCK_ASSERT(sb); |
|
1316 if (sb == &so->so_snd) 1317 opcode = LIO_WRITE; 1318 else 1319 opcode = LIO_READ; 1320 | 1317 if (sb == &so->so_snd) 1318 opcode = LIO_WRITE; 1319 else 1320 opcode = LIO_READ; 1321 |
1321 SOCKBUF_LOCK(sb); | |
1322 sb->sb_flags &= ~SB_AIO; 1323 mtx_lock(&aio_job_mtx); 1324 TAILQ_FOREACH_SAFE(cb, &so->so_aiojobq, list, cbn) { 1325 if (opcode == cb->uaiocb.aio_lio_opcode) { 1326 if (cb->jobstate != JOBST_JOBQSOCK) 1327 panic("invalid queue value"); 1328 /* XXX 1329 * We don't have actual sockets backend yet, 1330 * so we simply move the requests to the generic 1331 * file I/O backend. 1332 */ 1333 TAILQ_REMOVE(&so->so_aiojobq, cb, list); 1334 TAILQ_INSERT_TAIL(&aio_jobs, cb, list); 1335 aio_kick_nowait(cb->userproc); 1336 } 1337 } 1338 mtx_unlock(&aio_job_mtx); | 1322 sb->sb_flags &= ~SB_AIO; 1323 mtx_lock(&aio_job_mtx); 1324 TAILQ_FOREACH_SAFE(cb, &so->so_aiojobq, list, cbn) { 1325 if (opcode == cb->uaiocb.aio_lio_opcode) { 1326 if (cb->jobstate != JOBST_JOBQSOCK) 1327 panic("invalid queue value"); 1328 /* XXX 1329 * We don't have actual sockets backend yet, 1330 * so we simply move the requests to the generic 1331 * file I/O backend. 1332 */ 1333 TAILQ_REMOVE(&so->so_aiojobq, cb, list); 1334 TAILQ_INSERT_TAIL(&aio_jobs, cb, list); 1335 aio_kick_nowait(cb->userproc); 1336 } 1337 } 1338 mtx_unlock(&aio_job_mtx); |
1339 SOCKBUF_UNLOCK(sb); | |
1340} 1341 1342static int 1343convert_old_sigevent(struct osigevent *osig, struct sigevent *nsig) 1344{ 1345 1346 /* 1347 * Only SIGEV_NONE, SIGEV_SIGNAL, and SIGEV_KEVENT are --- 1609 unchanged lines hidden --- | 1339} 1340 1341static int 1342convert_old_sigevent(struct osigevent *osig, struct sigevent *nsig) 1343{ 1344 1345 /* 1346 * Only SIGEV_NONE, SIGEV_SIGNAL, and SIGEV_KEVENT are --- 1609 unchanged lines hidden --- |