Getting sector number from inode or address_space mapping Unicorn Meta Zoo #1: Why another...

Why doesn't the university give past final exams' answers?

Is there a way to fake a method response using Mock or Stubs?

Co-worker works way more than he should

Why did Israel vote against lifting the American embargo on Cuba?

Did war bonds have better investment alternatives during WWII?

What to do with someone that cheated their way though university and a PhD program?

Putting Ant-Man on house arrest

Coin Game with infinite paradox

Like totally amazing interchangeable sister outfit accessory swapping or whatever

What's called a person who works as someone who puts products on shelves in stores?

Could a cockatrice have parasitic embryos?

What *exactly* is electrical current, voltage, and resistance?

When I export an AI 300x60 art board it saves with bigger dimensions

A journey... into the MIND

How long can a nation maintain a technological edge over the rest of the world?

Is Bran literally the world's memory?

Was there ever a LEGO store in Miami International Airport?

What is the evidence that custom checks in Northern Ireland are going to result in violence?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Will temporary Dex penalties prevent you from getting the benefits of the "Two Weapon Fighting" feat if your Dex score falls below the prerequisite?

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

Determinant of a matrix with 2 equal rows

Will I be more secure with my own router behind my ISP's router?

When speaking, how do you change your mind mid-sentence?



Getting sector number from inode or address_space mapping



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionDisk problems prevent me from booting, or set the disk to read-only. How do I fix the disk?Stat, Blocks and Sector size - ext4How to extract raw ext3 inode data from disk?How to use the new Ext4 Inline Data feature ? (storing data directly in the inode)Disk usage in stat output and inodeHow can I zero the unused blocks on my filesystem in order to minimize the compressed disk image size?How can I find the last sector used by an ext4 filesystem?Filesystem design: necessity of inode number and tableHow do inode numbers from ls -i relate to inodes on diskCan ext4 filesystem withstand a bad sector (unreadable)?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















In am trying to understand how to calculate a sector number from an inode in the ext4 filesystem. Therefore, I am reading ext4_mpage_readpages function.



About the function:
During a read request, if the page is not found in the page cache, a new page is allocated and added to the page cache. After that, the above function is called to get the data from the disk and fill it in the page.



I know that the size of a page is 4096 bytes, and that blocks are of 512 bytes (therefore, a page consists of 8 blocks). From what I understood, the above function maps the block numbers to pages in blocks[page_block] at these places: here and here. After mapping the blocks, the function allocates a bio, assigns the sector to read from, and calls the generic_make_request() to read the data from the disk.



I am getting confused in understanding how the above function calculates sector given an address_space mapping. Is there any other way to get a sector number from an inode in ext4 filesystem?










share|improve this question

























  • If you want to understand the layout, this guide should help.

    – Wumpus Q. Wumbley
    3 hours ago


















1















In am trying to understand how to calculate a sector number from an inode in the ext4 filesystem. Therefore, I am reading ext4_mpage_readpages function.



About the function:
During a read request, if the page is not found in the page cache, a new page is allocated and added to the page cache. After that, the above function is called to get the data from the disk and fill it in the page.



I know that the size of a page is 4096 bytes, and that blocks are of 512 bytes (therefore, a page consists of 8 blocks). From what I understood, the above function maps the block numbers to pages in blocks[page_block] at these places: here and here. After mapping the blocks, the function allocates a bio, assigns the sector to read from, and calls the generic_make_request() to read the data from the disk.



I am getting confused in understanding how the above function calculates sector given an address_space mapping. Is there any other way to get a sector number from an inode in ext4 filesystem?










share|improve this question

























  • If you want to understand the layout, this guide should help.

    – Wumpus Q. Wumbley
    3 hours ago














1












1








1








In am trying to understand how to calculate a sector number from an inode in the ext4 filesystem. Therefore, I am reading ext4_mpage_readpages function.



About the function:
During a read request, if the page is not found in the page cache, a new page is allocated and added to the page cache. After that, the above function is called to get the data from the disk and fill it in the page.



I know that the size of a page is 4096 bytes, and that blocks are of 512 bytes (therefore, a page consists of 8 blocks). From what I understood, the above function maps the block numbers to pages in blocks[page_block] at these places: here and here. After mapping the blocks, the function allocates a bio, assigns the sector to read from, and calls the generic_make_request() to read the data from the disk.



I am getting confused in understanding how the above function calculates sector given an address_space mapping. Is there any other way to get a sector number from an inode in ext4 filesystem?










share|improve this question
















In am trying to understand how to calculate a sector number from an inode in the ext4 filesystem. Therefore, I am reading ext4_mpage_readpages function.



About the function:
During a read request, if the page is not found in the page cache, a new page is allocated and added to the page cache. After that, the above function is called to get the data from the disk and fill it in the page.



I know that the size of a page is 4096 bytes, and that blocks are of 512 bytes (therefore, a page consists of 8 blocks). From what I understood, the above function maps the block numbers to pages in blocks[page_block] at these places: here and here. After mapping the blocks, the function allocates a bio, assigns the sector to read from, and calls the generic_make_request() to read the data from the disk.



I am getting confused in understanding how the above function calculates sector given an address_space mapping. Is there any other way to get a sector number from an inode in ext4 filesystem?







filesystems linux-kernel ext4 disk block-device






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago







bvsravikiran

















asked 4 hours ago









bvsravikiranbvsravikiran

113




113













  • If you want to understand the layout, this guide should help.

    – Wumpus Q. Wumbley
    3 hours ago



















  • If you want to understand the layout, this guide should help.

    – Wumpus Q. Wumbley
    3 hours ago

















If you want to understand the layout, this guide should help.

– Wumpus Q. Wumbley
3 hours ago





If you want to understand the layout, this guide should help.

– Wumpus Q. Wumbley
3 hours ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f514135%2fgetting-sector-number-from-inode-or-address-space-mapping%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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%2funix.stackexchange.com%2fquestions%2f514135%2fgetting-sector-number-from-inode-or-address-space-mapping%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

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m