chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TODO
[elogind.git]
/
src
/
swap.h
diff --git
a/src/swap.h
b/src/swap.h
index 8a604169004e10d53dc6d6b83eeb727a20ae668f..62d08da30b81f5649e4af04d1254d875df650894 100644
(file)
--- a/
src/swap.h
+++ b/
src/swap.h
@@
-56,8
+56,19
@@
typedef struct SwapParameters {
bool handle:1;
} SwapParameters;
bool handle:1;
} SwapParameters;
+typedef enum SwapResult {
+ SWAP_SUCCESS,
+ SWAP_FAILURE_RESOURCES,
+ SWAP_FAILURE_TIMEOUT,
+ SWAP_FAILURE_EXIT_CODE,
+ SWAP_FAILURE_SIGNAL,
+ SWAP_FAILURE_CORE_DUMP,
+ _SWAP_RESULT_MAX,
+ _SWAP_RESULT_INVALID = -1
+} SwapResult;
+
struct Swap {
struct Swap {
-
Meta
meta;
+
Unit
meta;
char *what;
char *what;
@@
-69,13
+80,13
@@
struct Swap {
bool from_proc_swaps:1;
bool from_fragment:1;
bool from_proc_swaps:1;
bool from_fragment:1;
- bool failure:1;
-
/* Used while looking for swaps that vanished or got added
* from/to /proc/swaps */
bool is_active:1;
bool just_activated:1;
/* Used while looking for swaps that vanished or got added
* from/to /proc/swaps */
bool is_active:1;
bool just_activated:1;
+ SwapResult result;
+
usec_t timeout_usec;
ExecCommand exec_command[_SWAP_EXEC_COMMAND_MAX];
usec_t timeout_usec;
ExecCommand exec_command[_SWAP_EXEC_COMMAND_MAX];
@@
-89,7
+100,7
@@
struct Swap {
Watch timer_watch;
Watch timer_watch;
- /* In order to be able to dist
uing
ish dependencies on
+ /* In order to be able to dist
ingu
ish dependencies on
different device nodes we might end up creating multiple
devices for the same swap. We chain them up here. */
different device nodes we might end up creating multiple
devices for the same swap. We chain them up here. */
@@
-103,6
+114,7
@@
int swap_add_one(Manager *m, const char *what, const char *what_proc_swaps, int
int swap_add_one_mount_link(Swap *s, Mount *m);
int swap_dispatch_reload(Manager *m);
int swap_add_one_mount_link(Swap *s, Mount *m);
int swap_dispatch_reload(Manager *m);
+int swap_fd_event(Manager *m, int events);
const char* swap_state_to_string(SwapState i);
SwapState swap_state_from_string(const char *s);
const char* swap_state_to_string(SwapState i);
SwapState swap_state_from_string(const char *s);
@@
-110,4
+122,7
@@
SwapState swap_state_from_string(const char *s);
const char* swap_exec_command_to_string(SwapExecCommand i);
SwapExecCommand swap_exec_command_from_string(const char *s);
const char* swap_exec_command_to_string(SwapExecCommand i);
SwapExecCommand swap_exec_command_from_string(const char *s);
+const char* swap_result_to_string(SwapResult i);
+SwapResult swap_result_from_string(const char *s);
+
#endif
#endif