Skip to contentSkip to conversation

filesystem logical block number

DISCUSSION Yijian Wang 2 participants 2 messages Feb 25, 2004 – Feb 26, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

Does anybody know how to get the logical block numbers of file accesses? i.e. if I want to read some data from a file, how can I know which block numbers I am accessing? Is there any system call?

Thank you!

regards,
Yijian Wang

#1 lore raw

Hello

Quoted 6 lines · Yijian Wang

Hello,

Does anybody know how to get the logical block numbers of file accesses? i.e. if I want to read some data from a file, how can I know which block numbers I am accessing? Is there any system call?

#include <linux/fs.h>

ioctl (fd, FIBMAP, &block)

You have to run this as root, though

Quoted 14 lines

Thank you!

regards,
Yijian Wang

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/