summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortsoome <tsoome@FreeBSD.org>2017-02-06 22:03:07 +0000
committertsoome <tsoome@FreeBSD.org>2017-02-06 22:03:07 +0000
commit006a0cfe945c637c15dd643888c8f6c8ae3127e9 (patch)
tree0692ec06cb70c32b853dcfb84df9b3f6f787b2d2
parentc24e6785098821c4aaf0b543dc091bc2e4e67503 (diff)
downloadFreeBSD-src-006a0cfe945c637c15dd643888c8f6c8ae3127e9.zip
FreeBSD-src-006a0cfe945c637c15dd643888c8f6c8ae3127e9.tar.gz
MFC r309369,310850,310853:
libstand: dosfs cstyle cleanup for return keyword. dosfs support in libstand is broken since r298230 PR: 214423 Submitted by: Mikhail Kupchik Reported by: Mikhail Kupchik Approved by: imp (mentor)
-rw-r--r--lib/libstand/cd9660.c10
-rw-r--r--lib/libstand/dosfs.c142
-rw-r--r--lib/libstand/ext2fs.c12
-rw-r--r--lib/libstand/nandfs.c4
-rw-r--r--lib/libstand/read.c2
-rw-r--r--lib/libstand/stand.h2
-rw-r--r--lib/libstand/ufs.c14
-rw-r--r--lib/libstand/write.c2
-rw-r--r--sys/boot/common/bcache.c50
-rw-r--r--sys/boot/common/bootstrap.h6
-rw-r--r--sys/boot/common/disk.c6
-rw-r--r--sys/boot/common/md.c4
-rw-r--r--sys/boot/efi/libefi/efipart.c17
-rw-r--r--sys/boot/i386/libfirewire/firewire.c4
-rw-r--r--sys/boot/i386/libi386/bioscd.c10
-rw-r--r--sys/boot/i386/libi386/biosdisk.c14
-rw-r--r--sys/boot/i386/libi386/pxe.c6
-rw-r--r--sys/boot/mips/beri/loader/beri_disk_cfi.c6
-rw-r--r--sys/boot/mips/beri/loader/beri_disk_sdcard.c6
-rw-r--r--sys/boot/ofw/libofw/ofw_disk.c6
-rw-r--r--sys/boot/pc98/libpc98/bioscd.c10
-rw-r--r--sys/boot/pc98/libpc98/biosdisk.c11
-rw-r--r--sys/boot/powerpc/kboot/hostdisk.c6
-rw-r--r--sys/boot/powerpc/ps3/ps3cdrom.c4
-rw-r--r--sys/boot/powerpc/ps3/ps3disk.c4
-rw-r--r--sys/boot/uboot/lib/disk.c5
-rw-r--r--sys/boot/usb/storage/umass_loader.c7
-rw-r--r--sys/boot/userboot/userboot/host.c4
-rw-r--r--sys/boot/userboot/userboot/userboot_disk.c14
-rw-r--r--sys/boot/zfs/zfs.c2
30 files changed, 178 insertions, 212 deletions
diff --git a/lib/libstand/cd9660.c b/lib/libstand/cd9660.c
index 5d9b57b..d020e76 100644
--- a/lib/libstand/cd9660.c
+++ b/lib/libstand/cd9660.c
@@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f, const char *identifier,
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 @@ cd9660_open(const char *path, struct open_file *f)
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 @@ cd9660_open(const char *path, struct open_file *f)
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)
@@ -381,7 +381,7 @@ cd9660_open(const char *path, struct open_file *f)
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) {
@@ -438,7 +438,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
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);
diff --git a/lib/libstand/dosfs.c b/lib/libstand/dosfs.c
index 0ab5b97..859a28d 100644
--- a/lib/libstand/dosfs.c
+++ b/lib/libstand/dosfs.c
@@ -154,7 +154,7 @@ static int fatcnt(DOS_FS *, u_int);
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 @@ dos_read_fat(DOS_FS *fs, struct open_file *fd)
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,12 +199,12 @@ dos_mount(DOS_FS *fs, struct open_file *fd)
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);
(void)dosunmount(fs);
- return(err);
+ return (err);
}
free(buf);
@@ -219,7 +219,7 @@ dos_mount(DOS_FS *fs, struct open_file *fd)
fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff;
fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff;
}
- return 0;
+ return (0);
}
/*
@@ -231,10 +231,10 @@ dos_unmount(DOS_FS *fs)
int err;
if (fs->links)
- return(EBUSY);
+ return (EBUSY);
if ((err = dosunmount(fs)))
- return(err);
- return 0;
+ return (err);
+ return (0);
}
/*
@@ -244,7 +244,7 @@ static int
dosunmount(DOS_FS *fs)
{
free(fs);
- return(0);
+ return (0);
}
/*
@@ -285,7 +285,7 @@ dos_open(const char *path, struct open_file *fd)
fd->f_fsdata = (void *)f;
out:
- return(err);
+ return (err);
}
/*
@@ -307,7 +307,7 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid)
twiddle(4);
nb = (u_int)nbyte;
if ((size = fsize(f->fs, &f->de)) == -1)
- return EINVAL;
+ return (EINVAL);
if (nb > (n = size - f->offset))
nb = n;
off = f->offset;
@@ -344,7 +344,7 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid)
out:
if (resid)
*resid = nbyte - nb + cnt;
- return(err);
+ return (err);
}
/*
@@ -370,16 +370,16 @@ dos_seek(struct open_file *fd, off_t offset, int whence)
break;
default:
errno = EINVAL;
- return(-1);
+ return (-1);
}
off += offset;
if (off < 0 || off > size) {
errno = EINVAL;
- return(-1);
+ return (-1);
}
f->offset = (u_int)off;
f->c = 0;
- return(off);
+ return (off);
}
/*
@@ -394,7 +394,7 @@ dos_close(struct open_file *fd)
f->fs->links--;
free(f);
dos_unmount(fs);
- return 0;
+ return (0);
}
/*
@@ -411,7 +411,7 @@ dos_stat(struct open_file *fd, struct stat *sb)
sb->st_uid = 0;
sb->st_gid = 0;
if ((sb->st_size = fsize(f->fs, &f->de)) == -1)
- return EINVAL;
+ return (EINVAL);
return (0);
}
@@ -501,7 +501,7 @@ dos_readdir(struct open_file *fd, struct dirent *d)
d->d_reclen = sizeof(*d);
d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG;
memcpy(d->d_name, fn, sizeof(d->d_name));
- return(0);
+ return (0);
}
/*
@@ -516,41 +516,41 @@ parsebs(DOS_FS *fs, DOS_BS *bs)
bs->jmp[0] != 0xe9 &&
(bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) ||
bs->bpb.media < 0xf0)
- return EINVAL;
+ return (EINVAL);
if (cv2(bs->bpb.secsiz) != SECSIZ)
- return EINVAL;
+ return (EINVAL);
if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1))
- return EINVAL;
+ return (EINVAL);
fs->bsize = secbyt(fs->spc);
fs->bshift = ffs(fs->bsize) - 1;
if ((fs->spf = cv2(bs->bpb.spf))) {
if (bs->bpb.fats != 2)
- return EINVAL;
+ return (EINVAL);
if (!(fs->dirents = cv2(bs->bpb.dirents)))
- return EINVAL;
+ return (EINVAL);
} else {
if (!(fs->spf = cv4(bs->bpb.lspf)))
- return EINVAL;
+ return (EINVAL);
if (!bs->bpb.fats || bs->bpb.fats > 16)
- return EINVAL;
+ return (EINVAL);
if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS)
- return EINVAL;
+ return (EINVAL);
}
if (!(fs->lsnfat = cv2(bs->bpb.ressec)))
- return EINVAL;
+ return (EINVAL);
fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats;
fs->lsndta = fs->lsndir + entsec(fs->dirents);
if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs)))
- return EINVAL;
+ return (EINVAL);
if (fs->lsndta > sc)
- return EINVAL;
+ return (EINVAL);
if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS)
- return EINVAL;
+ return (EINVAL);
fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32;
sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1;
if (fs->xclus > sc)
fs->xclus = sc;
- return 0;
+ return (0);
}
/*
@@ -575,17 +575,17 @@ namede(DOS_FS *fs, const char *path, DOS_DE **dep)
if (!(s = strchr(path, '/')))
s = strchr(path, 0);
if ((n = s - path) > 255)
- return ENAMETOOLONG;
+ return (ENAMETOOLONG);
memcpy(name, path, n);
name[n] = 0;
path = s;
if (!(de->attr & FA_DIR))
- return ENOTDIR;
+ return (ENOTDIR);
if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de)))
- return err;
+ return (err);
}
*dep = de;
- return 0;
+ return (0);
}
/*
@@ -604,7 +604,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
for (ent = 0; ent < 2; ent++)
if (!strcasecmp(name, dotstr[ent])) {
*dep = dot + ent;
- return 0;
+ return (0);
}
if (!clus && fs->fatsz == 32)
clus = fs->rdcl;
@@ -617,13 +617,13 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
else if (okclus(fs, clus))
lsec = blklsn(fs, clus);
else
- return EINVAL;
+ return (EINVAL);
for (sec = 0; sec < nsec; sec++) {
- if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1))))
- return err;
+ if ((err = ioget(fs->fd, lsec + sec, dir, secbyt(1))))
+ return (err);
for (ent = 0; ent < DEPSEC; ent++) {
if (!*dir[ent].de.name)
- return ENOENT;
+ return (ENOENT);
if (*dir[ent].de.name != 0xe5) {
if ((dir[ent].de.attr & FA_MASK) == FA_XDE) {
x = dir[ent].xde.seq;
@@ -651,7 +651,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
}
if (ok) {
*dep = &dir[ent].de;
- return 0;
+ return (0);
}
}
}
@@ -661,11 +661,11 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep)
if (!clus)
break;
if ((err = fatget(fs, &clus)))
- return err;
+ return (err);
if (fatend(fs->fatsz, clus))
break;
}
- return ENOENT;
+ return (ENOENT);
}
/*
@@ -739,11 +739,11 @@ fsize(DOS_FS *fs, DOS_DE *de)
size = fs->dirents * sizeof(DOS_DE);
else {
if ((n = fatcnt(fs, c)) == -1)
- return n;
+ return (n);
size = blkbyt(fs, n);
}
}
- return size;
+ return (size);
}
/*
@@ -756,8 +756,8 @@ fatcnt(DOS_FS *fs, u_int c)
for (n = 0; okclus(fs, c); n++)
if (fatget(fs, &c))
- return -1;
- return fatend(fs->fatsz, c) ? n : -1;
+ return (-1);
+ return (fatend(fs->fatsz, c) ? n : -1);
}
/*
@@ -768,8 +768,7 @@ static int
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 @@ fatget(DOS_FS *fs, u_int *c)
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);
@@ -815,7 +798,7 @@ fatget(DOS_FS *fs, u_int *c)
static int
fatend(u_int sz, u_int c)
{
- return c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7);
+ return (c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7));
}
/*
@@ -827,38 +810,41 @@ ioread(DOS_FS *fs, u_int offset, void *buf, u_int nbyte)
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)))
- return err;
+ 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)))
- return err;
+ 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)))
- return err;
+ if ((err = ioget(fs->fd, bytsec(offset), local_buf, sizeof(local_buf))))
+ return (err);
+ memcpy(s, local_buf, n);
}
- return 0;
+ return (0);
}
/*
* 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));
}
diff --git a/lib/libstand/ext2fs.c b/lib/libstand/ext2fs.c
index bbc3be4..d0b91e0 100644
--- a/lib/libstand/ext2fs.c
+++ b/lib/libstand/ext2fs.c
@@ -355,7 +355,7 @@ ext2fs_open(const char *upath, struct open_file *f)
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 @@ ext2fs_open(const char *upath, struct open_file *f)
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 @@ ext2fs_open(const char *upath, struct open_file *f)
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 @@ read_inode(ino_t inumber, struct open_file *f)
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 @@ block_map(struct open_file *f, daddr_t file_block, daddr_t *disk_block_p)
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 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
} 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;
diff --git a/lib/libstand/nandfs.c b/lib/libstand/nandfs.c
index e530fa6..fe3a8ab 100644
--- a/lib/libstand/nandfs.c
+++ b/lib/libstand/nandfs.c
@@ -1024,7 +1024,7 @@ ioread(struct open_file *f, off_t pos, void *buf, u_int length)
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);
@@ -1045,7 +1045,7 @@ nandfs_probe_sectorsize(struct open_file *f)
for (i = 512; i < (16 * 1024); i <<= 1) {
NANDFS_DEBUG("%d ", i);
- err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, 0, i,
+ err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, i,
buffer, NULL);
if (err == 0) {
diff --git a/lib/libstand/read.c b/lib/libstand/read.c
index 0e47fc2..c165d68 100644
--- a/lib/libstand/read.c
+++ b/lib/libstand/read.c
@@ -79,7 +79,7 @@ read(int fd, void *dest, size_t bcount)
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;
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h
index 238f9ed..541f1db 100644
--- a/lib/libstand/stand.h
+++ b/lib/libstand/stand.h
@@ -139,7 +139,7 @@ struct devsw {
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);
diff --git a/lib/libstand/ufs.c b/lib/libstand/ufs.c
index 21e341f..928a1d1 100644
--- a/lib/libstand/ufs.c
+++ b/lib/libstand/ufs.c
@@ -157,7 +157,7 @@ read_inode(inumber, f)
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 @@ block_map(f, file_block, disk_block_p)
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 @@ buf_write_file(f, buf_p, size_p)
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 @@ buf_write_file(f, buf_p, size_p)
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 @@ buf_read_file(f, buf_p, size_p)
} 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 @@ ufs_open(upath, f)
*/
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 @@ ufs_open(upath, f)
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;
diff --git a/lib/libstand/write.c b/lib/libstand/write.c
index daf33cf..9e02f08 100644
--- a/lib/libstand/write.c
+++ b/lib/libstand/write.c
@@ -82,7 +82,7 @@ write(fd, dest, bcount)
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;
diff --git a/sys/boot/common/bcache.c b/sys/boot/common/bcache.c
index 4bb9082..3023db0 100644
--- a/sys/boot/common/bcache.c
+++ b/sys/boot/common/bcache.c
@@ -182,8 +182,8 @@ bcache_free(void *cache)
* 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_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
}
/* 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 @@ write_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
* 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 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
*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 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
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 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
* 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;
@@ -305,8 +304,7 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
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;
}
@@ -321,8 +319,8 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
* 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;
@@ -337,23 +335,16 @@ bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
/* 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;
@@ -364,14 +355,10 @@ bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
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
@@ -382,8 +369,7 @@ bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
ret = 0;
break;
}
- blk += (offset+isize) / bcache_blksize;
- offset = 0;
+ blk += isize / bcache_blksize;
total += isize;
size -= isize;
nblk = size / bcache_blksize;
@@ -394,7 +380,7 @@ bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
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;
}
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index e15fc6a..472fc3e 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -76,8 +76,8 @@ void bcache_init(u_int nblks, size_t bsize);
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
@@ -85,7 +85,7 @@ int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
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;
};
diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c
index 54626f7..feb0b9d 100644
--- a/sys/boot/common/disk.c
+++ b/sys/boot/common/disk.c
@@ -178,7 +178,7 @@ ptblread(void *d, void *buf, size_t blocks, off_t offset)
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 @@ disk_read(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks)
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 @@ disk_write(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks)
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);
diff --git a/sys/boot/common/md.c b/sys/boot/common/md.c
index e5e8a48..2554b04 100644
--- a/sys/boot/common/md.c
+++ b/sys/boot/common/md.c
@@ -60,7 +60,7 @@ static struct {
/* 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 void md_print(int);
@@ -84,7 +84,7 @@ md_init(void)
}
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;
diff --git a/sys/boot/efi/libefi/efipart.c b/sys/boot/efi/libefi/efipart.c
index aadacf0..f04f095 100644
--- a/sys/boot/efi/libefi/efipart.c
+++ b/sys/boot/efi/libefi/efipart.c
@@ -41,10 +41,8 @@ __FBSDID("$FreeBSD$");
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 void efipart_print(int);
@@ -284,8 +282,8 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, int rw, daddr_t blk, daddr_t nblks,
}
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;
@@ -294,13 +292,12 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
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;
diff --git a/sys/boot/i386/libfirewire/firewire.c b/sys/boot/i386/libfirewire/firewire.c
index 2c7ee32..52f3805 100644
--- a/sys/boot/i386/libfirewire/firewire.c
+++ b/sys/boot/i386/libfirewire/firewire.c
@@ -66,7 +66,7 @@ struct crom_src_buf {
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 void fw_print(int verbose);
@@ -201,7 +201,7 @@ fw_cleanup()
}
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);
diff --git a/sys/boot/i386/libi386/bioscd.c b/sys/boot/i386/libi386/bioscd.c
index 1ea6906..27d33f4 100644
--- a/sys/boot/i386/libi386/bioscd.c
+++ b/sys/boot/i386/libi386/bioscd.c
@@ -95,9 +95,9 @@ static int nbcinfo = 0;
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 void bc_print(int verbose);
@@ -231,7 +231,7 @@ bc_close(struct open_file *f)
}
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;
@@ -242,11 +242,11 @@ bc_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
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;
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index d10555f..2419c6b 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -128,10 +128,10 @@ static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks,
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);
@@ -478,7 +478,7 @@ bd_ioctl(struct open_file *f, u_long cmd, void *data)
}
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;
@@ -488,12 +488,12 @@ bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
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;
diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c
index 844ebf2..c65b9cc 100644
--- a/sys/boot/i386/libi386/pxe.c
+++ b/sys/boot/i386/libi386/pxe.c
@@ -72,7 +72,7 @@ static void bangpxe_call(int func);
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 void pxe_print(int verbose);
@@ -247,8 +247,8 @@ 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)
+pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
return (EIO);
}
diff --git a/sys/boot/mips/beri/loader/beri_disk_cfi.c b/sys/boot/mips/beri/loader/beri_disk_cfi.c
index b2b6d00..d16e01a 100644
--- a/sys/boot/mips/beri/loader/beri_disk_cfi.c
+++ b/sys/boot/mips/beri/loader/beri_disk_cfi.c
@@ -45,7 +45,7 @@ static int beri_cfi_disk_init(void);
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 void beri_cfi_disk_print(int);
@@ -69,8 +69,8 @@ beri_cfi_disk_init(void)
}
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;
diff --git a/sys/boot/mips/beri/loader/beri_disk_sdcard.c b/sys/boot/mips/beri/loader/beri_disk_sdcard.c
index 2577e14..67ba78a 100644
--- a/sys/boot/mips/beri/loader/beri_disk_sdcard.c
+++ b/sys/boot/mips/beri/loader/beri_disk_sdcard.c
@@ -45,7 +45,7 @@ static int beri_sdcard_disk_init(void);
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 void beri_sdcard_disk_print(int);
@@ -69,8 +69,8 @@ beri_sdcard_disk_init(void)
}
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;
diff --git a/sys/boot/ofw/libofw/ofw_disk.c b/sys/boot/ofw/libofw/ofw_disk.c
index 9c46ccc..9b2e11c 100644
--- a/sys/boot/ofw/libofw/ofw_disk.c
+++ b/sys/boot/ofw/libofw/ofw_disk.c
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
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 @@ ofwd_init(void)
}
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;
diff --git a/sys/boot/pc98/libpc98/bioscd.c b/sys/boot/pc98/libpc98/bioscd.c
index 15758cc..f358dab 100644
--- a/sys/boot/pc98/libpc98/bioscd.c
+++ b/sys/boot/pc98/libpc98/bioscd.c
@@ -94,9 +94,9 @@ static int nbcinfo = 0;
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 void bc_print(int verbose);
@@ -227,7 +227,7 @@ bc_close(struct open_file *f)
}
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;
@@ -238,11 +238,11 @@ bc_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
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;
diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c
index 0ceeb7b..01971e7 100644
--- a/sys/boot/pc98/libpc98/biosdisk.c
+++ b/sys/boot/pc98/libpc98/biosdisk.c
@@ -118,9 +118,9 @@ static int bd_printbsdslice(struct open_disk *od, daddr_t offset,
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 void bd_print(int verbose);
@@ -740,7 +740,7 @@ bd_closedisk(struct open_disk *od)
}
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;
@@ -750,12 +750,11 @@ bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size,
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);
diff --git a/sys/boot/powerpc/kboot/hostdisk.c b/sys/boot/powerpc/kboot/hostdisk.c
index ac4534c..2deb956 100644
--- a/sys/boot/powerpc/kboot/hostdisk.c
+++ b/sys/boot/powerpc/kboot/hostdisk.c
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
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 @@ 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)
+hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
+ char *buf, size_t *rsize)
{
struct devdesc *desc = devdata;
daddr_t pos;
diff --git a/sys/boot/powerpc/ps3/ps3cdrom.c b/sys/boot/powerpc/ps3/ps3cdrom.c
index c5019e0..843ecd5 100644
--- a/sys/boot/powerpc/ps3/ps3cdrom.c
+++ b/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 void ps3cdrom_print(int verbose);
@@ -76,7 +76,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)
{
struct ps3_devdesc *dev = (struct ps3_devdesc *) devdata;
int err;
diff --git a/sys/boot/powerpc/ps3/ps3disk.c b/sys/boot/powerpc/ps3/ps3disk.c
index 52a43f1..2247c23 100644
--- a/sys/boot/powerpc/ps3/ps3disk.c
+++ b/sys/boot/powerpc/ps3/ps3disk.c
@@ -58,7 +58,7 @@ static void ps3disk_uuid_letoh(uuid_t *uuid);
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 void ps3disk_print(int verbose);
@@ -109,7 +109,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)
{
struct ps3_devdesc *dev = (struct ps3_devdesc *) devdata;
struct open_dev *od = (struct open_dev *) dev->d_disk.data;
diff --git a/sys/boot/uboot/lib/disk.c b/sys/boot/uboot/lib/disk.c
index 741b1f8..1963274 100644
--- a/sys/boot/uboot/lib/disk.c
+++ b/sys/boot/uboot/lib/disk.c
@@ -73,8 +73,7 @@ static int stor_readdev(struct disk_devdesc *, daddr_t, size_t, char *);
/* 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 @@ stor_cleanup(void)
}
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;
diff --git a/sys/boot/usb/storage/umass_loader.c b/sys/boot/usb/storage/umass_loader.c
index 85b89e8..4311b2b 100644
--- a/sys/boot/usb/storage/umass_loader.c
+++ b/sys/boot/usb/storage/umass_loader.c
@@ -48,8 +48,7 @@ static int umass_disk_open(struct open_file *,...);
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 void umass_disk_print(int);
struct devsw umass_disk = {
@@ -85,8 +84,8 @@ umass_disk_init(void)
}
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);
diff --git a/sys/boot/userboot/userboot/host.c b/sys/boot/userboot/userboot/host.c
index 3320a7f..81858a9 100644
--- a/sys/boot/userboot/userboot/host.c
+++ b/sys/boot/userboot/userboot/host.c
@@ -167,8 +167,8 @@ host_dev_close(struct open_file *f)
}
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);
diff --git a/sys/boot/userboot/userboot/userboot_disk.c b/sys/boot/userboot/userboot/userboot_disk.c
index 56fe7e3..ce7dee5 100644
--- a/sys/boot/userboot/userboot/userboot_disk.c
+++ b/sys/boot/userboot/userboot/userboot_disk.c
@@ -54,9 +54,9 @@ static struct userdisk_info *ud_info;
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);
@@ -176,8 +176,8 @@ userdisk_close(struct open_file *f)
}
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;
@@ -186,13 +186,13 @@ userdisk_strategy(void *devdata, int rw, daddr_t dblk, size_t offset,
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;
diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c
index 229bcac..466d18f 100644
--- a/sys/boot/zfs/zfs.c
+++ b/sys/boot/zfs/zfs.c
@@ -579,7 +579,7 @@ zfs_dev_close(struct open_file *f)
}
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);
OpenPOWER on IntegriCloud