From owner-p4-projects@FreeBSD.ORG Sun May 17 13:07:16 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 26A431065673; Sun, 17 May 2009 13:07:16 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA6AB106566C for ; Sun, 17 May 2009 13:07:15 +0000 (UTC) (envelope-from zhaoshuai@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C625A8FC13 for ; Sun, 17 May 2009 13:07:15 +0000 (UTC) (envelope-from zhaoshuai@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n4HD7FSW026334 for ; Sun, 17 May 2009 13:07:15 GMT (envelope-from zhaoshuai@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4HD7FcM026332 for perforce@freebsd.org; Sun, 17 May 2009 13:07:15 GMT (envelope-from zhaoshuai@FreeBSD.org) Date: Sun, 17 May 2009 13:07:15 GMT Message-Id: <200905171307.n4HD7FcM026332@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zhaoshuai@FreeBSD.org using -f From: Zhao Shuai To: Perforce Change Reviews Cc: Subject: PERFORCE change 162212 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2009 13:07:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=162212 Change 162212 by zhaoshuai@zhaoshuai on 2009/05/17 13:06:25 first version of fifo_vnops that compiles, still incomplete Affected files ... .. //depot/projects/soc2009/fifo/sys/fs/fifofs/fifo_vnops.c#4 edit Differences ... ==== //depot/projects/soc2009/fifo/sys/fs/fifofs/fifo_vnops.c#4 (text+ko) ==== @@ -44,6 +44,7 @@ #include #include #include +#include static fo_rdwr_t fifo_read_f; static fo_rdwr_t fifo_write_f; @@ -55,14 +56,14 @@ static fo_truncate_t fifo_truncate_f; struct fileops fifo_ops_f = { - .fo_read = fifo_read_f; - .fo_write = fifo_write_f; - .fo_truncate = fifo_truncate_f; - .fo_ioctl = fifo_ioctl_f; - .fo_poll = fifo_poll_f; - .fo_kqfilter = fifo_kqfilter_f; - .fo_stat = fifo_stat_f; - .fo_close = fifo_close_t; + .fo_read = fifo_read_f, + .fo_write = fifo_write_f, + .fo_truncate = fifo_truncate_f, + .fo_ioctl = fifo_ioctl_f, + .fo_poll = fifo_poll_f, + .fo_kqfilter = fifo_kqfilter_f, + .fo_stat = fifo_stat_f, + .fo_close = fifo_close_f, .fo_flags = DFLAG_PASSABLE }; @@ -83,15 +84,14 @@ static vop_advlock_t fifo_advlock; struct vop_vector fifo_specops = { - .vop_default = &default_vndeops. + .vop_default = &default_vnodeops, .vop_access = VOP_EBADF, .vop_advlock = fifo_advlock, - .vop_close = fifo_close. - .vop_create = VOP_PANIC. + .vop_close = fifo_close, + .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_ioctl = VOP_PANIC, .vop_kqfilter = VOP_PANIC, - .vop_lease = VOP_NULL, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, @@ -128,8 +128,6 @@ { struct vnode *vp = ap->a_vp; struct fifoinfo *fip; - struct thread *td = ap->a_td; - struct ucred *cred = ap->a_cred; struct file *fp = ap->a_fp; struct pipepair *pp; @@ -177,7 +175,7 @@ int a_fflag; struct ucred *a_cred; struct thread *a_td; - } */ ap; + } */ *ap; { struct vnode *vp = ap->a_vp; struct fifoinfo *fip = vp->v_fifoinfo; @@ -194,15 +192,12 @@ } /* - * Print out the contents of a fifo vnode + * Print out internel contents of a fifo vnode */ -static int -fifo_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ ap; +int +fifo_printinfo(struct vnode *vp) { - struct fifoinfo *fip = ap->a_vp->v_fifoinfo; + struct fifoinfo *fip = vp->v_fifoinfo; if (fip == NULL) { printf(", NULL v_fifoinfo"); @@ -210,6 +205,20 @@ } printf(", fifo with %ld readers and %ld writers", fip->fi_readers, fip->fi_writers); + return (0); +} + +/* + * Print out the contents of a fifo vnode. + */ +static int +fifo_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + printf(" "); + fifo_printinfo(ap->a_vp); printf("\n"); return (0); } @@ -241,7 +250,7 @@ int a_flags; } */ *ap; { - return (ap->a_flags & F_FLOCK ? EOPNOTSUPPP : EINVAL); + return (ap->a_flags & F_FLOCK ? EOPNOTSUPP : EINVAL); } static int @@ -249,7 +258,7 @@ { int error; struct fifoinfo *fip = fp->f_data; - fp->f_data = &fip->fi_pp->rpipe; + fp->f_data = &fip->fi_pp->pp_rpipe; error = pipe_read(fp, uio, cred, flags, td); fp->f_data = fip; @@ -261,7 +270,7 @@ { int error; struct fifoinfo *fip = fp->f_data; - fp->f_data = &fip->fi_pp->wpipe; + fp->f_data = &fip->fi_pp->pp_wpipe; error = pipe_write(fp, uio, cred, flags, td); fp->f_data = fip;