Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

More fun with MinixFS V3

 
   Linux (Home) -> Kernel RSS
Next:  Bug#535719: (stunnel4_3:4.27-1/avr32): FTBFS: Out..  
Author Message
Doug Graham

External


Since: Jul 04, 2009
Posts: 1



(Msg. 1) Posted: Sat Jul 04, 2009 3:25 pm
Post subject: More fun with MinixFS V3
Archived from groups: linux>kernel (more info?)

I was just looking over an old thread about MinixFs V3 support and
starting to get worried that my tweaks to support blocksizes of 512
bytes (for a small filesystem with many small files) might be broken.
This is the thread here: http://lkml.org/lkml/2006/5/6/50.
The nblocks() routine in fs/minix/itree_common.c now looks like this:

static inline unsigned nblocks(loff_t size, struct super_block *sb)
{
int k = sb->s_blocksize_bits - 10;
unsigned blocks, res, direct = DIRECT, i = DEPTH;
blocks = (size + sb->s_blocksize - 1) >> (BLOCK_SIZE_BITS + k);
...

and what had be worred at first is that sb->s_blocksize_bits will be 9
with a blocksize of 512, which makes k negative. But all may not be lost,
since k is only used once after this, after adding BLOCK_SIZE_BITS (10)
to it. At least that makes it nonnegative again, but then the question
is: what exactly is being accomplished here? First we subtract 10,
then add it back? The result is effectively this:

blocks = (size + sb->s_blocksize - 1) >> sb->s_blocksize_bits

which looks entirely correct to me. Is there any reason the code couldn't
just be written this way to begin with?

--Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
speedstep-centrino on dothan - Currently, the speedstep-centrino support has built-in frequency/voltage pairs only for Banias CPUs. For Dothan CPUs, these tables are read from BIOS ACPI. But ACPI encoding may not be available or not reliable, so why shouldn't we provide built-in..

Slowdown with randomize_va_space in 2.6.12.2 - Hi, all I have a bash script that calls a small application several times (around 50 calls) that just send and receives data through an already open tcp socket to a local server through the loopback device. It also launches another small app several....

overriding keyboard driver in a module - I'm writing a little tool to allow intercepting keyboard events and substituting them with other events / swallowing events / emitting additional events on a low level before normal processing by kernel. http://kbd-mangler.sourceforge.net/ Currently t...

[PATCH 3/3] openfirmware: implement hotplug for macio devi.. - This patch adds the hotplug routine for generating hotplug events when devices are seen on the macio bus. It uses the attributed created by the sysfs nodes to generate the hotplug environment vars for userspace. Since the characters allowed inside the..

[PATCH] NFS: fix client hang due to race condition - The flags field in struct nfs_inode is protected by the BKL. The following two code paths (there may be more, but my test program only hits these two) modify the flags without obtaining the lock: nfs_end_data_update nfs_release ..
       Linux (Home) -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
  Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact