Lines Matching refs:bw
958 init_bw(blockwalker *bw) in init_bw() argument
960 bw->bnum = 0; in init_bw()
961 bw->bpdir = EXT2_INIT_BLOCK; in init_bw()
973 walk_bw(filesystem *fs, uint32 nod, blockwalker *bw, int32 *create, uint32 hole) in walk_bw() argument
980 if(bw->bnum >= get_nod(fs, nod)->i_blocks / INOBLK) in walk_bw()
991 if(bw->bpdir == EXT2_INIT_BLOCK) in walk_bw()
993 bkref = &get_nod(fs, nod)->i_block[bw->bpdir = 0]; in walk_bw()
1000 else if(bw->bpdir < EXT2_NDIR_BLOCKS) in walk_bw()
1002 bkref = &get_nod(fs, nod)->i_block[++bw->bpdir]; in walk_bw()
1009 else if(bw->bpdir == EXT2_NDIR_BLOCKS) in walk_bw()
1011 bw->bnum++; in walk_bw()
1012 bw->bpdir = EXT2_IND_BLOCK; in walk_bw()
1013 bw->bpind = 0; in walk_bw()
1015 get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod); in walk_bw()
1017 free_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1018 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1019 bkref = &b[bw->bpind]; in walk_bw()
1026 else if((bw->bpdir == EXT2_IND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1)) in walk_bw()
1028 bw->bpind++; in walk_bw()
1029 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1030 bkref = &b[bw->bpind]; in walk_bw()
1037 else if(bw->bpdir == EXT2_IND_BLOCK) in walk_bw()
1039 bw->bnum += 2; in walk_bw()
1040 bw->bpdir = EXT2_DIND_BLOCK; in walk_bw()
1041 bw->bpind = 0; in walk_bw()
1042 bw->bpdind = 0; in walk_bw()
1044 get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod); in walk_bw()
1046 free_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1047 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1049 b[bw->bpind] = alloc_blk(fs,nod); in walk_bw()
1051 free_blk(fs, b[bw->bpind]); in walk_bw()
1052 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1053 bkref = &b[bw->bpdind]; in walk_bw()
1060 else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpdind < BLOCKSIZE/4 - 1)) in walk_bw()
1062 bw->bpdind++; in walk_bw()
1063 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1064 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1065 bkref = &b[bw->bpdind]; in walk_bw()
1072 else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1)) in walk_bw()
1074 bw->bnum++; in walk_bw()
1075 bw->bpdind = 0; in walk_bw()
1076 bw->bpind++; in walk_bw()
1077 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1079 b[bw->bpind] = alloc_blk(fs,nod); in walk_bw()
1081 free_blk(fs, b[bw->bpind]); in walk_bw()
1082 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1083 bkref = &b[bw->bpdind]; in walk_bw()
1094 else if (bw->bpdir == EXT2_DIND_BLOCK) in walk_bw()
1096 bw->bnum += 3; in walk_bw()
1097 bw->bpdir = EXT2_TIND_BLOCK; in walk_bw()
1098 bw->bpind = 0; in walk_bw()
1099 bw->bpdind = 0; in walk_bw()
1100 bw->bptind = 0; in walk_bw()
1102 get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod); in walk_bw()
1104 free_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1105 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1107 b[bw->bpind] = alloc_blk(fs,nod); in walk_bw()
1109 free_blk(fs, b[bw->bpind]); in walk_bw()
1110 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1112 b[bw->bpdind] = alloc_blk(fs,nod); in walk_bw()
1114 free_blk(fs, b[bw->bpind]); in walk_bw()
1115 b = (uint32*)get_blk(fs, b[bw->bpdind]); in walk_bw()
1116 bkref = &b[bw->bptind]; in walk_bw()
1125 else if ( (bw->bpdir == EXT2_TIND_BLOCK) && in walk_bw()
1126 (bw->bptind < BLOCKSIZE/4 -1) ) in walk_bw()
1128 bw->bptind++; in walk_bw()
1129 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1130 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1131 b = (uint32*)get_blk(fs, b[bw->bpdind]); in walk_bw()
1132 bkref = &b[bw->bptind]; in walk_bw()
1142 else if ( (bw->bpdir == EXT2_TIND_BLOCK) && in walk_bw()
1143 (bw->bpdind < BLOCKSIZE/4 -1) ) in walk_bw()
1145 bw->bnum++; in walk_bw()
1146 bw->bptind = 0; in walk_bw()
1147 bw->bpdind++; in walk_bw()
1148 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1149 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1151 b[bw->bpdind] = alloc_blk(fs,nod); in walk_bw()
1153 free_blk(fs, b[bw->bpind]); in walk_bw()
1154 b = (uint32*)get_blk(fs, b[bw->bpdind]); in walk_bw()
1155 bkref = &b[bw->bptind]; in walk_bw()
1164 else if ( (bw->bpdir == EXT2_TIND_BLOCK) && in walk_bw()
1165 (bw->bpind < BLOCKSIZE/4 - 1) ) in walk_bw()
1167 bw->bnum += 2; in walk_bw()
1168 bw->bpdind = 0; in walk_bw()
1169 bw->bptind = 0; in walk_bw()
1170 bw->bpind++; in walk_bw()
1171 b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]); in walk_bw()
1173 b[bw->bpind] = alloc_blk(fs,nod); in walk_bw()
1175 free_blk(fs, b[bw->bpind]); in walk_bw()
1176 b = (uint32*)get_blk(fs, b[bw->bpind]); in walk_bw()
1178 b[bw->bpdind] = alloc_blk(fs,nod); in walk_bw()
1180 free_blk(fs, b[bw->bpind]); in walk_bw()
1181 b = (uint32*)get_blk(fs, b[bw->bpdind]); in walk_bw()
1182 bkref = &b[bw->bptind]; in walk_bw()
1194 bw->bnum++; in walk_bw()
1199 get_nod(fs, nod)->i_blocks = bw->bnum * INOBLK; in walk_bw()
1208 blockwalker bw, lbw; in extend_blk() local
1210 init_bw(&bw); in extend_blk()
1215 walk_bw(fs, nod, &bw, 0, 0); in extend_blk()
1216 while(walk_bw(fs, nod, &bw, &create, 0) != WALK_END) in extend_blk()
1222 lbw = bw; in extend_blk()
1223 while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) in extend_blk()
1224 lbw = bw; in extend_blk()
1225 bw = lbw; in extend_blk()
1238 if((bk = walk_bw(fs, nod, &bw, &create, !copyb)) == WALK_END) in extend_blk()
1250 blockwalker bw; in add2dir() local
1269 init_bw(&bw); in add2dir()
1270 while((bk = walk_bw(fs, dnod, &bw, 0, 0)) != WALK_END) // for all blocks in dir in add2dir()
1322 blockwalker bw; in find_dir() local
1325 init_bw(&bw); in find_dir()
1326 while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) in find_dir()
1908 blockwalker bw; in swap_goodfs() local
1910 init_bw(&bw); in swap_goodfs()
1911 while((bk = walk_bw(fs, i, &bw, 0, 0)) != WALK_END) in swap_goodfs()
1942 blockwalker bw; in swap_badfs() local
1944 init_bw(&bw); in swap_badfs()
1945 while((bk = walk_bw(fs, i, &bw, 0, 0)) != WALK_END) in swap_badfs()
2161 blockwalker bw; in flist_blocks() local
2163 init_bw(&bw); in flist_blocks()
2164 while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) in flist_blocks()
2174 blockwalker bw; in list_blocks() local
2176 init_bw(&bw); in list_blocks()
2178 while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) in list_blocks()
2187 blockwalker bw; in write_blocks() local
2190 init_bw(&bw); in write_blocks()
2191 while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) in write_blocks()
2216 blockwalker bw; in print_dir() local
2218 init_bw(&bw); in print_dir()
2220 while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END) in print_dir()