Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bernhard Walle <bwalle@...>
Cc: <linux-kernel@...>, <kexec@...>, <akpm@...>, <ak@...>
Date: Tuesday, October 16, 2007 - 2:08 pm

On Tue, 2007-10-16 at 18:28 +0200, Bernhard Walle wrote:

Could you give all of these 0's a name?  I really hate seeing random
magic numbers in these things.  0 completely kills the ability of
someone to read the code and figure out what it is trying to do without
going and looking at reserve_bootmem().

Or, alternatively, do something like this:

-extern void reserve_bootmem(unsigned long addr, unsigned long size);
+/*
+ * If flags is 0, then the return value is always 0 (success). If
+ * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the
+ * memory already was reserved.
+ */
+extern int reserve_bootmem(unsigned long addr, unsigned long size, int flag);
+int reserve_bootmem(unsigned long addr, unsigned long size)
+{
+	/* the 0 is because we don't
+	return reserve_bootmem_exclusive(addr, size, 0);
+}

Where all of the existing callers stay the same.  But, the ones wanting
exclusive access actually call the _exclusive() variant.  

-- Dave

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Bernhard Walle, (Tue Oct 16, 12:28 pm)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Vivek Goyal, (Wed Oct 17, 7:05 am)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Bernhard Walle, (Thu Oct 18, 7:15 am)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Bernhard Walle, (Wed Oct 17, 7:36 am)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Vivek Goyal, (Thu Oct 18, 12:32 am)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Dave Hansen, (Tue Oct 16, 2:08 pm)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Bernhard Walle, (Tue Oct 16, 2:44 pm)
Re: [patch 2/3] Introduce BOOTMEM_EXCLUSIVE, Dave Hansen, (Tue Oct 16, 2:58 pm)