diff options
author | phk <phk@FreeBSD.org> | 2000-04-25 10:51:18 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-04-25 10:51:18 +0000 |
commit | a708c222de7b2882a8f9e471911f7768d353532c (patch) | |
tree | 845969f3fdfdd9a87c329c4f057492cffe310673 /sys/sys | |
parent | 7dbc44ea9253465e587b32df22ba4bef4b564e19 (diff) | |
download | FreeBSD-src-a708c222de7b2882a8f9e471911f7768d353532c.zip FreeBSD-src-a708c222de7b2882a8f9e471911f7768d353532c.tar.gz |
Clone the {b|bio}_offset field, and make sure it is always initialized
in struct bio. Eventually, bio_offset will probably obsolete the
bio_blkno and bio_pblkno fields.
Remove the special hack in atapi-cd.c to determine of bio_offset was valid.
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/bio.h | 2 | ||||
-rw-r--r-- | sys/sys/buf.h | 2 | ||||
-rw-r--r-- | sys/sys/conf.h | 12 | ||||
-rw-r--r-- | sys/sys/linedisc.h | 12 |
4 files changed, 18 insertions, 10 deletions
diff --git a/sys/sys/bio.h b/sys/sys/bio.h index 4a95e88..55a4bc1 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -137,9 +137,9 @@ struct buf { #define b_iodone b_io.bio_done #define b_iodone_chain b_io.bio_done_chain #define b_ioflags b_io.bio_flags -#define b_offset b_io.bio_offset #define b_pblkno b_io.bio_pblkno #define b_resid b_io.bio_resid + off_t b_offset; /* Offset into file. */ LIST_ENTRY(buf) b_hash; /* Hash chain. */ TAILQ_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */ TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */ diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 4a95e88..55a4bc1 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -137,9 +137,9 @@ struct buf { #define b_iodone b_io.bio_done #define b_iodone_chain b_io.bio_done_chain #define b_ioflags b_io.bio_flags -#define b_offset b_io.bio_offset #define b_pblkno b_io.bio_pblkno #define b_resid b_io.bio_resid + off_t b_offset; /* Offset into file. */ LIST_ENTRY(buf) b_hash; /* Hash chain. */ TAILQ_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */ TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */ diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 9052f85..f4ae3d6 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -138,11 +138,15 @@ typedef void devfs_remove_t __P((dev_t dev)); * of surgery, reset the flag and restart all the stuff on the stall * queue. */ -#define DEV_STRATEGY(bp, dummy) \ - do { \ +#define DEV_STRATEGY(bp, dummy) \ + do { \ if ((!(bp)->b_iocmd) || ((bp)->b_iocmd & ((bp)->b_iocmd - 1))) \ - Debugger("d_iocmd botch"); \ - (*devsw((bp)->b_dev)->d_strategy)(&(bp)->b_io); \ + Debugger("d_iocmd botch"); \ + if ((bp)->b_flags & B_PHYS) \ + (bp)->b_io.bio_offset = (bp)->b_offset; \ + else \ + (bp)->b_io.bio_offset = dbtob((bp)->b_blkno); \ + (*devsw((bp)->b_dev)->d_strategy)(&(bp)->b_io); \ } while (0) /* diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h index 9052f85..f4ae3d6 100644 --- a/sys/sys/linedisc.h +++ b/sys/sys/linedisc.h @@ -138,11 +138,15 @@ typedef void devfs_remove_t __P((dev_t dev)); * of surgery, reset the flag and restart all the stuff on the stall * queue. */ -#define DEV_STRATEGY(bp, dummy) \ - do { \ +#define DEV_STRATEGY(bp, dummy) \ + do { \ if ((!(bp)->b_iocmd) || ((bp)->b_iocmd & ((bp)->b_iocmd - 1))) \ - Debugger("d_iocmd botch"); \ - (*devsw((bp)->b_dev)->d_strategy)(&(bp)->b_io); \ + Debugger("d_iocmd botch"); \ + if ((bp)->b_flags & B_PHYS) \ + (bp)->b_io.bio_offset = (bp)->b_offset; \ + else \ + (bp)->b_io.bio_offset = dbtob((bp)->b_blkno); \ + (*devsw((bp)->b_dev)->d_strategy)(&(bp)->b_io); \ } while (0) /* |