criu/include/file-lock.h
Qiang Huang 286801d4c1 crtools: collect and check file locks
We collect all file locks to a golbal list, so we can use them easily
in dump_one_task. For optimizaton, we only collect file locks hold by
tasks in the pstree.

Thanks to the ptrace-seize machanism, we can aviod the blocked file lock
issue, makes the work simpler.

Right now, the check handles only one situation:
-- Dumping tasks with file locks hold without the -l option.

This covers for the most part. But we still need some more work to make
it perfect robust in the future.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-17 14:42:07 +04:00

28 lines
535 B
C

#ifndef __FILE_LOCK_H__
#define __FILE_LOCK_H__
#include "crtools.h"
#include "protobuf.h"
#include "../protobuf/file-lock.pb-c.h"
struct file_lock {
long long fl_id;
char fl_flag[10];
char fl_type[15];
char fl_option[10];
pid_t fl_owner;
int maj, min;
unsigned long i_no;
long long start;
char end[32];
struct list_head list; /* list of all file locks */
};
extern struct list_head file_lock_list;
extern struct file_lock *alloc_file_lock(void);
extern void free_file_locks(void);
#endif /* __FILE_LOCK_H__ */