linux/include
Andre Noll ab5bd5cbc8 md: Convert remaining 1k representations in linear.c to sectors.
This patch renames hash_spacing and preshift to  spacing and
sector_shift respectively with the following change of semantics:

Case 1: (sizeof(sector_t) <= sizeof(u32)).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In this case, we have sector_shift = preshift = 0 and spacing =
2 * hash_spacing.

Hence, the index for the hash table which is computed by the new code
in which_dev() as sector / spacing equals the old value which was
(sector/2) / hash_spacing.

Note also that the value of nb_zone stays the same because both sz
and base double.

Case 2: (sizeof(sector_t) > sizeof(u32)).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(aka the shifting dance case). Here we have sector_shift = preshift +
1 and

spacing = 2 * hash_spacing

during the computation of nb_zone and curr_sector, but

spacing = hash_spacing

in which_dev() because in the last hunk of the patch for linear.c we
shift down conf->spacing (= 2 * hash_spacing) by one more bit than
in the old code.

Hence in the computation of nb_zone, sz and base have the same value
as before, so nb_zone is not affected. Also curr_sector in the next
hunk stays the same.

In which_dev() the hash table index is computed as

(sector >> sector_shift) / spacing

In view of sector_shift = preshift + 1 and spacing = hash_spacing,
this equals

((sector/2) >> preshift) / hash_spacing

which is the value computed by the old code.

Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
2008-10-13 11:55:12 +11:00
..
acpi
asm-arm
asm-cris
asm-frv
asm-generic Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D 2008-10-11 20:23:20 +02:00
asm-m32r
asm-m68k
asm-mips MIPS: Move headfiles to new location below arch/mips/include 2008-10-11 16:18:52 +01:00
asm-mn10300
asm-parisc lib: Correct printk %pF to work on all architectures 2008-09-09 11:51:15 -07:00
asm-um net: Fix build with ARCH=um 2008-09-19 12:44:54 -07:00
asm-x86 Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D 2008-10-11 20:23:20 +02:00
asm-xtensa
crypto crypto: rng - RNG interface and implementation 2008-08-29 15:50:04 +10:00
drm
keys
linux md: Convert remaining 1k representations in linear.c to sectors. 2008-10-13 11:55:12 +11:00
math-emu
media
mtd
net net: fix dummy 'nf_conntrack_event_cache()' 2008-10-11 09:46:24 -07:00
pcmcia
rdma
rxrpc
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-10 10:53:26 -07:00
sound ALSA: Increase components array size 2008-10-10 13:41:53 +02:00
video Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
xen
Kbuild