[2.6 patch] mm/filemap.c:generic_write_checks() mustn't be inline

From: Adrian Bunk
Date: Mon Apr 28 2008 - 11:39:24 EST


On Sat, Apr 26, 2008 at 07:22:22PM +0200, Ingo Molnar wrote:
>...
> then it fails with:
>
> mm/filemap.c: In function '__generic_file_aio_write_nolock':
> mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to 'generic_write_checks': function body not available
>
> i used:
>
> make ARCH=um SUBARCH=x86_64 -j64 linux
>
> on x86-64, gcc-4.3.0-0.13. Config is:
>
> http://redhat.com/~mingo/misc/.config.um
>...

Patch below.

> Ingo
>...

cu
Adrian


<-- snip -->


This patch fixes the following build error with UML and gcc 4.3:

<-- snip -->

...
CC mm/filemap.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/mm/filemap.c: In function â__generic_file_aio_write_nolockâ:
/home/bunk/linux/kernel-2.6/git/linux-2.6/mm/filemap.c:1831: sorry, unimplemented: inlining failed in call to âgeneric_write_checksâ: function body not available
/home/bunk/linux/kernel-2.6/git/linux-2.6/mm/filemap.c:2383: sorry, unimplemented: called from here
make[2]: *** [mm/filemap.o] Error 1

<-- snip -->

Reported-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Adrian Bunk <bunk@xxxxxxxxxx>

---
e4a4374513a2b23060bb385d83f1e67427b1b665 diff --git a/mm/filemap.c b/mm/filemap.c
index 07e9d92..576b553 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1827,7 +1827,8 @@ EXPORT_SYMBOL(iov_iter_single_seg_count);
* Returns appropriate error code that caller should return or
* zero in case that write should be allowed.
*/
-inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
+int generic_write_checks(struct file *file, loff_t *pos, size_t *count,
+ int isblk)
{
struct inode *inode = file->f_mapping->host;
unsigned long limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/