Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/yamt-pagecache]: src/sys enable O->A loaning read for a few filesystems.



details:   https://anonhg.NetBSD.org/src/rev/70541da42d2e
branches:  yamt-pagecache
changeset: 770857:70541da42d2e
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Jan 04 16:43:37 2012 +0000

description:
enable O->A loaning read for a few filesystems.

diffstat:

 sys/fs/tmpfs/tmpfs_vnops.c  |  7 +++++--
 sys/nfs/nfs_bio.c           |  8 +++++---
 sys/ufs/ufs/ufs_readwrite.c |  7 +++++--
 3 files changed, 15 insertions(+), 7 deletions(-)

diffs (85 lines):

diff -r f244227287e0 -r 70541da42d2e sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Wed Jan 04 16:31:17 2012 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Wed Jan 04 16:43:37 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.92 2011/09/27 01:32:21 christos Exp $        */
+/*     $NetBSD: tmpfs_vnops.c,v 1.92.2.1 2012/01/04 16:43:37 yamt Exp $        */
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.92 2011/09/27 01:32:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.92.2.1 2012/01/04 16:43:37 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -561,6 +561,9 @@
        uobj = node->tn_spec.tn_reg.tn_aobj;
        error = 0;
 
+       if (uio->uio_offset + uio->uio_resid <= node->tn_size) {
+               uvm_loanobj(&vp->v_uobj, uio);
+       }
        while (error == 0 && uio->uio_resid > 0) {
                vsize_t len;
 
diff -r f244227287e0 -r 70541da42d2e sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Wed Jan 04 16:31:17 2012 +0000
+++ b/sys/nfs/nfs_bio.c Wed Jan 04 16:43:37 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_bio.c,v 1.188.2.1 2011/11/02 21:53:59 yamt Exp $   */
+/*     $NetBSD: nfs_bio.c,v 1.188.2.2 2012/01/04 16:43:37 yamt Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.188.2.1 2011/11/02 21:53:59 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.188.2.2 2012/01/04 16:43:37 yamt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -147,7 +147,9 @@
                nfsstats.biocache_reads++;
 
                advice = IO_ADV_DECODE(ioflag);
-               error = 0;
+               if (uio->uio_offset + uio->uio_resid <= np->n_size) {
+                       uvm_loanobj(&vp->v_uobj, uio);
+               }
                while (uio->uio_resid > 0) {
                        vsize_t bytelen;
 
diff -r f244227287e0 -r 70541da42d2e sys/ufs/ufs/ufs_readwrite.c
--- a/sys/ufs/ufs/ufs_readwrite.c       Wed Jan 04 16:31:17 2012 +0000
+++ b/sys/ufs/ufs/ufs_readwrite.c       Wed Jan 04 16:43:37 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_readwrite.c,v 1.99 2011/07/11 08:27:41 hannken Exp $       */
+/*     $NetBSD: ufs_readwrite.c,v 1.99.2.1 2012/01/04 16:43:37 yamt Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.99 2011/07/11 08:27:41 hannken Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.99.2.1 2012/01/04 16:43:37 yamt Exp $");
 
 #ifdef LFS_READWRITE
 #define        FS                      struct lfs
@@ -123,6 +123,9 @@
        if (usepc) {
                const int advice = IO_ADV_DECODE(ap->a_ioflag);
 
+               if (uio->uio_offset + uio->uio_resid <= vp->v_size) {
+                       uvm_loanobj(&vp->v_uobj, uio);
+               }
                while (uio->uio_resid > 0) {
                        if (ioflag & IO_DIRECT) {
                                genfs_directio(vp, uio, ioflag);



Home | Main Index | Thread Index | Old Index