Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2018 21:21:17 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337872 - head/stand/i386/libi386
Message-ID:  <201808152121.w7FLLHLM084198@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Wed Aug 15 21:21:16 2018
New Revision: 337872
URL: https://svnweb.freebsd.org/changeset/base/337872

Log:
  libi386: remove BD_SUPPORT_FRAGS
  
  BD_SUPPORT_FRAGS is preprocessor knob to allow partial reads in bioscd/biosdisk
  level. However, we already have support for partial reads in bcache, and there
  is no need to have duplication via preprocessor controls.
  
  Note that bioscd/biosdisk interface is assumed to perform IO in 512B blocks,
  so the only translation we have to do is 512 <-> native block size.
  
  Differential Revision:	https://reviews.freebsd.org/D16600

Modified:
  head/stand/i386/libi386/bioscd.c
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/bioscd.c
==============================================================================
--- head/stand/i386/libi386/bioscd.c	Wed Aug 15 21:13:10 2018	(r337871)
+++ head/stand/i386/libi386/bioscd.c	Wed Aug 15 21:21:16 2018	(r337872)
@@ -258,15 +258,9 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, s
 	struct i386_devdesc *dev;
 	int unit;
 	int blks;
-#ifdef BD_SUPPORT_FRAGS
-	char fragbuf[BIOSCD_SECSIZE];
-	size_t fragsize;
 
-	fragsize = size % BIOSCD_SECSIZE;
-#else
 	if (size % BIOSCD_SECSIZE)
 		return (EINVAL);
-#endif
 
 	if ((rw & F_MASK) != F_READ)
 		return(EROFS);
@@ -290,20 +284,6 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, s
 			return (0);
 		}
 	}
-#ifdef BD_SUPPORT_FRAGS
-	DEBUG("frag read %d from %lld+%d to %p", 
-	    fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE));
-	if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf) != 1) {
-		if (blks) {
-			if (rsize)
-				*rsize = blks * BIOSCD_SECSIZE;
-			return (0);
-		}
-		DEBUG("frag read error");
-		return(EIO);
-	}
-	bcopy(fragbuf, buf + (blks * BIOSCD_SECSIZE), fragsize);
-#endif	
 	if (rsize)
 		*rsize = size;
 	return (0);

Modified: head/stand/i386/libi386/biosdisk.c
==============================================================================
--- head/stand/i386/libi386/biosdisk.c	Wed Aug 15 21:13:10 2018	(r337871)
+++ head/stand/i386/libi386/biosdisk.c	Wed Aug 15 21:21:16 2018	(r337872)
@@ -451,17 +451,11 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s
 	struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
 	uint64_t		disk_blocks;
 	int			blks, rc;
-#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */
-	char		fragbuf[BIOSDISK_SECSIZE];
-	size_t		fragsize;
 
-	fragsize = size % BIOSDISK_SECSIZE;
-#else
 	if (size % BD(dev).bd_sectorsize) {
 		panic("bd_strategy: %d bytes I/O not multiple of block size",
 		    size);
 	}
-#endif
 
 	DEBUG("open_disk %p", dev);
 
@@ -520,15 +514,6 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s
 			}
 			return (EIO);
 		}
-#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */
-		DEBUG("bd_strategy: frag read %d from %d+%d to %p",
-		    fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE));
-		if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) {
-			DEBUG("frag read error");
-			return (EIO);
-		}
-		bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize);
-#endif
 		break;
 	case F_WRITE :
 		DEBUG("write %d from %lld to %p", blks, dblk, buf);
@@ -537,12 +522,6 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s
 			DEBUG("write error");
 			return (EIO);
 		}
-#ifdef BD_SUPPORT_FRAGS
-		if (fragsize) {
-			DEBUG("Attempted to write a frag");
-			return (EIO);
-		}
-#endif
 		break;
 	default:
 		/* DO NOTHING */



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