Calculation of max file size supported in BeFS
up vote
0
down vote
favorite
I'm reading "Practical File System Design with the Be File System", in the BeFS, the "data stream" part of the inode struct looks like this:
struct {
// each block_run(8 byte) is a disk address space which maps from
// at lease 1 block and 65536 block at most
block_run direct[12];
// points to a block which contains block_run of real data
block_run indirect;
// points to a block which contains block_run of indirect blocks
block_run double_indirect;
}
Then this book begin a calculation of the minimum and maximum file size, let's see the minimum one: each direct block_run
maps 1 block
and each indirect maps at least 4K space (512 block_run
's), and each double indirect maps at least 4K space (512 block_run
's), and each block with 1KB size, the minimum file size ends at:
direct blocks = 12K
indirect blocks = 512K (4K indirect block maps 512 block_runs of 1K each)
double-indirect blocks = 1024MB (4K double-indirect page maps 512 indirect pages that map 512 block_runs of 4K each)
I do confused about the double-indirect blocks mapped space, doesn't it should be:
double-indirect blocks = 512 * 512KB (each indirect page maps 512K space?)
c unix linux-kernel filesystems
add a comment |
up vote
0
down vote
favorite
I'm reading "Practical File System Design with the Be File System", in the BeFS, the "data stream" part of the inode struct looks like this:
struct {
// each block_run(8 byte) is a disk address space which maps from
// at lease 1 block and 65536 block at most
block_run direct[12];
// points to a block which contains block_run of real data
block_run indirect;
// points to a block which contains block_run of indirect blocks
block_run double_indirect;
}
Then this book begin a calculation of the minimum and maximum file size, let's see the minimum one: each direct block_run
maps 1 block
and each indirect maps at least 4K space (512 block_run
's), and each double indirect maps at least 4K space (512 block_run
's), and each block with 1KB size, the minimum file size ends at:
direct blocks = 12K
indirect blocks = 512K (4K indirect block maps 512 block_runs of 1K each)
double-indirect blocks = 1024MB (4K double-indirect page maps 512 indirect pages that map 512 block_runs of 4K each)
I do confused about the double-indirect blocks mapped space, doesn't it should be:
double-indirect blocks = 512 * 512KB (each indirect page maps 512K space?)
c unix linux-kernel filesystems
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm reading "Practical File System Design with the Be File System", in the BeFS, the "data stream" part of the inode struct looks like this:
struct {
// each block_run(8 byte) is a disk address space which maps from
// at lease 1 block and 65536 block at most
block_run direct[12];
// points to a block which contains block_run of real data
block_run indirect;
// points to a block which contains block_run of indirect blocks
block_run double_indirect;
}
Then this book begin a calculation of the minimum and maximum file size, let's see the minimum one: each direct block_run
maps 1 block
and each indirect maps at least 4K space (512 block_run
's), and each double indirect maps at least 4K space (512 block_run
's), and each block with 1KB size, the minimum file size ends at:
direct blocks = 12K
indirect blocks = 512K (4K indirect block maps 512 block_runs of 1K each)
double-indirect blocks = 1024MB (4K double-indirect page maps 512 indirect pages that map 512 block_runs of 4K each)
I do confused about the double-indirect blocks mapped space, doesn't it should be:
double-indirect blocks = 512 * 512KB (each indirect page maps 512K space?)
c unix linux-kernel filesystems
I'm reading "Practical File System Design with the Be File System", in the BeFS, the "data stream" part of the inode struct looks like this:
struct {
// each block_run(8 byte) is a disk address space which maps from
// at lease 1 block and 65536 block at most
block_run direct[12];
// points to a block which contains block_run of real data
block_run indirect;
// points to a block which contains block_run of indirect blocks
block_run double_indirect;
}
Then this book begin a calculation of the minimum and maximum file size, let's see the minimum one: each direct block_run
maps 1 block
and each indirect maps at least 4K space (512 block_run
's), and each double indirect maps at least 4K space (512 block_run
's), and each block with 1KB size, the minimum file size ends at:
direct blocks = 12K
indirect blocks = 512K (4K indirect block maps 512 block_runs of 1K each)
double-indirect blocks = 1024MB (4K double-indirect page maps 512 indirect pages that map 512 block_runs of 4K each)
I do confused about the double-indirect blocks mapped space, doesn't it should be:
double-indirect blocks = 512 * 512KB (each indirect page maps 512K space?)
c unix linux-kernel filesystems
c unix linux-kernel filesystems
edited Nov 13 at 4:49
red0ct
1,1193822
1,1193822
asked Nov 11 at 12:22
rpbear
394412
394412
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Hmm,I figured it out after read that chapter many times.The double-indirect block contains a block_run which contains block address,it does NOT contains indirect block address.So the calculation is correct.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Hmm,I figured it out after read that chapter many times.The double-indirect block contains a block_run which contains block address,it does NOT contains indirect block address.So the calculation is correct.
add a comment |
up vote
0
down vote
accepted
Hmm,I figured it out after read that chapter many times.The double-indirect block contains a block_run which contains block address,it does NOT contains indirect block address.So the calculation is correct.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Hmm,I figured it out after read that chapter many times.The double-indirect block contains a block_run which contains block address,it does NOT contains indirect block address.So the calculation is correct.
Hmm,I figured it out after read that chapter many times.The double-indirect block contains a block_run which contains block address,it does NOT contains indirect block address.So the calculation is correct.
answered Nov 11 at 13:04
rpbear
394412
394412
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248713%2fcalculation-of-max-file-size-supported-in-befs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown