From: Ben Pfaff Date: Fri, 19 May 2006 20:43:25 +0000 (+0000) Subject: Add file_get_inode() for symmetry with dir_get_inode(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc00f2406d6d263b980d6e2cdd7291749ea49aa8;p=pintos-anon Add file_get_inode() for symmetry with dir_get_inode(). --- diff --git a/src/filesys/file.c b/src/filesys/file.c index 029d8ce..d5fc10d 100644 --- a/src/filesys/file.c +++ b/src/filesys/file.c @@ -53,6 +53,13 @@ file_close (struct file *file) } } +/* Returns the inode encapsulated by FILE. */ +struct inode * +file_get_inode (struct file *file) +{ + return file->inode; +} + /* Reads SIZE bytes from FILE into BUFFER, starting at the file's current position. Returns the number of bytes actually read, diff --git a/src/filesys/file.h b/src/filesys/file.h index dc05332..a33c5af 100644 --- a/src/filesys/file.h +++ b/src/filesys/file.h @@ -9,6 +9,7 @@ struct inode; struct file *file_open (struct inode *); struct file *file_reopen (struct file *); void file_close (struct file *); +struct inode *file_get_inode (struct file *); /* Reading and writing. */ off_t file_read (struct file *, void *, off_t);