• Dan Streetman's avatar
    frontswap: allow multiple backends · d1dc6f1b
    Dan Streetman authored
    Change frontswap single pointer to a singly linked list of frontswap
    implementations.  Update Xen tmem implementation as register no longer
    returns anything.
    
    Frontswap only keeps track of a single implementation; any
    implementation that registers second (or later) will replace the
    previously registered implementation, and gets a pointer to the previous
    implementation that the new implementation is expected to pass all
    frontswap functions to if it can't handle the function itself.  However
    that method doesn't really make much sense, as passing that work on to
    every implementation adds unnecessary work to implementations; instead,
    frontswap should simply keep a list of all registered implementations
    and try each implementation for any function.  Most importantly, neither
    of the two currently existing frontswap implementations in the kernel
    actually do anything with any previous frontswap implementation that
    they replace when registering.
    
    This allows frontswap to successfully manage multiple implementations by
    keeping a list of them all.
    Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Cc: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d1dc6f1b
tmem.c 10.5 KB