Пример #1
0
/*! Initializes the file system module.
    If FORMAT is true, reformats the file system. */
void filesys_init(bool format) {
    fs_device = block_get_role(BLOCK_FILESYS);
    if (fs_device == NULL)
        PANIC("No file system device found, can't initialize file system.");

    inode_init();
    free_map_init();

    if (format) 
        do_format();

    free_map_open();
}
Пример #2
0
/* Initializes the file system module.
   If FORMAT is true, reformats the file system. */
void
filesys_init (bool format) 
{
  filesys_disk = disk_get (0, 1);
  if (filesys_disk == NULL)
    PANIC ("hd0:1 (hdb) not present, file system initialization failed");

  inode_init ();
  free_map_init ();

  if (format) 
    do_format ();

  free_map_open ();
}
/* Initializes the file system module.
   If FORMAT is true, reformats the file system. */
void
filesys_init (bool format) 
{
  fs_device = block_get_role (BLOCK_FILESYS);
  if (fs_device == NULL)
    PANIC ("No file system device found, can't initialize file system.");

  inode_init ();
  // XXX Lock Initialize
  lock = (struct lock *)malloc(sizeof(struct lock));
  lock_init(lock);
  // XXX
  free_map_init ();

  if (format) 
    do_format ();

  free_map_open ();
}
Пример #4
0
/* Initializes the file system module.
   If FORMAT is true, reformats the file system. */
void
filesys_init (bool format) 
{
  fs_device = block_get_role (BLOCK_FILESYS);
  if (fs_device == NULL)
    PANIC ("No file system device found, can't initialize file system.");

  lock_init(&globalCacheLock);
  cache_init((struct cache_elem **) &cache);
  clock_hand = CACHE_SIZE - 1;

  inode_init ();
  free_map_init ();

  if (format) 
    do_format ();

  free_map_open ();
}
Пример #5
0
/* Initializes the file system module.
   If FORMAT is true, reformats the file system. */
void
filesys_init (bool format)
{
    fs_device = block_get_role (BLOCK_FILESYS);
    if (fs_device == NULL)
        PANIC ("No file system device found, can't initialize file system.");

    inode_init ();
    free_map_init ();
    cache_init ();

    if (format)
        do_format ();

    free_map_open ();

    /* Couldn't add to thread_init because we need inode_init completed
       before we can get access to root directory */
    thread_current ()->cwd_sector = ROOT_DIR_SECTOR;
}
Пример #6
0
/* Initializes the file system module.
   If FORMAT is true, reformats the file system. */
void
filesys_init (bool format)
{
  fs_device = block_get_role (BLOCK_FILESYS);

  if (fs_device == NULL)
    PANIC ("No file system device found, can't initialize file system.");

  fs_cache = cache_create (fs_device, MAX_CACHE_SIZE);
  if (fs_cache == NULL)
    PANIC ("Cannot create cache for file system");

  inode_init ();
  free_map_init ();

  if (format)
    do_format ();

  free_map_open ();
}
Пример #7
0
/* Initializes the file system module.
   If FORMAT is true, reformats the file system. */
void
filesys_init (bool format) 
{
  fs_device = block_get_role (BLOCK_FILESYS);
  if (fs_device == NULL)
    PANIC ("No file system device found, can't initialize file system.");

  filesys_lock_list = malloc(sizeof(filesys_lock_list) * block_size(fs_device));
    int i;
    for(i=0; i < block_size(fs_device); ++i) {
      lock_init(filesys_lock_list + i);
    }

    inode_init();
    free_map_init();

    if (format) 
        do_format();

  free_map_open ();
}