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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to