From: Dan Luedtke <mail@danrl.de>
To: linux-fsdevel@vger.kernel.org
Subject: Mapping anomalous blocksizes blksize
Date: Thu, 21 Jun 2012 20:04:20 +0200 [thread overview]
Message-ID: <1340301860.11487.17.camel@localhost> (raw)
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
reply other threads:[~2012-06-21 18:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340301860.11487.17.camel@localhost \
--to=mail@danrl.de \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).