X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ffilesys%2Ffilehdr.h;h=235a1e69dd706b96d5ef81e28e1296ee8bbda5dc;hb=97dcefb4742e13df9eb22c3aa00bb802bdc55c60;hp=32792df804fc9172e03822ea54312e9943f5b7b2;hpb=41cc2728b06b5e1eeb4cf5a4979692640049e047;p=pintos-anon diff --git a/src/filesys/filehdr.h b/src/filesys/filehdr.h index 32792df..235a1e6 100644 --- a/src/filesys/filehdr.h +++ b/src/filesys/filehdr.h @@ -6,14 +6,17 @@ #include "disk.h" #include "off_t.h" +/* Number of direct sector pointers in a file header. */ #define DIRECT_CNT ((DISK_SECTOR_SIZE - sizeof (off_t) * 2) \ / sizeof (disk_sector_t)) +/* File header. + This is both an in-memory and on-disk structure. */ struct filehdr { - off_t length; - size_t sector_cnt; - disk_sector_t sectors[DIRECT_CNT]; + off_t length; /* File size in bytes. */ + size_t sector_cnt; /* File size in sectors. */ + disk_sector_t sectors[DIRECT_CNT]; /* Sectors allocated for file. */ }; struct bitmap;