-
Notifications
You must be signed in to change notification settings - Fork 3
/
mtnd.h
47 lines (43 loc) · 1.05 KB
/
mtnd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* mtnd.h
*/
#ifndef _MTND_H
#define _MTND_H
#include "mtn.h"
#include "libmtn.h"
#include "common.h"
#include "ioprio.h"
#define MTND_EXPORT_RETURN \
if(!ctx->export){ \
kt->fin = 1; \
kt->send.head.type = MTNCMD_SUCCESS; \
kt->send.head.size = 0; \
kt->send.head.fin = 1; \
return; \
} \
typedef struct mtnd_context{
MTNTASK *cldtask;
MTNSVR *members;
int daemonize;
uint64_t free_limit;
char host[HOST_NAME_MAX];
char pid[PATH_MAX];
char cwd[PATH_MAX];
char ewd[PATH_MAX];
int signal;
int export;
int execute;
int rdonly;
int ioprio;
int fsig[2];
} MTND;
typedef void (*MTNFSTASKFUNC)(MTNTASK *);
extern volatile sig_atomic_t is_loop;
extern MTN *mtn;
extern MTND *ctx;
int mtnd_fix_path(char *path, char *real);
int getstatd(uint64_t *dfree, uint64_t *dsize);
int is_freelimit(void);
void init_task_child(void);
void mtnd_child(MTNTASK *kt);
#endif