• Andrew Morton's avatar
    [PATCH] revert recent swapcache handling changes · e74193ad
    Andrew Morton authored
    Go back to the 2.6.5 concepts, with rmap additions.  In particular:
    
    - Implement Andrea's flavour of page_mapping().  This function opaquely does
      the right thing for pagecache pages, anon pages and for swapcache pages.
    
      The critical thing here is that page_mapping() returns &swapper_space for
      swapcache pages without actually requiring the storage at page->mapping. 
      This frees page->mapping for the anonmm/anonvma metadata.
    
    - Andrea and Hugh placed the pagecache index of swapcache pages into
      page->private rather than page->index.  So add new page_index() function
      which hides this.
    
    - Make swapper_space.set_page_dirty() again point at
      __set_page_dirty_buffers().  If we don't do that, a bare set_page_dirty()
      will fall through to __set_page_dirty_buffers(), which is silly.
    
      This way, __set_page_dirty_buffers() can continue to use page->mapping.
      It should never go near anon or swapcache pages.
    
    - Give swapper_space a ->set_page_dirty address_space_operation method, so
      that set_page_dirty() will not fall through to __set_page_dirty_buffers()
      for swapcache pages.  That function is not set up to handle them.
    
    
    The main effect of these changes is that swapcache pages are treated more
    similarly to pagecache pages.  And we are again tagging swapcache pages as
    dirty in their radix tree, which is a requirement if we later wish to
    implement swapcache writearound based on tagged radix-tree walks.
    e74193ad
buffer.c 81.3 KB