fifo_vnops.c (130952) | fifo_vnops.c (133741) |
---|---|
1/* 2 * Copyright (c) 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 | 1/* 2 * Copyright (c) 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 |
30 * $FreeBSD: head/sys/fs/fifofs/fifo_vnops.c 130952 2004-06-23 00:35:50Z rwatson $ | 30 * $FreeBSD: head/sys/fs/fifofs/fifo_vnops.c 133741 2004-08-15 06:24:42Z jmg $ |
31 */ 32 33#include <sys/param.h> 34#include <sys/event.h> 35#include <sys/filio.h> 36#include <sys/fcntl.h> 37#include <sys/file.h> 38#include <sys/kernel.h> --- 388 unchanged lines hidden (view full) --- 427 break; 428 default: 429 return (1); 430 } 431 432 ap->a_kn->kn_hook = (caddr_t)so; 433 434 SOCKBUF_LOCK(sb); | 31 */ 32 33#include <sys/param.h> 34#include <sys/event.h> 35#include <sys/filio.h> 36#include <sys/fcntl.h> 37#include <sys/file.h> 38#include <sys/kernel.h> --- 388 unchanged lines hidden (view full) --- 427 break; 428 default: 429 return (1); 430 } 431 432 ap->a_kn->kn_hook = (caddr_t)so; 433 434 SOCKBUF_LOCK(sb); |
435 SLIST_INSERT_HEAD(&sb->sb_sel.si_note, ap->a_kn, kn_selnext); | 435 knlist_add(&sb->sb_sel.si_note, ap->a_kn, 1); |
436 sb->sb_flags |= SB_KNOTE; 437 SOCKBUF_UNLOCK(sb); 438 439 return (0); 440} 441 442static void 443filt_fifordetach(struct knote *kn) 444{ 445 struct socket *so = (struct socket *)kn->kn_hook; 446 447 SOCKBUF_LOCK(&so->so_rcv); | 436 sb->sb_flags |= SB_KNOTE; 437 SOCKBUF_UNLOCK(sb); 438 439 return (0); 440} 441 442static void 443filt_fifordetach(struct knote *kn) 444{ 445 struct socket *so = (struct socket *)kn->kn_hook; 446 447 SOCKBUF_LOCK(&so->so_rcv); |
448 SLIST_REMOVE(&so->so_rcv.sb_sel.si_note, kn, knote, kn_selnext); 449 if (SLIST_EMPTY(&so->so_rcv.sb_sel.si_note)) | 448 knlist_remove(&so->so_rcv.sb_sel.si_note, kn, 1); 449 if (knlist_empty(&so->so_rcv.sb_sel.si_note)) |
450 so->so_rcv.sb_flags &= ~SB_KNOTE; 451 SOCKBUF_UNLOCK(&so->so_rcv); 452} 453 454static int 455filt_fiforead(struct knote *kn, long hint) 456{ 457 struct socket *so = (struct socket *)kn->kn_hook; --- 16 unchanged lines hidden (view full) --- 474} 475 476static void 477filt_fifowdetach(struct knote *kn) 478{ 479 struct socket *so = (struct socket *)kn->kn_hook; 480 481 SOCKBUF_LOCK(&so->so_snd); | 450 so->so_rcv.sb_flags &= ~SB_KNOTE; 451 SOCKBUF_UNLOCK(&so->so_rcv); 452} 453 454static int 455filt_fiforead(struct knote *kn, long hint) 456{ 457 struct socket *so = (struct socket *)kn->kn_hook; --- 16 unchanged lines hidden (view full) --- 474} 475 476static void 477filt_fifowdetach(struct knote *kn) 478{ 479 struct socket *so = (struct socket *)kn->kn_hook; 480 481 SOCKBUF_LOCK(&so->so_snd); |
482 SLIST_REMOVE(&so->so_snd.sb_sel.si_note, kn, knote, kn_selnext); 483 if (SLIST_EMPTY(&so->so_snd.sb_sel.si_note)) | 482 knlist_remove(&so->so_snd.sb_sel.si_note, kn, 1); 483 if (knlist_empty(&so->so_snd.sb_sel.si_note)) |
484 so->so_snd.sb_flags &= ~SB_KNOTE; 485 SOCKBUF_UNLOCK(&so->so_snd); 486} 487 488static int 489filt_fifowrite(struct knote *kn, long hint) 490{ 491 struct socket *so = (struct socket *)kn->kn_hook; --- 179 unchanged lines hidden --- | 484 so->so_snd.sb_flags &= ~SB_KNOTE; 485 SOCKBUF_UNLOCK(&so->so_snd); 486} 487 488static int 489filt_fifowrite(struct knote *kn, long hint) 490{ 491 struct socket *so = (struct socket *)kn->kn_hook; --- 179 unchanged lines hidden --- |