Skip to content

Commit

Permalink
correct the term
Browse files Browse the repository at this point in the history
  • Loading branch information
hestati63 committed Dec 31, 2020
1 parent 8f145e7 commit 8e59f2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/vm/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct file_page {
};

void vm_file_init (void);
bool file_map_initializer (struct page *page, enum vm_type type, void *kva);
bool file_backed_initializer (struct page *page, enum vm_type type, void *kva);
void *do_mmap(void *addr, size_t length, int writable,
struct file *file, off_t offset);
void do_munmap (void *va);
Expand Down
26 changes: 13 additions & 13 deletions vm/file.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* file.c: Implementation of memory mapped file object (mmaped object). */
/* file.c: Implementation of memory backed file object (mmaped object). */

#include "vm/vm.h"

static bool file_map_swap_in (struct page *page, void *kva);
static bool file_map_swap_out (struct page *page);
static void file_map_destroy (struct page *page);
static bool file_backed_swap_in (struct page *page, void *kva);
static bool file_backed_swap_out (struct page *page);
static void file_backed_destroy (struct page *page);

/* DO NOT MODIFY this struct */
static const struct page_operations file_ops = {
.swap_in = file_map_swap_in,
.swap_out = file_map_swap_out,
.destroy = file_map_destroy,
.swap_in = file_backed_swap_in,
.swap_out = file_backed_swap_out,
.destroy = file_backed_destroy,
.type = VM_FILE,
};

Expand All @@ -19,9 +19,9 @@ void
vm_file_init (void) {
}

/* Initialize the file mapped page */
/* Initialize the file backed page */
bool
file_map_initializer (struct page *page, enum vm_type type, void *kva) {
file_backed_initializer (struct page *page, enum vm_type type, void *kva) {
/* Set up the handler */
page->operations = &file_ops;

Expand All @@ -30,19 +30,19 @@ file_map_initializer (struct page *page, enum vm_type type, void *kva) {

/* Swap in the page by read contents from the file. */
static bool
file_map_swap_in (struct page *page, void *kva) {
file_backed_swap_in (struct page *page, void *kva) {
struct file_page *file_page UNUSED = &page->file;
}

/* Swap out the page by writeback contents to the file. */
static bool
file_map_swap_out (struct page *page) {
file_backed_swap_out (struct page *page) {
struct file_page *file_page UNUSED = &page->file;
}

/* Destory the file mapped page. PAGE will be freed by the caller. */
/* Destory the file backed page. PAGE will be freed by the caller. */
static void
file_map_destroy (struct page *page) {
file_backed_destroy (struct page *page) {
struct file_page *file_page UNUSED = &page->file;
}

Expand Down

0 comments on commit 8e59f2e

Please sign in to comment.