Lines Matching refs:BLOCKSIZE
157 #define BLOCKSIZE 1024
165 // inode block size (why is it != BLOCKSIZE ?!?)
171 #define INOBLK (BLOCKSIZE / INODE_BLOCKSIZE)
538 BLOCKSIZE];
577 #if BLOCKSIZE == 1024
585 #error UNHANDLED BLOCKSIZE
659 for(i = 0; i < BLOCKSIZE/4; i++)
796 unsigned char* b=calloc(1,BLOCKSIZE);
823 return (uint8*)fs + blk*BLOCKSIZE;
848 for(i = 0; i < BLOCKSIZE; i++)
858 if(i == BLOCKSIZE)
1026 else if((bw->bpdir == EXT2_IND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1))
1060 else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpdind < BLOCKSIZE/4 - 1))
1072 else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1))
1126 (bw->bptind < BLOCKSIZE/4 -1) )
1143 (bw->bpdind < BLOCKSIZE/4 -1) )
1165 (bw->bpind < BLOCKSIZE/4 - 1) )
1232 for(i = 0; i < BLOCKSIZE / 4; i++)
1233 if(((int32*)(b + BLOCKSIZE * (amount - create)))[i])
1241 memcpy(get_blk(fs, bk), b + BLOCKSIZE * (amount - create - 1), BLOCKSIZE);
1267 if(reclen > BLOCKSIZE)
1274 for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len))
1310 d->d_rec_len = BLOCKSIZE;
1314 get_nod(fs, dnod)->i_size += BLOCKSIZE;
1331 for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len))
1431 extend_blk(fs, nod, b, rndup(size, BLOCKSIZE) / BLOCKSIZE);
1444 if(!(b = (uint8*)calloc(rndup(size, BLOCKSIZE), 1)))
1448 extend_blk(fs, nod, b, rndup(size, BLOCKSIZE) / BLOCKSIZE);
1701 stats->nblocks += (st.st_size + BLOCKSIZE - 1) / BLOCKSIZE;
1811 BLOCKSIZE/4)
1827 for(i = 0; i < BLOCKSIZE/4; i++)
1828 if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
1831 if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
1835 for(i=0;i < BLOCKSIZE/4 && !done ; i++) {
1837 for(j=0; j<BLOCKSIZE/4;j++) {
1838 if (nblk > ( EXT2_IND_BLOCK + BLOCKSIZE/4 +
1839 (BLOCKSIZE/4)*(BLOCKSIZE/4) +
1840 i*(BLOCKSIZE/4)*(BLOCKSIZE/4) +
1841 j*(BLOCKSIZE/4)) )
1868 if(nblk <= EXT2_DIND_BLOCK + BLOCKSIZE/4)
1873 for(i = 0; i < BLOCKSIZE/4; i++)
1874 if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
1876 if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
1881 for(i=0;i < BLOCKSIZE/4 && !done ; i++) {
1884 for(j=0; j<BLOCKSIZE/4;j++) {
1885 if (nblk > ( EXT2_IND_BLOCK + BLOCKSIZE/4 +
1886 (BLOCKSIZE/4)*(BLOCKSIZE/4) +
1887 i*(BLOCKSIZE/4)*(BLOCKSIZE/4) +
1888 j*(BLOCKSIZE/4)) )
1917 for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + swab16(d->d_rec_len)))
1951 for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len))
1989 first_block = (BLOCKSIZE == 1024);
1994 (BLOCKSIZE/sizeof(inode)));
1998 gdsz = rndup(nbgroups*sizeof(groupdescriptor),BLOCKSIZE)/BLOCKSIZE;
1999 itblsz = nbinodes_per_group * sizeof(inode)/BLOCKSIZE;
2006 if(!(fs = (filesystem*)calloc(nbblocks, BLOCKSIZE)))
2016 fs->sb.s_log_block_size = BLOCKSIZE >> 11;
2017 fs->sb.s_log_frag_size = BLOCKSIZE >> 11;
2056 + overhead_per_group + 1; j <= BLOCKSIZE * 8; j++)
2065 for(j = fs->sb.s_inodes_per_group+1; j <= BLOCKSIZE * 8; j++)
2084 itab0[EXT2_ROOT_INO-1].i_size = BLOCKSIZE;
2096 d->d_rec_len = BLOCKSIZE - (sizeof(directory)+4);
2105 memset(b, 0, BLOCKSIZE);
2106 ((directory*)b)->d_rec_len = BLOCKSIZE;
2114 get_nod(fs, nod)->i_size = fs->sb.s_r_blocks_count * BLOCKSIZE;
2138 fssize = (fssize + BLOCKSIZE - 1) / BLOCKSIZE;
2141 if(!(fs = (filesystem*)calloc(fssize, BLOCKSIZE)))
2143 if(fread(fs, BLOCKSIZE, fssize, fh) != fssize)
2181 printf("\n%d blocks (%d bytes)\n", bn, bn * BLOCKSIZE);
2196 if(fwrite(get_blk(fs, bk), (fsize > BLOCKSIZE) ? BLOCKSIZE : fsize, 1, f) != 1)
2198 fsize -= BLOCKSIZE;
2226 for(d = (directory*)b; (int8*)d + sizeof(*d) < (int8*)b + BLOCKSIZE; d = (directory*)((int8*)d + d->d_rec_len))
2399 (int)(fs->sb.s_inodes_per_group * sizeof(inode) / BLOCKSIZE));
2423 if(fwrite(fs, BLOCKSIZE, nbblocks, fh) < nbblocks)
2682 int tmp_nbinodes = nbblocks * BLOCKSIZE / bytes_per_inode;
2697 memset(get_blk(fs, b), emptyval, BLOCKSIZE);