Make the conversion macros more consistent.

This commit is contained in:
mycroft 1994-10-09 13:20:37 +00:00
parent 18830ce0ea
commit ebbc8e0476

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)param.h 5.8 (Berkeley) 6/28/91
* $Id: param.h,v 1.20 1994/08/24 19:32:36 mycroft Exp $
* $Id: param.h,v 1.21 1994/10/09 13:20:37 mycroft Exp $
*/
/*
@ -121,19 +121,16 @@
#define LABELOFFSET 0 /* offset of label in sector */
/* pages ("clicks") (4096 bytes) to disk blocks */
#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
#define dtob(x) ((x) << DEV_BSHIFT)
#define ctob(x) ((x) << PGSHIFT)
#define ctod(x) ((unsigned)(x) << (PGSHIFT - DEV_BSHIFT))
#define dtoc(x) ((unsigned)(x) >> (PGSHIFT - DEV_BSHIFT))
/* bytes to pages */
#define ctob(x) ((unsigned)(x) << PGSHIFT)
#define btoc(x) (((unsigned)(x) + PGOFSET) >> PGSHIFT)
#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
((unsigned)(bytes) >> DEV_BSHIFT)
#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
((unsigned)(db) << DEV_BSHIFT)
/* bytes to disk blocks */
#define dbtob(x) ((unsigned)(x) << DEV_BSHIFT)
#define btodb(x) ((unsigned)(x) >> DEV_BSHIFT)
/*
* Map a ``block device block'' to a file system block.