idx->data.length = length;
while (idx->data.sector_cnt < sector_cnt)
{
- size_t sector = bitmap_find_and_set (b);
+ size_t sector = bitmap_scan_and_flip (b, 0, 1, false);
if (sector == BITMAP_ERROR)
goto error;
list_elem *e;
struct inode *idx;
- /* Check whether this inode is already open. */
+ /* Check whether this inode is already open.
+ (A hash table would be better, but the Pintos base code
+ avoids using the hash table so that users are free to modify
+ it at will.) */
for (e = list_begin (&open_inodes); e != list_end (&open_inodes);
e = list_next (e))
{
{
size_t i;
- printf ("Inode %"PRDSNu": %"PRDSNu" bytes, %zd sectors (",
+ printf ("Inode %"PRDSNu": %"PRDSNu" bytes, %zu sectors (",
idx->sector, idx->data.length, idx->data.sector_cnt);
/* This loop could be unsafe for large idx->data.sector_cnt, can