mirror of
https://github.com/psankar/simplefs.git
synced 2025-07-23 22:15:03 +02:00
Code comments
This commit is contained in:
parent
3ad58de506
commit
a96e3142dd
@ -37,6 +37,7 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Begin writing of Block 0 - Super Block */
|
||||
sb.version = 1;
|
||||
sb.magic = SIMPLEFS_MAGIC;
|
||||
sb.block_size = SIMPLEFS_DEFAULT_BLOCK_SIZE;
|
||||
@ -58,6 +59,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
printf("Super block written succesfully\n");
|
||||
/* End of writing of Block 0 - Super block */
|
||||
|
||||
/* Begin writing of Block 1 - Inode Store */
|
||||
|
||||
root_inode.mode = S_IFDIR;
|
||||
root_inode.inode_no = SIMPLEFS_ROOTDIR_INODE_NUMBER;
|
||||
@ -104,6 +108,9 @@ int main(int argc, char *argv[])
|
||||
printf
|
||||
("inode store padding bytes (after the two inodes) written sucessfully\n");
|
||||
|
||||
/* End of writing of Block 1 - inode Store */
|
||||
|
||||
/* Begin writing of Block 2 - Root Directory datablocks */
|
||||
strcpy(record.filename, welcomefile_name);
|
||||
record.inode_no = WELCOMEFILE_INODE_NUMBER;
|
||||
nbytes = sizeof(record);
|
||||
@ -130,7 +137,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
printf
|
||||
("padding after the rootdirectory children written succesfully\n");
|
||||
/* End of writing of Block 2 - Root directory contents */
|
||||
|
||||
/* Begin writing of Block 3 - Welcome file contents */
|
||||
nbytes = sizeof(welcomefile_body);
|
||||
ret = write(fd, welcomefile_body, nbytes);
|
||||
if (ret != nbytes) {
|
||||
@ -139,6 +148,7 @@ int main(int argc, char *argv[])
|
||||
goto exit;
|
||||
}
|
||||
printf("welcomefilebody has been written succesfully\n");
|
||||
/* End of writing of Block 3 - Welcome file contents */
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user