From 9c272954b2c2e4266cd490e3100439c8a6e3494f Mon Sep 17 00:00:00 2001 From: Alex Stratford <alexander3.stratford@live.uwe.ac.uk> Date: Wed, 4 Dec 2019 15:36:11 +0000 Subject: [PATCH] Removed useless functions --- userprog/syscall.c | 30 ------------------------------ userprog/system_calls.h | 7 ------- 2 files changed, 37 deletions(-) diff --git a/userprog/syscall.c b/userprog/syscall.c index 97ca2bf..eb1f034 100644 --- a/userprog/syscall.c +++ b/userprog/syscall.c @@ -82,34 +82,4 @@ syscall_handler (struct intr_frame *f UNUSED) printf ("WARNING: Invalid Syscall (%d)\n", syscall_number); thread_exit(); } -} - -static struct list *file_list; - -/* Goes through all the files in the file_list and looks for the given file - * Descriptor. Linear search - */ -void file_search(struct file_map *f) { - // Creates a struct to hold the currently checked file - struct file_map *curr_file; - // Creates the list element to test for end of list - struct list_elem *list_element; - *list_element = *list_begin(file_list); - - // Loop to check each file in the linked list in turn - while ((curr_file->file_descriptor != f->file_descriptor) && - (is_tail(list_element) == false) - ) { - // Swaps the list_element for the next one in place - list_element = list_next(list_element); - } - // Copies list_element to current file - curr_file->list_element = *list_element; - // Checks if file has been found returning NULL if not or the file if it has - if (curr_file->file_descriptor != f->file_descriptor) { - f->file = NULL; - } - else { - f = curr_file; - } } \ No newline at end of file diff --git a/userprog/system_calls.h b/userprog/system_calls.h index c1b87c7..1df16bb 100644 --- a/userprog/system_calls.h +++ b/userprog/system_calls.h @@ -4,13 +4,6 @@ #include "filesys/file.c" // Added due to dependency for file // Maps file descriptions to the associated file structure -struct file_map -{ - struct list_elem list_element; // Defined in list.h - int file_descriptor; - struct file *file; // Defined in file.c -}; - /* * Terminates Pintos by calling shutdown_power_off() -- GitLab