lkml.org 
[lkml]   [2010]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] bcache: ver 3
On 04/23/2010 12:39 PM, Randy Dunlap wrote:

>> +#define label(l, foo) if (0) { l: foo; }
>
> I'd prefer that macro to go away.

I kind of like it, the way I use it it's shorthand for "return with x status";
it just makes return codes and exiting cleaner. But if you still hate it after
you've read the functions where it's used, I can take it out.

>> + return d[i / keys_per_page] + (i % keys_per_page);
>
> That builds OK on i386? or does it need udivdi3() and/or umoddi3()?

If my understanding is correct, those are only needed for 64 bits, i indexes
into a single node so 32 bits is plenty.

>
>> +}
>
>> +static int lookup_dev(struct cache_device *c, struct bio *bio)
>> +{
>> + int dev;
>> + for (dev = 0; dev< 256; dev++)
>
> Use a macro for 256.. in lots of places.

Yes, definitely.

> bcache: cannot allocate memory
> "kmalloc error" sounds like kmalloc() had an internal error.

Agreed.

> Need to document the sysfs interfaces:

Ok, I'll start on that.

>> + err = "vmalloc error";
>
> "cannot vmalloc memory";

Done.


\
 
 \ /
  Last update: 2010-04-23 23:07    [W:0.050 / U:1.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site