Re: [GIT PULL] iscsi-target merge for v3.1-rc1

Linus Torvalds
2011-07-25T23:47:08Z

On Mon, Jul 25, 2011 at 4:37 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Sat, 23 Jul 2011 16:16:15 -0700
> "Nicholas A. Bellinger" <nab@linux-iscsi.org> wrote:
>
>> Please go ahead and pull from:
>>
>>   master.kernel.org:/pub/scm/linux/kernel/git/nab/target-pending.git for-linus-merge
>
> i386 allyesconfig:
>
> ERROR: "__udivdi3" [drivers/target/target_core_mod.ko] undefined!
>
> somewhere in drivers/target/target_core_transport.c:transport_allocate_data_tasks().

.. looks like somebody isn't doing a "sector_div()" for a sector_t.

Nicholas: full 64-bit divides are dog slow on most 32-bit targets, and
gcc is very iffy at doing a 64/32->32 divide (or even a 64/32->64 one,
which is still much faster than the full 64/64->64 one). So we very
much on purpose don't allow for __udivdi3 (which is gcc-speak for that
out-of-line "64/64->64" operation), so it generates link-time errors.

Note the odd semantics for sector_div():

sector_div(a,b)

basically does a "a = a/b" (and then returns the remainder, but nobody
uses it and maybe we should skip that part).

Linus