Skip to content
  • Dan Williams's avatar
    mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm · 063a7d1d
    Dan Williams authored
    The kbuild robot reported the following on a development branch that used
    memremap.h in a new path:
    
       In file included from arch/m68k/include/asm/pgtable_mm.h:148:0,
                         from arch/m68k/include/asm/pgtable.h:5,
                         from include/linux/memremap.h:7,
                         from drivers//dax/bus.c:3:
        arch/m68k/include/asm/motorola_pgtable.h: In function 'pgd_offset':
     >> arch/m68k/include/asm/motorola_pgtable.h:199:11: error: dereferencing pointer to incomplete type 'const struct mm_struct'
          return mm->pgd + pgd_index(address);
                   ^~
    
    The ->page_fault() callback is specific to HMM.  Move it to 'struct
    hmm_devmem' where the unusual asm/pgtable.h dependency can be contained in
    include/linux/hmm.h.  Longer term refactoring this dependency out of HMM
    is recommended, but in the meantime memremap.h remains generic.
    
    Link: http://lkml.kernel.org/r/154534090899.3120190.6652620807617715272.stgit@dwillia2...
    063a7d1d