FIBMAP can be used to determine the physical blocks occupied by a file, given logical blocks obtainable via
stat(); however, root access is required. Why is root access necessary for ascertainment of the disk location of a file, and are there any non-root-requiring mechanisms for obtaining the same information? For the use case that motivates this question, the files are small (about 1 block on average) so knowledge of the physical location of the first block alone would suffice (indirect blocks are certainly unnecessary). On the order of 100,000 such files must be accessed in short order (as fast as possible), and I would like to pre-sort based on disk location before delivery to the I/O scheduler's queue. Sorting by
inode is a possibility that does not require root privileges, but the degree of correspondence between inode number and disk location is probabilistic, implying variation of performance with the strength of that correspondence.