sys_swapon: do not depend on "type" after allocation