Skip to content
Snippets Groups Projects
Commit ce3d20cf authored by a2-stratford's avatar a2-stratford
Browse files

Removed useless function

parent 89898725
No related branches found
No related tags found
2 merge requests!22Merge Feature/system calls,!6Implemented filesize system call
...@@ -80,33 +80,3 @@ syscall_handler (struct intr_frame *f UNUSED) ...@@ -80,33 +80,3 @@ syscall_handler (struct intr_frame *f UNUSED)
thread_exit(); 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
...@@ -3,6 +3,4 @@ ...@@ -3,6 +3,4 @@
void syscall_init (void); void syscall_init (void);
void file_search(struct file_map *f);
#endif /* userprog/syscall.h */ #endif /* userprog/syscall.h */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment