Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131710178
D8644.id23473.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
36 KB
Referenced Files
None
Subscribers
None
D8644.id23473.diff
View Options
Index: head/lib/libstand/cd9660.c
===================================================================
--- head/lib/libstand/cd9660.c
+++ head/lib/libstand/cd9660.c
@@ -143,7 +143,7 @@
if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) {
shc = (ISO_RRIP_CONT *)sh;
error = f->f_dev->dv_strategy(f->f_devdata, F_READ,
- cdb2devb(isonum_733(shc->location)), 0,
+ cdb2devb(isonum_733(shc->location)),
ISO_DEFAULT_BLOCK_SIZE, susp_buffer, &read);
/* Bail if it fails. */
@@ -288,7 +288,7 @@
for (bno = 16;; bno++) {
twiddle(1);
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno),
- 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read);
+ ISO_DEFAULT_BLOCK_SIZE, buf, &read);
if (rc)
goto out;
if (read != ISO_DEFAULT_BLOCK_SIZE) {
@@ -322,7 +322,7 @@
twiddle(1);
rc = f->f_dev->dv_strategy
(f->f_devdata, F_READ,
- cdb2devb(bno + boff), 0,
+ cdb2devb(bno + boff),
ISO_DEFAULT_BLOCK_SIZE,
buf, &read);
if (rc)
@@ -387,7 +387,7 @@
bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length);
twiddle(1);
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno),
- 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read);
+ ISO_DEFAULT_BLOCK_SIZE, buf, &read);
if (rc)
goto out;
if (read != ISO_DEFAULT_BLOCK_SIZE) {
@@ -444,7 +444,7 @@
twiddle(16);
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ,
- cdb2devb(blkno), 0, ISO_DEFAULT_BLOCK_SIZE,
+ cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE,
fp->f_buf, &read);
if (rc)
return (rc);
Index: head/lib/libstand/dosfs.c
===================================================================
--- head/lib/libstand/dosfs.c
+++ head/lib/libstand/dosfs.c
@@ -154,7 +154,7 @@
static int fatget(DOS_FS *, u_int *);
static int fatend(u_int, u_int);
static int ioread(DOS_FS *, u_int, void *, u_int);
-static int ioget(struct open_file *, daddr_t, size_t, void *, u_int);
+static int ioget(struct open_file *, daddr_t, void *, u_int);
static void
dos_read_fat(DOS_FS *fs, struct open_file *fd)
@@ -172,7 +172,7 @@
fat.buf = malloc(secbyt(fs->spf));
if (fat.buf != NULL) {
- if (ioget(fd, fs->lsnfat, 0, fat.buf, secbyt(fs->spf)) == 0) {
+ if (ioget(fd, fs->lsnfat, fat.buf, secbyt(fs->spf)) == 0) {
fat.size = fs->spf;
fat.unit = dd->d_unit;
return;
@@ -199,7 +199,7 @@
fs->fd = fd;
if ((err = !(buf = malloc(secbyt(1))) ? errno : 0) ||
- (err = ioget(fs->fd, 0, 0, buf, secbyt(1))) ||
+ (err = ioget(fs->fd, 0, buf, secbyt(1))) ||
(err = parsebs(fs, (DOS_BS *)buf))) {
if (buf != NULL)
free(buf);
@@ -619,7 +619,7 @@
else
return (EINVAL);
for (sec = 0; sec < nsec; sec++) {
- if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1))))
+ if ((err = ioget(fs->fd, lsec + sec, dir, secbyt(1))))
return (err);
for (ent = 0; ent < DEPSEC; ent++) {
if (!*dir[ent].de.name)
@@ -768,8 +768,7 @@
fatget(DOS_FS *fs, u_int *c)
{
u_char buf[4];
- u_char *s;
- u_int x, offset, off, n, nbyte, lsec;
+ u_int x, offset, n, nbyte;
struct devdesc *dd = fs->fd->f_devdata;
int err = 0;
@@ -783,25 +782,9 @@
offset = fatoff(fs->fatsz, *c);
nbyte = fs->fatsz != 32 ? 2 : 4;
- s = buf;
- if ((off = offset & (SECSIZ - 1))) {
- offset -= off;
- lsec = bytsec(offset);
- offset += SECSIZ;
- if ((n = SECSIZ - off) > nbyte)
- n = nbyte;
- memcpy(s, fat.buf + secbyt(lsec) + off, n);
- s += n;
- nbyte -= n;
- }
- n = nbyte & (SECSIZ - 1);
- if (nbyte -= n) {
- memcpy(s, fat.buf + secbyt(bytsec(offset)), nbyte);
- offset += nbyte;
- s += nbyte;
- }
- if (n)
- memcpy(s, fat.buf + secbyt(bytsec(offset)), n);
+ if (offset + nbyte > secbyt(fat.size))
+ return (EINVAL);
+ memcpy(buf, fat.buf + offset, nbyte);
}
x = fs->fatsz != 32 ? cv2(buf) : cv4(buf);
@@ -827,28 +810,31 @@
char *s;
u_int off, n;
int err;
+ u_char local_buf[SECSIZ];
s = buf;
if ((off = offset & (SECSIZ - 1))) {
offset -= off;
if ((n = SECSIZ - off) > nbyte)
n = nbyte;
- if ((err = ioget(fs->fd, bytsec(offset), off, s, n)))
+ if ((err = ioget(fs->fd, bytsec(offset), local_buf, sizeof(local_buf))))
return (err);
+ memcpy(s, local_buf + off, n);
offset += SECSIZ;
s += n;
nbyte -= n;
}
n = nbyte & (SECSIZ - 1);
if (nbyte -= n) {
- if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte)))
+ if ((err = ioget(fs->fd, bytsec(offset), s, nbyte)))
return (err);
offset += nbyte;
s += nbyte;
}
if (n) {
- if ((err = ioget(fs->fd, bytsec(offset), 0, s, n)))
+ if ((err = ioget(fs->fd, bytsec(offset), local_buf, sizeof(local_buf))))
return (err);
+ memcpy(s, local_buf, n);
}
return (0);
}
@@ -857,8 +843,8 @@
* Sector-based I/O primitive
*/
static int
-ioget(struct open_file *fd, daddr_t lsec, size_t offset, void *buf, u_int size)
+ioget(struct open_file *fd, daddr_t lsec, void *buf, u_int size)
{
- return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, offset,
+ return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec,
size, buf, NULL));
}
Index: head/lib/libstand/ext2fs.c
===================================================================
--- head/lib/libstand/ext2fs.c
+++ head/lib/libstand/ext2fs.c
@@ -355,7 +355,7 @@
fp->f_fs = fs;
twiddle(1);
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- EXT2_SBLOCK, 0, EXT2_SBSIZE, (char *)fs, &buf_size);
+ EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size);
if (error)
goto out;
@@ -397,7 +397,7 @@
fp->f_bg = malloc(len);
twiddle(1);
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, 0, len,
+ EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len,
(char *)fp->f_bg, &buf_size);
if (error)
goto out;
@@ -509,7 +509,7 @@
twiddle(1);
error = (f->f_dev->dv_strategy)(f->f_devdata,
- F_READ, fsb_to_db(fs, disk_block), 0,
+ F_READ, fsb_to_db(fs, disk_block),
fs->fs_bsize, buf, &buf_size);
if (error)
goto out;
@@ -570,7 +570,7 @@
buf = malloc(fs->fs_bsize);
twiddle(1);
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- ino_to_db(fs, fp->f_bg, inumber), 0, fs->fs_bsize, buf, &rsize);
+ ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize);
if (error)
goto out;
if (rsize != fs->fs_bsize) {
@@ -667,7 +667,7 @@
malloc(fs->fs_bsize);
twiddle(1);
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- fsb_to_db(fp->f_fs, ind_block_num), 0, fs->fs_bsize,
+ fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize,
fp->f_blk[level], &fp->f_blksize[level]);
if (error)
return (error);
@@ -725,7 +725,7 @@
} else {
twiddle(4);
error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- fsb_to_db(fs, disk_block), 0, block_size,
+ fsb_to_db(fs, disk_block), block_size,
fp->f_buf, &fp->f_buf_size);
if (error)
goto done;
Index: head/lib/libstand/nandfs.c
===================================================================
--- head/lib/libstand/nandfs.c
+++ head/lib/libstand/nandfs.c
@@ -1024,7 +1024,7 @@
buffer = malloc(nsec * bsize);
- err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos, 0,
+ err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos,
nsec * bsize, buffer, NULL);
memcpy(buf, (void *)((uintptr_t)buffer + off), length);
Index: head/lib/libstand/read.c
===================================================================
--- head/lib/libstand/read.c
+++ head/lib/libstand/read.c
@@ -79,7 +79,7 @@
if (f->f_flags & F_RAW) {
twiddle(4);
errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- btodb(f->f_offset), 0, bcount, dest, &resid);
+ btodb(f->f_offset), bcount, dest, &resid);
if (errno)
return (-1);
f->f_offset += resid;
Index: head/lib/libstand/stand.h
===================================================================
--- head/lib/libstand/stand.h
+++ head/lib/libstand/stand.h
@@ -139,7 +139,7 @@
int dv_type; /* opaque type constant, arch-dependant */
int (*dv_init)(void); /* early probe call */
int (*dv_strategy)(void *devdata, int rw, daddr_t blk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
int (*dv_open)(struct open_file *f, ...);
int (*dv_close)(struct open_file *f);
int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data);
Index: head/lib/libstand/ufs.c
===================================================================
--- head/lib/libstand/ufs.c
+++ head/lib/libstand/ufs.c
@@ -157,7 +157,7 @@
buf = malloc(fs->fs_bsize);
twiddle(1);
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- fsbtodb(fs, ino_to_fsba(fs, inumber)), 0, fs->fs_bsize,
+ fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize,
buf, &rsize);
if (rc)
goto out;
@@ -267,7 +267,7 @@
malloc(fs->fs_bsize);
twiddle(1);
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- fsbtodb(fp->f_fs, ind_block_num), 0,
+ fsbtodb(fp->f_fs, ind_block_num),
fs->fs_bsize,
fp->f_blk[level],
&fp->f_blksize[level]);
@@ -348,7 +348,7 @@
twiddle(4);
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- fsbtodb(fs, disk_block), 0,
+ fsbtodb(fs, disk_block),
block_size, fp->f_buf, &fp->f_buf_size);
if (rc)
return (rc);
@@ -367,7 +367,7 @@
twiddle(4);
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE,
- fsbtodb(fs, disk_block), 0,
+ fsbtodb(fs, disk_block),
block_size, fp->f_buf, &fp->f_buf_size);
return (rc);
}
@@ -408,7 +408,7 @@
} else {
twiddle(4);
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- fsbtodb(fs, disk_block), 0,
+ fsbtodb(fs, disk_block),
block_size, fp->f_buf, &fp->f_buf_size);
if (rc)
return (rc);
@@ -521,7 +521,7 @@
*/
for (i = 0; sblock_try[i] != -1; i++) {
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
- sblock_try[i] / DEV_BSIZE, 0, SBLOCKSIZE,
+ sblock_try[i] / DEV_BSIZE, SBLOCKSIZE,
(char *)fs, &buf_size);
if (rc)
goto out;
@@ -651,7 +651,7 @@
twiddle(1);
rc = (f->f_dev->dv_strategy)(f->f_devdata,
- F_READ, fsbtodb(fs, disk_block), 0,
+ F_READ, fsbtodb(fs, disk_block),
fs->fs_bsize, buf, &buf_size);
if (rc)
goto out;
Index: head/lib/libstand/write.c
===================================================================
--- head/lib/libstand/write.c
+++ head/lib/libstand/write.c
@@ -82,7 +82,7 @@
if (f->f_flags & F_RAW) {
twiddle(4);
errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE,
- btodb(f->f_offset), 0, bcount, dest, &resid);
+ btodb(f->f_offset), bcount, dest, &resid);
if (errno)
return (-1);
f->f_offset += resid;
Index: head/sys/boot/common/bcache.c
===================================================================
--- head/sys/boot/common/bcache.c
+++ head/sys/boot/common/bcache.c
@@ -182,8 +182,8 @@
* cache with the new values.
*/
static int
-write_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+write_strategy(void *devdata, int rw, daddr_t blk, size_t size,
+ char *buf, size_t *rsize)
{
struct bcache_devdata *dd = (struct bcache_devdata *)devdata;
struct bcache *bc = dd->dv_cache;
@@ -197,7 +197,7 @@
}
/* Write the blocks */
- return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf, rsize));
+ return (dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize));
}
/*
@@ -206,8 +206,8 @@
* device I/O and then use the I/O results to populate the cache.
*/
static int
-read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+read_strategy(void *devdata, int rw, daddr_t blk, size_t size,
+ char *buf, size_t *rsize)
{
struct bcache_devdata *dd = (struct bcache_devdata *)devdata;
struct bcache *bc = dd->dv_cache;
@@ -225,7 +225,7 @@
*rsize = 0;
nblk = size / bcache_blksize;
- if ((nblk == 0 && size != 0) || offset != 0)
+ if (nblk == 0 && size != 0)
nblk++;
result = 0;
complete = 1;
@@ -246,8 +246,7 @@
if (complete) { /* whole set was in cache, return it */
if (bc->ra < BCACHE_READAHEAD)
bc->ra <<= 1; /* increase read ahead */
- bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset,
- buf, size);
+ bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size);
goto done;
}
@@ -282,7 +281,7 @@
* in either case we should return the data in bcache and only
* return error if there is no data.
*/
- result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0,
+ result = dd->dv_strategy(dd->dv_devdata, rw, p_blk,
p_size * bcache_blksize, p_buf, &r_size);
r_size /= bcache_blksize;
@@ -307,8 +306,7 @@
size = i * bcache_blksize;
if (size != 0) {
- bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset,
- buf, size);
+ bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size);
result = 0;
}
@@ -323,8 +321,8 @@
* directly to the disk. XXX tune this.
*/
int
-bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size,
+ char *buf, size_t *rsize)
{
struct bcache_devdata *dd = (struct bcache_devdata *)devdata;
struct bcache *bc = dd->dv_cache;
@@ -339,23 +337,16 @@
/* bypass large requests, or when the cache is inactive */
if (bc == NULL ||
- (offset == 0 && ((size * 2 / bcache_blksize) > bcache_nblks))) {
+ ((size * 2 / bcache_blksize) > bcache_nblks)) {
DEBUG("bypass %d from %d", size / bcache_blksize, blk);
bcache_bypasses++;
- return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf,
- rsize));
- }
-
- /* normalize offset */
- while (offset >= bcache_blksize) {
- blk++;
- offset -= bcache_blksize;
+ return (dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize));
}
switch (rw) {
case F_READ:
nblk = size / bcache_blksize;
- if (offset || (size != 0 && nblk == 0))
+ if (size != 0 && nblk == 0)
nblk++; /* read at least one block */
ret = 0;
@@ -366,14 +357,10 @@
if (size <= bcache_blksize)
csize = size;
- else {
+ else
csize = cblk * bcache_blksize;
- if (offset)
- csize -= (bcache_blksize - offset);
- }
- ret = read_strategy(devdata, rw, blk, offset,
- csize, buf+total, &isize);
+ ret = read_strategy(devdata, rw, blk, csize, buf+total, &isize);
/*
* we may have error from read ahead, if we have read some data
@@ -384,8 +371,7 @@
ret = 0;
break;
}
- blk += (offset+isize) / bcache_blksize;
- offset = 0;
+ blk += isize / bcache_blksize;
total += isize;
size -= isize;
nblk = size / bcache_blksize;
@@ -396,7 +382,7 @@
return (ret);
case F_WRITE:
- return write_strategy(devdata, rw, blk, offset, size, buf, rsize);
+ return write_strategy(devdata, rw, blk, size, buf, rsize);
}
return -1;
}
Index: head/sys/boot/common/bootstrap.h
===================================================================
--- head/sys/boot/common/bootstrap.h
+++ head/sys/boot/common/bootstrap.h
@@ -77,8 +77,8 @@
void bcache_add_dev(int);
void *bcache_allocate(void);
void bcache_free(void *);
-int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
- size_t size, char *buf, size_t *rsize);
+int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size,
+ char *buf, size_t *rsize);
/*
* Disk block cache
@@ -86,7 +86,7 @@
struct bcache_devdata
{
int (*dv_strategy)(void *devdata, int rw, daddr_t blk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
void *dv_devdata;
void *dv_cache;
};
Index: head/sys/boot/common/disk.c
===================================================================
--- head/sys/boot/common/disk.c
+++ head/sys/boot/common/disk.c
@@ -178,7 +178,7 @@
dev = (struct disk_devdesc *)d;
od = (struct open_disk *)dev->d_opendata;
- return (dev->d_dev->dv_strategy(dev, F_READ, offset, 0,
+ return (dev->d_dev->dv_strategy(dev, F_READ, offset,
blocks * od->sectorsize, (char *)buf, NULL));
}
@@ -244,7 +244,7 @@
int ret;
od = (struct open_disk *)dev->d_opendata;
- ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, 0,
+ ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset,
blocks * od->sectorsize, buf, NULL);
return (ret);
@@ -257,7 +257,7 @@
int ret;
od = (struct open_disk *)dev->d_opendata;
- ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, 0,
+ ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset,
blocks * od->sectorsize, buf, NULL);
return (ret);
Index: head/sys/boot/common/md.c
===================================================================
--- head/sys/boot/common/md.c
+++ head/sys/boot/common/md.c
@@ -60,7 +60,7 @@
/* devsw I/F */
static int md_init(void);
-static int md_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *);
+static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *);
static int md_open(struct open_file *, ...);
static int md_close(struct open_file *);
static int md_print(int);
@@ -84,7 +84,7 @@
}
static int
-md_strategy(void *devdata, int rw, daddr_t blk, size_t offset, size_t size,
+md_strategy(void *devdata, int rw, daddr_t blk, size_t size,
char *buf, size_t *rsize)
{
struct devdesc *dev = (struct devdesc *)devdata;
Index: head/sys/boot/efi/libefi/efipart.c
===================================================================
--- head/sys/boot/efi/libefi/efipart.c
+++ head/sys/boot/efi/libefi/efipart.c
@@ -41,10 +41,8 @@
static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL;
static int efipart_init(void);
-static int efipart_strategy(void *, int, daddr_t, size_t, size_t, char *,
- size_t *);
-static int efipart_realstrategy(void *, int, daddr_t, size_t, size_t, char *,
- size_t *);
+static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *);
+static int efipart_realstrategy(void *, int, daddr_t, size_t, char *, size_t *);
static int efipart_open(struct open_file *, ...);
static int efipart_close(struct open_file *);
static int efipart_print(int);
@@ -289,8 +287,8 @@
}
static int
-efipart_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size,
+ char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
struct devdesc *dev;
@@ -299,13 +297,12 @@
bcd.dv_strategy = efipart_realstrategy;
bcd.dv_devdata = devdata;
bcd.dv_cache = PD(dev).pd_bcache;
- return (bcache_strategy(&bcd, rw, blk, offset, size,
- buf, rsize));
+ return (bcache_strategy(&bcd, rw, blk, size, buf, rsize));
}
static int
-efipart_realstrategy(void *devdata, int rw, daddr_t blk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+efipart_realstrategy(void *devdata, int rw, daddr_t blk, size_t size,
+ char *buf, size_t *rsize)
{
struct devdesc *dev = (struct devdesc *)devdata;
EFI_BLOCK_IO *blkio;
Index: head/sys/boot/i386/libfirewire/firewire.c
===================================================================
--- head/sys/boot/i386/libfirewire/firewire.c
+++ head/sys/boot/i386/libfirewire/firewire.c
@@ -66,7 +66,7 @@
static int fw_init(void);
static int fw_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int fw_open(struct open_file *f, ...);
static int fw_close(struct open_file *f);
static int fw_print(int verbose);
@@ -210,7 +210,7 @@
}
static int
-fw_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+fw_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
return (EIO);
Index: head/sys/boot/i386/libi386/bioscd.c
===================================================================
--- head/sys/boot/i386/libi386/bioscd.c
+++ head/sys/boot/i386/libi386/bioscd.c
@@ -95,9 +95,9 @@
static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest);
static int bc_init(void);
static int bc_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int bc_realstrategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int bc_open(struct open_file *f, ...);
static int bc_close(struct open_file *f);
static int bc_print(int verbose);
@@ -237,7 +237,7 @@
}
static int
-bc_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bc_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
@@ -248,11 +248,11 @@
bcd.dv_devdata = devdata;
bcd.dv_cache = BC(dev).bc_bcache;
- return (bcache_strategy(&bcd, rw, dblk, offset, size, buf, rsize));
+ return (bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
}
static int
-bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct i386_devdesc *dev;
Index: head/sys/boot/i386/libi386/biosdisk.c
===================================================================
--- head/sys/boot/i386/libi386/biosdisk.c
+++ head/sys/boot/i386/libi386/biosdisk.c
@@ -128,10 +128,10 @@
static int bd_int13probe(struct bdinfo *bd);
static int bd_init(void);
-static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize);
+static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize);
+static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize);
static int bd_open(struct open_file *f, ...);
static int bd_close(struct open_file *f);
static int bd_ioctl(struct open_file *f, u_long cmd, void *data);
@@ -502,7 +502,7 @@
}
static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
@@ -512,12 +512,12 @@
bcd.dv_strategy = bd_realstrategy;
bcd.dv_devdata = devdata;
bcd.dv_cache = BD(dev).bd_bcache;
- return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, offset,
+ return (bcache_strategy(&bcd, rw, dblk + dev->d_offset,
size, buf, rsize));
}
static int
-bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
Index: head/sys/boot/i386/libi386/pxe.c
===================================================================
--- head/sys/boot/i386/libi386/pxe.c
+++ head/sys/boot/i386/libi386/pxe.c
@@ -72,7 +72,7 @@
static int pxe_init(void);
static int pxe_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int pxe_open(struct open_file *f, ...);
static int pxe_close(struct open_file *f);
static int pxe_print(int verbose);
@@ -247,8 +247,8 @@
static int
-pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, size_t size,
- char *buf, size_t *rsize)
+pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
return (EIO);
}
Index: head/sys/boot/mips/beri/loader/beri_disk_cfi.c
===================================================================
--- head/sys/boot/mips/beri/loader/beri_disk_cfi.c
+++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c
@@ -45,7 +45,7 @@
static int beri_cfi_disk_open(struct open_file *, ...);
static int beri_cfi_disk_close(struct open_file *);
static void beri_cfi_disk_cleanup(void);
-static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, size_t,
+static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t,
char *, size_t *);
static int beri_cfi_disk_print(int);
@@ -69,8 +69,8 @@
}
static int
-beri_cfi_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsizep)
+beri_cfi_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsizep)
{
int error;
Index: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
===================================================================
--- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
+++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
@@ -45,7 +45,7 @@
static int beri_sdcard_disk_open(struct open_file *, ...);
static int beri_sdcard_disk_close(struct open_file *);
static void beri_sdcard_disk_cleanup(void);
-static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, size_t,
+static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t,
char *, size_t *);
static int beri_sdcard_disk_print(int);
@@ -69,8 +69,8 @@
}
static int
-beri_sdcard_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsizep)
+beri_sdcard_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsizep)
{
int error;
Index: head/sys/boot/ofw/libofw/ofw_disk.c
===================================================================
--- head/sys/boot/ofw/libofw/ofw_disk.c
+++ head/sys/boot/ofw/libofw/ofw_disk.c
@@ -43,7 +43,7 @@
static int ofwd_init(void);
static int ofwd_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int ofwd_open(struct open_file *f, ...);
static int ofwd_close(struct open_file *f);
static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data);
@@ -83,8 +83,8 @@
}
static int
-ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
struct ofw_devdesc *dp = (struct ofw_devdesc *)devdata;
daddr_t pos;
Index: head/sys/boot/pc98/libpc98/bioscd.c
===================================================================
--- head/sys/boot/pc98/libpc98/bioscd.c
+++ head/sys/boot/pc98/libpc98/bioscd.c
@@ -94,9 +94,9 @@
static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest);
static int bc_init(void);
static int bc_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int bc_realstrategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int bc_open(struct open_file *f, ...);
static int bc_close(struct open_file *f);
static int bc_print(int verbose);
@@ -233,7 +233,7 @@
}
static int
-bc_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bc_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
@@ -244,11 +244,11 @@
bcd.dv_devdata = devdata;
bcd.dv_cache = BC(dev).bc_bcache;
- return (bcache_strategy(&bcd, rw, dblk, offset, size, buf, rsize));
+ return (bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
}
static int
-bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct i386_devdesc *dev;
Index: head/sys/boot/pc98/libpc98/biosdisk.c
===================================================================
--- head/sys/boot/pc98/libpc98/biosdisk.c
+++ head/sys/boot/pc98/libpc98/biosdisk.c
@@ -118,9 +118,9 @@
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int bd_realstrategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int bd_open(struct open_file *f, ...);
static int bd_close(struct open_file *f);
static int bd_print(int verbose);
@@ -746,7 +746,7 @@
}
static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
+bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
@@ -756,12 +756,11 @@
bcd.dv_strategy = bd_realstrategy;
bcd.dv_devdata = devdata;
bcd.dv_cache = BD(dev).bd_bcache;
- return(bcache_strategy(&bcd, rw, dblk+od->od_boff, offset,
- size, buf, rsize));
+ return(bcache_strategy(&bcd, rw, dblk+od->od_boff, size, buf, rsize));
}
static int
-bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset,
+bd_realstrategy(void *devdata, int rw, daddr_t dblk,
size_t size, char *buf, size_t *rsize)
{
struct open_disk *od = (struct open_disk *)(((struct i386_devdesc *)devdata)->d_kind.biosdisk.data);
Index: head/sys/boot/powerpc/kboot/hostdisk.c
===================================================================
--- head/sys/boot/powerpc/kboot/hostdisk.c
+++ head/sys/boot/powerpc/kboot/hostdisk.c
@@ -33,7 +33,7 @@
static int hostdisk_init(void);
static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int hostdisk_open(struct open_file *f, ...);
static int hostdisk_close(struct open_file *f);
static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data);
@@ -58,8 +58,8 @@
}
static int
-hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
struct devdesc *desc = devdata;
daddr_t pos;
Index: head/sys/boot/powerpc/ps3/ps3cdrom.c
===================================================================
--- head/sys/boot/powerpc/ps3/ps3cdrom.c
+++ head/sys/boot/powerpc/ps3/ps3cdrom.c
@@ -46,7 +46,7 @@
static int ps3cdrom_init(void);
static int ps3cdrom_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int ps3cdrom_open(struct open_file *f, ...);
static int ps3cdrom_close(struct open_file *f);
static int ps3cdrom_print(int verbose);
@@ -76,7 +76,7 @@
}
static int ps3cdrom_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize)
+ size_t size, char *buf, size_t *rsize)
{
struct ps3_devdesc *dev = (struct ps3_devdesc *) devdata;
int err;
Index: head/sys/boot/powerpc/ps3/ps3disk.c
===================================================================
--- head/sys/boot/powerpc/ps3/ps3disk.c
+++ head/sys/boot/powerpc/ps3/ps3disk.c
@@ -58,7 +58,7 @@
static int ps3disk_init(void);
static int ps3disk_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int ps3disk_open(struct open_file *f, ...);
static int ps3disk_close(struct open_file *f);
static int ps3disk_print(int verbose);
@@ -109,7 +109,7 @@
}
static int ps3disk_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize)
+ size_t size, char *buf, size_t *rsize)
{
struct ps3_devdesc *dev = (struct ps3_devdesc *) devdata;
struct open_dev *od = (struct open_dev *) dev->d_disk.data;
Index: head/sys/boot/uboot/lib/disk.c
===================================================================
--- head/sys/boot/uboot/lib/disk.c
+++ head/sys/boot/uboot/lib/disk.c
@@ -73,8 +73,7 @@
/* devsw I/F */
static int stor_init(void);
-static int stor_strategy(void *, int, daddr_t, size_t, size_t, char *,
- size_t *);
+static int stor_strategy(void *, int, daddr_t, size_t, char *, size_t *);
static int stor_open(struct open_file *, ...);
static int stor_close(struct open_file *);
static int stor_ioctl(struct open_file *f, u_long cmd, void *data);
@@ -144,7 +143,7 @@
}
static int
-stor_strategy(void *devdata, int rw, daddr_t blk, size_t offset, size_t size,
+stor_strategy(void *devdata, int rw, daddr_t blk, size_t size,
char *buf, size_t *rsize)
{
struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
Index: head/sys/boot/usb/storage/umass_loader.c
===================================================================
--- head/sys/boot/usb/storage/umass_loader.c
+++ head/sys/boot/usb/storage/umass_loader.c
@@ -48,8 +48,7 @@
static int umass_disk_close(struct open_file *);
static void umass_disk_cleanup(void);
static int umass_disk_ioctl(struct open_file *, u_long, void *);
-static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, char *,
- size_t *);
+static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *);
static int umass_disk_print(int);
struct devsw umass_disk = {
@@ -85,8 +84,8 @@
}
static int
-umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsizep)
+umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsizep)
{
if (umass_uaa.device == NULL)
return (ENXIO);
Index: head/sys/boot/userboot/userboot/host.c
===================================================================
--- head/sys/boot/userboot/userboot/host.c
+++ head/sys/boot/userboot/userboot/host.c
@@ -171,8 +171,8 @@
}
static int
-host_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+host_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
return (ENOSYS);
Index: head/sys/boot/userboot/userboot/userboot_disk.c
===================================================================
--- head/sys/boot/userboot/userboot/userboot_disk.c
+++ head/sys/boot/userboot/userboot/userboot_disk.c
@@ -54,9 +54,9 @@
static int userdisk_init(void);
static void userdisk_cleanup(void);
static int userdisk_strategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int userdisk_realstrategy(void *devdata, int flag, daddr_t dblk,
- size_t offset, size_t size, char *buf, size_t *rsize);
+ size_t size, char *buf, size_t *rsize);
static int userdisk_open(struct open_file *f, ...);
static int userdisk_close(struct open_file *f);
static int userdisk_ioctl(struct open_file *f, u_long cmd, void *data);
@@ -189,8 +189,8 @@
}
static int
-userdisk_strategy(void *devdata, int rw, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+userdisk_strategy(void *devdata, int rw, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
struct disk_devdesc *dev;
@@ -199,13 +199,13 @@
bcd.dv_strategy = userdisk_realstrategy;
bcd.dv_devdata = devdata;
bcd.dv_cache = ud_info[dev->d_unit].ud_bcache;
- return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, offset,
+ return (bcache_strategy(&bcd, rw, dblk + dev->d_offset,
size, buf, rsize));
}
static int
-userdisk_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset,
- size_t size, char *buf, size_t *rsize)
+userdisk_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
struct disk_devdesc *dev = devdata;
uint64_t off;
Index: head/sys/boot/zfs/zfs.c
===================================================================
--- head/sys/boot/zfs/zfs.c
+++ head/sys/boot/zfs/zfs.c
@@ -589,7 +589,7 @@
}
static int
-zfs_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, char *buf, size_t *rsize)
+zfs_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize)
{
return (ENOSYS);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 1:19 PM (16 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23570995
Default Alt Text
D8644.id23473.diff (36 KB)
Attached To
Mode
D8644: loader: dosfs can corrupt memory
Attached
Detach File
Event Timeline
Log In to Comment