141k views
0 votes
#define DIRECTN 100

#define INDIRECT1 20
#define INDIRECT2 5
#define PTRBLOCKS 200

typedef struct {
filename[MAXFILELEN];
attributesType attributes; // file attributes
uint32 reference_count; // Number of hard links
uint64 size; // size of file
uint64 direct[DIRECTN]; // direct data blocks
uint64 indirect[INDIRECT1]; // single indirect blocks
uint64 indirect2[INDIRECT2]; // double indirect

} InodeType;

Single and double indirect inodes have the following structure:

typedef struct
{
uint64 block_ptr[PTRBLOCKS];
}
IndirectNodeType;

Required:
Assuming a block size of 0x1000 bytes, write pseudocode to return the block number associated with an offset of N bytes into the file.

User Larsw
by
3.9k points

1 Answer

5 votes

Answer:

WOW! that does not look easy!

Step-by-step explanation:

I wish i could help but i have no idea how to do that lol

User Bwall
by
4.2k points