Rename some #defines such as MAX_BLOCK_SIZE to _MAX_BLOCK_SIZE and such
so as to not pollute application namespace.
This commit is contained in:
@@ -17,19 +17,19 @@
|
||||
EXTERN struct buf {
|
||||
/* Data portion of the buffer. */
|
||||
union {
|
||||
char b__data[MAX_BLOCK_SIZE]; /* ordinary user data */
|
||||
char b__data[_MAX_BLOCK_SIZE]; /* ordinary user data */
|
||||
/* directory block */
|
||||
struct direct b__dir[NR_DIR_ENTRIES(MAX_BLOCK_SIZE)];
|
||||
struct direct b__dir[NR_DIR_ENTRIES(_MAX_BLOCK_SIZE)];
|
||||
/* V1 indirect block */
|
||||
zone1_t b__v1_ind[V1_INDIRECTS];
|
||||
/* V2 indirect block */
|
||||
zone_t b__v2_ind[V2_INDIRECTS(MAX_BLOCK_SIZE)];
|
||||
zone_t b__v2_ind[V2_INDIRECTS(_MAX_BLOCK_SIZE)];
|
||||
/* V1 inode block */
|
||||
d1_inode b__v1_ino[V1_INODES_PER_BLOCK];
|
||||
/* V2 inode block */
|
||||
d2_inode b__v2_ino[V2_INODES_PER_BLOCK(MAX_BLOCK_SIZE)];
|
||||
d2_inode b__v2_ino[V2_INODES_PER_BLOCK(_MAX_BLOCK_SIZE)];
|
||||
/* bit map block */
|
||||
bitchunk_t b__bitmap[FS_BITMAP_CHUNKS(MAX_BLOCK_SIZE)];
|
||||
bitchunk_t b__bitmap[FS_BITMAP_CHUNKS(_MAX_BLOCK_SIZE)];
|
||||
} b;
|
||||
|
||||
/* Header portion of the buffer. */
|
||||
|
||||
@@ -77,10 +77,10 @@
|
||||
#define V1_INODE_SIZE usizeof (d1_inode) /* bytes in V1 dsk ino */
|
||||
|
||||
/* # zones/indir block */
|
||||
#define V1_INDIRECTS (STATIC_BLOCK_SIZE/V1_ZONE_NUM_SIZE)
|
||||
#define V1_INDIRECTS (_STATIC_BLOCK_SIZE/V1_ZONE_NUM_SIZE)
|
||||
|
||||
/* # V1 dsk inodes/blk */
|
||||
#define V1_INODES_PER_BLOCK (STATIC_BLOCK_SIZE/V1_INODE_SIZE)
|
||||
#define V1_INODES_PER_BLOCK (_STATIC_BLOCK_SIZE/V1_INODE_SIZE)
|
||||
|
||||
/* Derived sizes pertaining to the V2 file system. */
|
||||
#define V2_ZONE_NUM_SIZE usizeof (zone_t) /* # bytes in V2 zone */
|
||||
|
||||
@@ -271,7 +271,7 @@ PRIVATE void load_ram(void)
|
||||
struct super_block *sp, *dsp;
|
||||
block_t b;
|
||||
Dev_t image_dev;
|
||||
static char sbbuf[MIN_BLOCK_SIZE];
|
||||
static char sbbuf[_MIN_BLOCK_SIZE];
|
||||
int block_size_image, block_size_ram, ramfs_block_size;
|
||||
int s;
|
||||
|
||||
@@ -408,20 +408,20 @@ PRIVATE void load_ram(void)
|
||||
|
||||
/* Resize the RAM disk root file system. */
|
||||
if (dev_io(DEV_READ, root_dev, FS_PROC_NR,
|
||||
sbbuf, SUPER_BLOCK_BYTES, MIN_BLOCK_SIZE, 0) != MIN_BLOCK_SIZE) {
|
||||
sbbuf, SUPER_BLOCK_BYTES, _MIN_BLOCK_SIZE, 0) != _MIN_BLOCK_SIZE) {
|
||||
printf("WARNING: ramdisk read for resizing failed\n");
|
||||
}
|
||||
dsp = (struct super_block *) sbbuf;
|
||||
if (dsp->s_magic == SUPER_V3)
|
||||
ramfs_block_size = dsp->s_block_size;
|
||||
else
|
||||
ramfs_block_size = STATIC_BLOCK_SIZE;
|
||||
ramfs_block_size = _STATIC_BLOCK_SIZE;
|
||||
zones = (ram_size_kb * 1024 / ramfs_block_size) >> sp->s_log_zone_size;
|
||||
|
||||
dsp->s_nzones = conv2(sp->s_native, (u16_t) zones);
|
||||
dsp->s_zones = conv4(sp->s_native, zones);
|
||||
if (dev_io(DEV_WRITE, root_dev, FS_PROC_NR,
|
||||
sbbuf, SUPER_BLOCK_BYTES, MIN_BLOCK_SIZE, 0) != MIN_BLOCK_SIZE) {
|
||||
sbbuf, SUPER_BLOCK_BYTES, _MIN_BLOCK_SIZE, 0) != _MIN_BLOCK_SIZE) {
|
||||
printf("WARNING: ramdisk write for resizing failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ PUBLIC int get_block_size(dev_t dev)
|
||||
}
|
||||
|
||||
/* no mounted filesystem? use this block size then. */
|
||||
return MIN_BLOCK_SIZE;
|
||||
return _MIN_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -214,14 +214,14 @@ register struct super_block *sp; /* pointer to a superblock */
|
||||
dev_t dev;
|
||||
int magic;
|
||||
int version, native, r;
|
||||
static char sbbuf[MIN_BLOCK_SIZE];
|
||||
static char sbbuf[_MIN_BLOCK_SIZE];
|
||||
|
||||
dev = sp->s_dev; /* save device (will be overwritten by copy) */
|
||||
if (dev == NO_DEV)
|
||||
panic(__FILE__,"request for super_block of NO_DEV", NO_NUM);
|
||||
r = dev_io(DEV_READ, dev, FS_PROC_NR,
|
||||
sbbuf, SUPER_BLOCK_BYTES, MIN_BLOCK_SIZE, 0);
|
||||
if (r != MIN_BLOCK_SIZE) {
|
||||
sbbuf, SUPER_BLOCK_BYTES, _MIN_BLOCK_SIZE, 0);
|
||||
if (r != _MIN_BLOCK_SIZE) {
|
||||
return EINVAL;
|
||||
}
|
||||
memcpy(sp, sbbuf, sizeof(*sp));
|
||||
@@ -265,28 +265,28 @@ register struct super_block *sp; /* pointer to a superblock */
|
||||
* hide some of the differences.
|
||||
*/
|
||||
if (version == V1) {
|
||||
sp->s_block_size = STATIC_BLOCK_SIZE;
|
||||
sp->s_block_size = _STATIC_BLOCK_SIZE;
|
||||
sp->s_zones = sp->s_nzones; /* only V1 needs this copy */
|
||||
sp->s_inodes_per_block = V1_INODES_PER_BLOCK;
|
||||
sp->s_ndzones = V1_NR_DZONES;
|
||||
sp->s_nindirs = V1_INDIRECTS;
|
||||
} else {
|
||||
if (version == V2)
|
||||
sp->s_block_size = STATIC_BLOCK_SIZE;
|
||||
if (sp->s_block_size < MIN_BLOCK_SIZE)
|
||||
sp->s_block_size = _STATIC_BLOCK_SIZE;
|
||||
if (sp->s_block_size < _MIN_BLOCK_SIZE)
|
||||
return EINVAL;
|
||||
sp->s_inodes_per_block = V2_INODES_PER_BLOCK(sp->s_block_size);
|
||||
sp->s_ndzones = V2_NR_DZONES;
|
||||
sp->s_nindirs = V2_INDIRECTS(sp->s_block_size);
|
||||
}
|
||||
|
||||
if (sp->s_block_size < MIN_BLOCK_SIZE) {
|
||||
if (sp->s_block_size < _MIN_BLOCK_SIZE) {
|
||||
return EINVAL;
|
||||
}
|
||||
if (sp->s_block_size > MAX_BLOCK_SIZE) {
|
||||
if (sp->s_block_size > _MAX_BLOCK_SIZE) {
|
||||
printf("Filesystem block size is %d kB; maximum filesystem\n"
|
||||
"block size is %d kB. This limit can be increased by recompiling.\n",
|
||||
sp->s_block_size/1024, MAX_BLOCK_SIZE/1024);
|
||||
sp->s_block_size/1024, _MAX_BLOCK_SIZE/1024);
|
||||
return EINVAL;
|
||||
}
|
||||
if ((sp->s_block_size % 512) != 0) {
|
||||
|
||||
@@ -241,6 +241,6 @@ PUBLIC void zero_block(bp)
|
||||
register struct buf *bp; /* pointer to buffer to zero */
|
||||
{
|
||||
/* Zero a block. */
|
||||
memset(bp->b_data, 0, MAX_BLOCK_SIZE);
|
||||
memset(bp->b_data, 0, _MAX_BLOCK_SIZE);
|
||||
bp->b_dirt = DIRTY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user