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?)











share|improve this question




























    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?)











    share|improve this question


























      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?)











      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 at 4:49









      red0ct

      1,1193822




      1,1193822










      asked Nov 11 at 12:22









      rpbear

      394412




      394412
























          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.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            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

























            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.






            share|improve this answer

























              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.






              share|improve this answer























                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 11 at 13:04









                rpbear

                394412




                394412






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Bressuire

                    Vorschmack

                    Quarantine