Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jun 2012 18:10:29 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 212483 for review
Message-ID:  <201206081810.q58IATWe027971@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@212483?ac=10

Change 212483 by jhb@jhb_jhbbsd on 2012/06/08 18:09:56

	Revert this closer to stock and the simple implementation of
	WILLNEED for FFS.

Affected files ...

.. //depot/projects/fadvise/sys/ufs/ffs/ffs_vnops.c#7 edit

Differences ...

==== //depot/projects/fadvise/sys/ufs/ffs/ffs_vnops.c#7 (text+ko) ====

@@ -422,6 +422,7 @@
 	int xfersize;
 
 	switch (ap->a_advice) {
+#if 0
 	case POSIX_FADV_DONTNEED:
 		/*
 		 * Trim requests to only cover full blocks to avoid
@@ -472,6 +473,7 @@
 		}
 		VOP_UNLOCK(vp, 0);
 		return (0);
+#endif
 	case POSIX_FADV_WILLNEED:
 		vp = ap->a_vp;
 		start = ap->a_start;
@@ -492,10 +494,12 @@
 		resid = end - start + 1;
 		fs = ip->i_fs;
 
+#if 0
 		/* HACK: Prefetch indirect blocks for this range. */
 		endblkno = lblkno(fs, end);
 		for (lbn = NDADDR; lbn < endblkno; lbn += NINDIR(fs))
 			breada(vp, &lbn, &fs->fs_bsize, 1, NOCRED);
+#endif
 
 		while (resid > 0) {
 			/* Limit the number of read ahead buffers. */
@@ -504,12 +508,16 @@
 			lbn = lblkno(fs, start);
 			size = blksize(fs, ip, lbn);
 			blkoffset = blkoff(fs, start);
+#if 0
 			if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
 				resid += blkoffset;
 				start -= blkoffset;
 				xfersize = cluster_readahead(vp, ip->i_size,
 				    lbn, size);
 			} else {
+#else
+			if (1) {
+#ebduf
 				xfersize = fs->fs_bsize - blkoffset;
 				if (resid < xfersize)
 					xfersize = resid;



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