Skip to contentSkip to conversation

implicit declaration of function `page_cache_release'

PATCH In review Olaf Hering 4 participants 10 messages Jul 8, 2005 – May 22, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 implicit declaration of function `page_cache_release'

In file included from include2/asm/tlb.h:31,

                 from linux-2.6.13-rc2-olh/arch/ppc64/kernel/pSeries_lpar.c:37:

linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function `tlb_flush_mmu':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:77: warning: implicit declaration of function release_pages' linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function tlb_remove_page':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:117: warning: implicit declaration of function `page_cache_release'

 include/linux/pagemap.h |    2 +-
 include/linux/swap.h    |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/pagemap.h +1 -1
Index: linux-2.6.13-rc2-olh/include/linux/pagemap.h
===================================================================
@@ -48,7 +48,7 @@ static inline void mapping_set_gfp_mask(
 
 #define page_cache_get(page)		get_page(page)
 #define page_cache_release(page)	put_page(page)
-void release_pages(struct page **pages, int nr, int cold);
+extern void release_pages(struct page **pages, int nr, int cold);
 
 static inline struct page *page_cache_alloc(struct address_space *x)
 {
include/linux/swap.h +1 -0
Index: linux-2.6.13-rc2-olh/include/linux/swap.h
===================================================================
@@ -7,6 +7,7 @@
 #include <linux/mmzone.h>
 #include <linux/list.h>
 #include <linux/sched.h>
+#include <linux/pagemap.h>
 #include <asm/atomic.h>
 #include <asm/page.h>
 
#1 lore raw
Quoted 20 lines · Olaf Hering

In file included from include2/asm/tlb.h:31,

                 from linux-2.6.13-rc2-olh/arch/ppc64/kernel/pSeries_lpar.c:37:

linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function `tlb_flush_mmu':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:77: warning: implicit declaration of function release_pages' linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function tlb_remove_page':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:117: warning: implicit declaration of function `page_cache_release'

 include/linux/pagemap.h |    2 +-
 include/linux/swap.h    |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.13-rc2-olh/include/linux/pagemap.h
===================================================================

include/linux/pagemap.h static inline void mapping_set_gfp_mask( · line 51

Quoted 5 lines
include/linux/pagemap.h +1 -1
@@ -48,7 +48,7 @@ static inline void mapping_set_gfp_mask(
 
 #define page_cache_get(page)		get_page(page)
 #define page_cache_release(page)	put_page(page)
-void release_pages(struct page **pages, int nr, int cold);
+extern void release_pages(struct page **pages, int nr, int cold);

Why this change? I think that was just me saving disk space.

Quoted 7 lines
include/linux/pagemap.h +0 -0
 static inline struct page *page_cache_alloc(struct address_space *x)
 {

Index: linux-2.6.13-rc2-olh/include/linux/swap.h
===================================================================

include/linux/swap.h line 13

Quoted 7 lines
include/linux/swap.h +1 -0
@@ -7,6 +7,7 @@
 #include <linux/mmzone.h>
 #include <linux/list.h>
 #include <linux/sched.h>
+#include <linux/pagemap.h>
 #include <asm/atomic.h>
 #include <asm/page.h>
 

Yup.

#2 lore raw
Quoted 9 lines · Andrew Morton

include/linux/pagemap.h static inline void mapping_set_gfp_mask( · line 51

Quoted 7 lines

+++ linux-2.6.13-rc2-olh/include/linux/pagemap.h

include/linux/pagemap.h +1 -1
@@ -48,7 +48,7 @@ static inline void mapping_set_gfp_mask(
 
 #define page_cache_get(page)		get_page(page)
 #define page_cache_release(page)	put_page(page)
-void release_pages(struct page **pages, int nr, int cold);
+extern void release_pages(struct page **pages, int nr, int cold);

Why this change? I think that was just me saving disk space.

Its only used in mm/swap.c and in linux/swap.h.
However, swap.h is used in many places. If no extern works as well, just drop that part.

#3 lore raw
In reply to Olaf Hering
Quoted 8 lines · Olaf Hering

In file included from include2/asm/tlb.h:31,

                 from linux-2.6.13-rc2-olh/arch/ppc64/kernel/pSeries_lpar.c:37:

linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function `tlb_flush_mmu':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:77: warning: implicit declaration of function release_pages' linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function tlb_remove_page':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:117: warning: implicit declaration of function `page_cache_release'

This went in 2.6.13-rc3 (commit 542d1c88bd7f73e2e59d41b12e4a9041deea89e4), and broke sparc compilation because of the following circular dependency:
asm-sparc/pgtable include linux/swap.h
linux/swap.h include now linux/pagemap.h
linux/pagemap.h include linux/mm.h
linux/mm.h include asm/pgtable.h

I haven't found a satisfactory way to resolve this, but i think the patch should be removed (it removes a warning but breaks an architecture).

Regards,

Benoit Boissinot

Quoted 12 lines

Index: linux-2.6.13-rc2-olh/include/linux/pagemap.h
===================================================================

include/linux/swap.h +1 -0
@@ -7,6 +7,7 @@
 #include <linux/mmzone.h>
 #include <linux/list.h>
 #include <linux/sched.h>
+#include <linux/pagemap.h>
 #include <asm/atomic.h>
 #include <asm/page.h>
 
#4 lore raw
Quoted 9 lines · Benoit Boissinot
Quoted 8 lines · Olaf Hering

In file included from include2/asm/tlb.h:31,

                 from linux-2.6.13-rc2-olh/arch/ppc64/kernel/pSeries_lpar.c:37:

linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function `tlb_flush_mmu':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:77: warning: implicit declaration of function release_pages' linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function tlb_remove_page':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:117: warning: implicit declaration of function `page_cache_release'

Quoted 4 lines

This went in 2.6.13-rc3 (commit 542d1c88bd7f73e2e59d41b12e4a9041deea89e4), and broke sparc compilation because of the following circular dependency:
asm-sparc/pgtable include linux/swap.h

Why does it need swap.h? Do the users of pgtable.h rely on swap.h?

#5 lore raw
Quoted 11 lines · Olaf Hering
Quoted 9 lines · Benoit Boissinot
Quoted 8 lines · Olaf Hering

In file included from include2/asm/tlb.h:31,

                 from linux-2.6.13-rc2-olh/arch/ppc64/kernel/pSeries_lpar.c:37:

linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function `tlb_flush_mmu':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:77: warning: implicit declaration of function release_pages' linux-2.6.13-rc2-olh/include/asm-generic/tlb.h: In function tlb_remove_page':
linux-2.6.13-rc2-olh/include/asm-generic/tlb.h:117: warning: implicit declaration of function `page_cache_release'

Quoted 7 lines
Quoted 4 lines

This went in 2.6.13-rc3 (commit 542d1c88bd7f73e2e59d41b12e4a9041deea89e4), and broke sparc compilation because of the following circular dependency:
asm-sparc/pgtable include linux/swap.h

Why does it need swap.h? Do the users of pgtable.h rely on swap.h?

sparc is the only architecture to do that, it looks like it uses it for boot time linking (BTFIXUP_*). I don't know anything about sparc, so i can't fix it.

(adding [email protected] to the cc list)

#6 lore raw

From: Benoit Boissinot <[email protected]>
Date: Fri, 5 Aug 2005 21:18:38 +0200

Quoted 10 lines · Olaf Hering
Quoted 4 lines · Benoit Boissinot

Why does it need swap.h? Do the users of pgtable.h rely on swap.h?

sparc is the only architecture to do that, it looks like it uses it for boot time linking (BTFIXUP_*). I don't know anything about sparc, so i can't fix it.

(adding [email protected] to the cc list)

It needs to have the swp_entry_t type fully visible in pgtable.h, we can't work around this using macros.

#7 lore raw
Quoted 8 lines · David S. Miller

From: Benoit Boissinot <[email protected]>
Date: Fri, 5 Aug 2005 21:18:38 +0200

Quoted 5 lines · Olaf Hering
Quoted 4 lines · Benoit Boissinot

Why does it need swap.h? Do the users of pgtable.h rely on swap.h?

Quoted 8 lines
Quoted 5 lines

sparc is the only architecture to do that, it looks like it uses it for boot time linking (BTFIXUP_*). I don't know anything about sparc, so i can't fix it.

(adding [email protected] to the cc list)

It needs to have the swp_entry_t type fully visible in pgtable.h, we can't work around this using macros.

So the patch should be reverted? Its only for CONFIG_SWAP=n, rather unusual for KDE/GNOME tainted workstations...

#8 lore raw

From: Olaf Hering <[email protected]>
Date: Sat, 6 Aug 2005 17:01:03 +0200

Quoted 2 lines

So the patch should be reverted? Its only for CONFIG_SWAP=n, rather unusual for KDE/GNOME tainted workstations...

Not necessarily, but the header dependencies should be fixed up somehow.

#9 lore raw
Quoted 8 lines · David S. Miller

From: Olaf Hering <[email protected]>
Date: Sat, 6 Aug 2005 17:01:03 +0200

Quoted 2 lines

So the patch should be reverted? Its only for CONFIG_SWAP=n, rather unusual for KDE/GNOME tainted workstations...

Not necessarily, but the header dependencies should be fixed up somehow.

I think you are right once again.
(Just the time got a bit out of sync.)