mirror of
https://github.com/psankar/simplefs.git
synced 2025-07-25 06:54:50 +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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Begin writing of Block 0 - Super Block */
|
||||||
sb.version = 1;
|
sb.version = 1;
|
||||||
sb.magic = SIMPLEFS_MAGIC;
|
sb.magic = SIMPLEFS_MAGIC;
|
||||||
sb.block_size = SIMPLEFS_DEFAULT_BLOCK_SIZE;
|
sb.block_size = SIMPLEFS_DEFAULT_BLOCK_SIZE;
|
||||||
@ -58,6 +59,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("Super block written succesfully\n");
|
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.mode = S_IFDIR;
|
||||||
root_inode.inode_no = SIMPLEFS_ROOTDIR_INODE_NUMBER;
|
root_inode.inode_no = SIMPLEFS_ROOTDIR_INODE_NUMBER;
|
||||||
@ -104,6 +108,9 @@ int main(int argc, char *argv[])
|
|||||||
printf
|
printf
|
||||||
("inode store padding bytes (after the two inodes) written sucessfully\n");
|
("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);
|
strcpy(record.filename, welcomefile_name);
|
||||||
record.inode_no = WELCOMEFILE_INODE_NUMBER;
|
record.inode_no = WELCOMEFILE_INODE_NUMBER;
|
||||||
nbytes = sizeof(record);
|
nbytes = sizeof(record);
|
||||||
@ -130,7 +137,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
printf
|
printf
|
||||||
("padding after the rootdirectory children written succesfully\n");
|
("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);
|
nbytes = sizeof(welcomefile_body);
|
||||||
ret = write(fd, welcomefile_body, nbytes);
|
ret = write(fd, welcomefile_body, nbytes);
|
||||||
if (ret != nbytes) {
|
if (ret != nbytes) {
|
||||||
@ -139,6 +148,7 @@ int main(int argc, char *argv[])
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
printf("welcomefilebody has been written succesfully\n");
|
printf("welcomefilebody has been written succesfully\n");
|
||||||
|
/* End of writing of Block 3 - Welcome file contents */
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user