[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Block size: who decides?




I'm thinking about creating my own custom file system for Linux... mostly 
as an educational exercise. I have a trivial module that registers my new 
file system and that supports an empty function that reads the file 
system's superblock (my function just returns NULL right now). As I think 
about setting up a real superblock I'm realizing that I'll also need to 
write a user space program that initailizes my file system. I understand 
that in my initialization program I can open the appropriate device file 
to read/write the partition directly. What I don't understand is how to 
manage the block/sector sizes.

I suppose it's up to me to decide on the size of my allocation units. 
However, how do I find out, in my userspace program, how large the sectors 
are (perhaps I don't need to know that there)? Also how can my userspace 
program find out how large the partition is?

TIA

Peter

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/