Skip to content

Commit

Permalink
ipc/shm: fix up for struct file no longer being available in shm.h
Browse files Browse the repository at this point in the history
Stephen Rothewell <[email protected]> wrote:

> After merging the userns tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> In file included from include/linux/sched.h:16:0,
>                  from arch/powerpc/lib/xor_vmx_glue.c:14:
> include/linux/shm.h:17:35: error: 'struct file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>  bool is_file_shm_hugepages(struct file *file);
>                                    ^~~~
>
> and many, many more (most warnings, but some errors - arch/powerpc is
> mostly built with -Werror)

I dug through this and I discovered that the error was caused by the
removal of struct shmid_kernel from shm.h when building on powerpc.
Except for observing the existence of "struct file *shm_file" in
struct shmid_kernel I have no clue why the structure move would cause
such a failure.  I suspect shm.h always needed the forward declaration
and someting had been confusing gcc into not issuing the warning. --EWB

Fixes: a2e102c ("shm: Move struct shmid_kernel into ipc/shm.c")
Signed-off-by: Stephen Rothwell <[email protected]>
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
sfrothwell authored and ebiederm committed Mar 28, 2018
1 parent 0d79cbf commit 8ecd295
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/shm.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <uapi/linux/shm.h>
#include <asm/shmparam.h>

struct file;

#ifdef CONFIG_SYSVIPC
struct sysv_shm {
struct list_head shm_clist;
Expand Down

0 comments on commit 8ecd295

Please sign in to comment.