summaryrefslogtreecommitdiff
path: root/util-linux/mkfs_minix.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-02-06 00:37:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-02-06 00:37:40 +0000
commitcc24419e98853aede7c652edb3c1c79a9865bdda (patch)
treef7116bb6956d58da976003cfd878f8d762063298 /util-linux/mkfs_minix.c
parentdc485c9da66192a705e4d4a1ea0f8301d72906d6 (diff)
downloadbusybox-w32-cc24419e98853aede7c652edb3c1c79a9865bdda.tar.gz
busybox-w32-cc24419e98853aede7c652edb3c1c79a9865bdda.tar.bz2
busybox-w32-cc24419e98853aede7c652edb3c1c79a9865bdda.zip
minix utils: de-inline bit ops (saves ~130 bytes)
Diffstat (limited to 'util-linux/mkfs_minix.c')
-rw-r--r--util-linux/mkfs_minix.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index e214d288a..59a9e1715 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -142,21 +142,31 @@ static ATTRIBUTE_ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n)
142#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE) 142#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE)
143#define NORM_FIRSTZONE (2 + SB_IMAPS + SB_ZMAPS + INODE_BLOCKS) 143#define NORM_FIRSTZONE (2 + SB_IMAPS + SB_ZMAPS + INODE_BLOCKS)
144 144
145static int bit(const char* a, unsigned i) 145/* Before you ask "where they come from?": */
146/* setbit/clrbit are supplied by sys/param.h */
147
148static int minix_bit(const char* a, unsigned i)
146{ 149{
147 return a[i >> 3] & (1<<(i & 7)); 150 return a[i >> 3] & (1<<(i & 7));
148} 151}
149 152
150/* setbit/clrbit are supplied by sys/param.h */ 153static void minix_setbit(char *a, unsigned i)
154{
155 setbit(a, i);
156}
157static void minix_clrbit(char *a, unsigned i)
158{
159 clrbit(a, i);
160}
151 161
152/* Note: do not assume 0/1, it is 0/nonzero */ 162/* Note: do not assume 0/1, it is 0/nonzero */
153#define zone_in_use(x) bit(zone_map,(x)-SB_FIRSTZONE+1) 163#define zone_in_use(x) minix_bit(zone_map,(x)-SB_FIRSTZONE+1)
154/*#define inode_in_use(x) bit(inode_map,(x))*/ 164/*#define inode_in_use(x) minix_bit(inode_map,(x))*/
155 165
156#define mark_inode(x) setbit(inode_map,(x)) 166#define mark_inode(x) minix_setbit(inode_map,(x))
157#define unmark_inode(x) clrbit(inode_map,(x)) 167#define unmark_inode(x) minix_clrbit(inode_map,(x))
158#define mark_zone(x) setbit(zone_map,(x)-SB_FIRSTZONE+1) 168#define mark_zone(x) minix_setbit(zone_map,(x)-SB_FIRSTZONE+1)
159#define unmark_zone(x) clrbit(zone_map,(x)-SB_FIRSTZONE+1) 169#define unmark_zone(x) minix_clrbit(zone_map,(x)-SB_FIRSTZONE+1)
160 170
161#ifndef BLKGETSIZE 171#ifndef BLKGETSIZE
162# define BLKGETSIZE _IO(0x12,96) /* return device size */ 172# define BLKGETSIZE _IO(0x12,96) /* return device size */