• Patrick Mochel's avatar
    [power] Various swsusp cleanups. · f2df1a5f
    Patrick Mochel authored
    - Move SMP check to software_suspend() (from software_resume()), so we will
      not even attempt to sleep with it enabled.
    - Make software_resume() a late initcall, removing the explicit call from
      prepare_namespace(). 
    - Initialize software_suspend_enabled to 1, instead of doing it manually in
      software_resume().
    - Don't explicitly initialzie resume_file.
    - Remove resume_status variable, as we can simply check for (non-) NULL 
      resume_file string. 
    - "noresume" setup function changed to simply zero first byte of resume_file
      string, simplifying logic.
    - Don't attempt to reset swap signature if noresume is specified.
      - Downstream function (bdev_write_page() wasn't implemented anyway, so we
        can just remove that also).
    
    If noresume is specified, there will still be a suspend image left on the 
    swap partition. It may behoove us to never reset the swap signature, and 
    always leave the image intact on the disk, since it is a valid snapshot 
    that we can resume from at anytime. 
    
    This unconditional behavior would force the user to add 'mkswap <part>' to
    their init scripts to reset the partition to swap use. IMO, this is better
    anyway.
    f2df1a5f
suspend.h 2.39 KB