]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
hugetlb_file_setup(): use C, not cpp
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 24 Sep 2009 21:47:45 +0000 (14:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Sep 2009 00:11:24 +0000 (17:11 -0700)
Why macros are always wrong:

  mm/mmap.c: In function 'do_mmap_pgoff':
  mm/mmap.c:953: warning: unused variable 'user'

also, move a couple of struct forward-decls outside `#ifdef
CONFIG_HUGETLB_PAGE' - it's pointless and frequently harmful to make these
conditional (eg, this patch needed `struct user_struct').

Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Eric Whitney <eric.whitney@hp.com>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

index 11ab19ac6b3d98af1b4389b62a085c929254c491..16937995abd45485483683311f4ad891a99643bd 100644 (file)
@@ -3,15 +3,15 @@
 #include <linux/fs.h>
+struct ctl_table;
+struct user_struct;
 #include <linux/mempolicy.h>
 #include <linux/shm.h>
 #include <asm/tlbflush.h>
-struct ctl_table;
-struct user_struct;
 int PageHuge(struct page *page);
 static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
@@ -187,7 +187,11 @@ static inline void set_file_hugepages(struct file *file)
 #define is_file_hugepages(file)                        0
 #define set_file_hugepages(file)               BUG()
-#define hugetlb_file_setup(name,size,acct,user,creat)  ERR_PTR(-ENOSYS)
+static inline struct file *hugetlb_file_setup(const char *name, size_t size,
+               int acctflag, struct user_struct **user, int creat_flags)
+       return ERR_PTR(-ENOSYS);
 #endif /* !CONFIG_HUGETLBFS */