* Mapping anomalous blocksizes blksize
@ 2012-06-21 18:04 Dan Luedtke
0 siblings, 0 replies; only message in thread
From: Dan Luedtke @ 2012-06-21 18:04 UTC (permalink / raw)
To: linux-fsdevel
Hallo everyone,
another question regarding filesystem implementation, sorry for bugging
you again. I wrote myfs_read() and myfs_write() with simple
copy_from_user() and copy_to_user() calls and I am trying to "upgrade"
them to the way other filesystems are doing it (paging, get_blk() and
stuff, still reading and understanding...). Currently I am facing
problems when it comes to blocksizes. The filesystem's blocksizes are
multiples of 512 bytes minus 2 bytes for header information. All blocks
on the same device have the same blocksize, the size is determined by
the module at mounting time and stored in superblock private data. So
blocksizes can be e.g. 510+2 or maybe 4094+2 bytes. If I understood
correctly how struct inode stores the blocksizes, I have doubts that it
is even possible to map 4094 [sic!] bytes of data into a page.
include/linux/fs.h:
761 struct inode {
762 umode_t i_mode;
...
821 atomic_t i_count;
822 unsigned int i_blkbits; <---
823 u64 i_version;
And in various other locations I found lines like:
blksize = 1 << inode->i_blkbits;
or like:
inode->i_blkbits = ilog2(blksize);
There is no way to express 4094 correctly this way, is it?
But 2**12 is 4096, and then the two header-bytes would be included :/
Don't hesitate to ask for further information, I might sound confused
right now. Any help is appreciated, you are free to direct me to files
in Documentation/ if I overlooked something.
Thanks!
Dan
--
Dan Luedtke
http://www.danrl.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-21 18:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21 18:04 Mapping anomalous blocksizes blksize Dan Luedtke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).