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
This commit is contained in:
parent
9d1c06e31e
commit
56f6287638
@ -258,15 +258,9 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
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, size_t size,
|
||||
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);
|
||||
|
@ -451,17 +451,11 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
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, size_t size,
|
||||
}
|
||||
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, size_t size,
|
||||
DEBUG("write error");
|
||||
return (EIO);
|
||||
}
|
||||
#ifdef BD_SUPPORT_FRAGS
|
||||
if (fragsize) {
|
||||
DEBUG("Attempted to write a frag");
|
||||
return (EIO);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
/* DO NOTHING */
|
||||
|
Loading…
x
Reference in New Issue
Block a user