#include "filesys/directory.h"
#include "filesys/inode.h"
#include "filesys/filesys.h"
+#include "devices/partition.h"
#include "threads/malloc.h"
/* An open file. */
/* Read sector into bounce buffer, then copy into caller's
buffer. */
sector_idx = inode_byte_to_sector (file->inode, file_ofs);
- disk_read (filesys_disk, sector_idx, file->bounce);
+ partition_read (filesys_partition, sector_idx, file->bounce);
memcpy (buffer + bytes_read, file->bounce + sector_ofs, chunk_size);
/* Advance. */
first. Otherwise we start with a sector of all zeros. */
sector_idx = inode_byte_to_sector (file->inode, file_ofs);
if (sector_ofs > 0 || chunk_size < sector_left)
- disk_read (filesys_disk, sector_idx, file->bounce);
+ partition_read (filesys_partition, sector_idx, file->bounce);
else
memset (file->bounce, 0, DISK_SECTOR_SIZE);
memcpy (file->bounce + sector_ofs, buffer + bytes_written, chunk_size);
- disk_write (filesys_disk, sector_idx, file->bounce);
+ partition_write (filesys_partition, sector_idx, file->bounce);
/* Advance. */
size -= chunk_size;