Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2016 19:23:15 +0000 (UTC)
From:      Doug Ambrisko <ambrisko@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300866 - head/sys/boot/efi/libefi
Message-ID:  <201605271923.u4RJNF0d016635@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ambrisko
Date: Fri May 27 19:23:15 2016
New Revision: 300866
URL: https://svnweb.freebsd.org/changeset/base/300866

Log:
  If the I/O offset and length is multiple of the media size then
  directly pass the request otherwise use a buffer that is a
  multiple of the media size.  This speeds up I/O quite a bit
  when using large transfer sizes on 4Kn disks etc.
  
  MFC after:	1 week

Modified:
  head/sys/boot/efi/libefi/efipart.c

Modified: head/sys/boot/efi/libefi/efipart.c
==============================================================================
--- head/sys/boot/efi/libefi/efipart.c	Fri May 27 19:15:45 2016	(r300865)
+++ head/sys/boot/efi/libefi/efipart.c	Fri May 27 19:23:15 2016	(r300866)
@@ -325,11 +325,14 @@ efipart_realstrategy(void *devdata, int 
 	if (rsize != NULL)
 		*rsize = size;
 
-	if (blkio->Media->BlockSize == 512)
-		return (efipart_readwrite(blkio, rw, blk, size / 512, buf));
+        if ((size % blkio->Media->BlockSize == 0) &&
+	    ((blk * 512) % blkio->Media->BlockSize == 0))
+                return (efipart_readwrite(blkio, rw,
+		    blk * 512 / blkio->Media->BlockSize,
+		    size / blkio->Media->BlockSize, buf));
 
 	/*
-	 * The block size of the media is not 512B per sector.
+	 * The block size of the media is not a multiple of I/O.
 	 */
 	blkbuf = malloc(blkio->Media->BlockSize);
 	if (blkbuf == NULL)



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