Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 2002 23:33:20 +0700 (NOVST)
From:      "Semen A. Ustimenko" <semenu@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-current@FreeBSD.org, Maxim Konovalov <maxim@FreeBSD.org>, Robert Watson <rwatson@FreeBSD.org>, <dg@FreeBSD.org>
Subject:   sendfile() change (Was: Re: cvs commit: src/sys/kern uipc_syscalls.c)
Message-ID:  <20020819231230.S678-100000@main.the.net>
In-Reply-To: <20020812202953.U24022-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi!

Why can't we get rid of VOP_READ(.. UIO_NOCOPY...) call in sendfile()?
Me, I can't quite understand what UIO_NOCOPY means... As long as
sendfile() function already plays around pages, it can use VOP_GETPAGES().
The following patch looks works for me. Could anybody said if it has any
benefits or not?

Index: uipc_syscalls.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/uipc_syscalls.c,v
retrieving revision 1.110
diff -u -r1.110 uipc_syscalls.c
--- uipc_syscalls.c	20 May 2002 05:41:03 -0000	1.110
+++ uipc_syscalls.c	13 Aug 2002 17:54:33 -0000
@@ -1820,10 +1820,7 @@
 			 */
 			bsize = vp->v_mount->mnt_stat.f_iosize;
 			vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, td);
-			error = vn_rdwr(UIO_READ, vp, NULL, MAXBSIZE,
-			    trunc_page(off), UIO_NOCOPY, IO_NODELOCKED |
-			    IO_VMIO | ((MAXBSIZE / bsize) << 16),
-			    td->td_ucred, NULL, td);
+			error = VOP_GETPAGES(vp, &pg, PAGE_SIZE, 0, 0);
 			VOP_UNLOCK(vp, 0, td);
 			vm_page_flag_clear(pg, PG_ZERO);
 			vm_page_io_finish(pg);

Bye!


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020819231230.S678-100000>