Commit 200ead9a authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

proc: move parts about fdinfo from proc_parse.h into fdinfo.h

proc_parse.h is too generic and it is a bad idea to include it everywhere.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 62a84938
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "proc_parse.h" #include "fdinfo.h"
#include "autofs.h" #include "autofs.h"
#include "rst-malloc.h" #include "rst-malloc.h"
#include "mount.h" #include "mount.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/aio_abi.h> #include <linux/aio_abi.h>
#include <sys/mount.h> #include <sys/mount.h>
#include "proc_parse.h" #include "fdinfo.h"
#include "sockets.h" #include "sockets.h"
#include "crtools.h" #include "crtools.h"
#include "log.h" #include "log.h"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "asm/types.h" #include "asm/types.h"
#include "imgset.h" #include "imgset.h"
#include "eventfd.h" #include "eventfd.h"
#include "proc_parse.h" #include "fdinfo.h"
#include "image.h" #include "image.h"
#include "util.h" #include "util.h"
#include "log.h" #include "log.h"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "imgset.h" #include "imgset.h"
#include "rst_info.h" #include "rst_info.h"
#include "eventpoll.h" #include "eventpoll.h"
#include "proc_parse.h" #include "fdinfo.h"
#include "image.h" #include "image.h"
#include "util.h" #include "util.h"
#include "log.h" #include "log.h"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "timerfd.h" #include "timerfd.h"
#include "imgset.h" #include "imgset.h"
#include "fs-magic.h" #include "fs-magic.h"
#include "proc_parse.h" #include "fdinfo.h"
#include "cr_options.h" #include "cr_options.h"
#include "autofs.h" #include "autofs.h"
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "asm/types.h" #include "asm/types.h"
#include "imgset.h" #include "imgset.h"
#include "fsnotify.h" #include "fsnotify.h"
#include "proc_parse.h" #include "fdinfo.h"
#include "mount.h" #include "mount.h"
#include "image.h" #include "image.h"
#include "util.h" #include "util.h"
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#define AUTOFS_MINOR 235 #define AUTOFS_MINOR 235
#endif #endif
#include <stdbool.h>
bool is_autofs_pipe(unsigned long inode); bool is_autofs_pipe(unsigned long inode);
struct mount_info; struct mount_info;
......
#ifndef __CR_FDINFO_H__
#define __CR_FDINFO_H__
#include "list.h"
#include "images/eventfd.pb-c.h"
#include "images/eventpoll.pb-c.h"
#include "images/signalfd.pb-c.h"
#include "images/fsnotify.pb-c.h"
#include "images/timerfd.pb-c.h"
struct inotify_wd_entry {
InotifyWdEntry e;
FhEntry f_handle;
struct list_head node;
};
struct fanotify_mark_entry {
FanotifyMarkEntry e;
FhEntry f_handle;
struct list_head node;
union {
FanotifyInodeMarkEntry ie;
FanotifyMountMarkEntry me;
};
};
struct eventpoll_tfd_entry {
EventpollTfdEntry e;
struct list_head node;
};
union fdinfo_entries {
EventfdFileEntry efd;
SignalfdEntry sfd;
struct inotify_wd_entry ify;
struct fanotify_mark_entry ffy;
struct eventpoll_tfd_entry epl;
TimerfdEntry tfy;
};
extern void free_inotify_wd_entry(union fdinfo_entries *e);
extern void free_fanotify_mark_entry(union fdinfo_entries *e);
extern void free_event_poll_entry(union fdinfo_entries *e);
struct fdinfo_common {
off64_t pos;
int flags;
int mnt_id;
int owner;
};
extern int parse_fdinfo(int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
extern int parse_fdinfo_pid(int pid, int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
#endif
...@@ -3,13 +3,7 @@ ...@@ -3,13 +3,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "asm/types.h" #include "asm/types.h"
#include "list.h"
#include "images/eventfd.pb-c.h"
#include "images/eventpoll.pb-c.h"
#include "images/signalfd.pb-c.h"
#include "images/fsnotify.pb-c.h"
#include "images/timerfd.pb-c.h"
#include "images/seccomp.pb-c.h" #include "images/seccomp.pb-c.h"
#define PROC_TASK_COMM_LEN 32 #define PROC_TASK_COMM_LEN 32
...@@ -110,52 +104,6 @@ extern unsigned int parse_pid_loginuid(pid_t pid, int *err, bool ignore_noent); ...@@ -110,52 +104,6 @@ extern unsigned int parse_pid_loginuid(pid_t pid, int *err, bool ignore_noent);
extern int parse_pid_oom_score_adj(pid_t pid, int *err); extern int parse_pid_oom_score_adj(pid_t pid, int *err);
extern int prepare_loginuid(unsigned int value, unsigned int loglevel); extern int prepare_loginuid(unsigned int value, unsigned int loglevel);
extern int parse_pid_status(pid_t pid, struct proc_status_creds *); extern int parse_pid_status(pid_t pid, struct proc_status_creds *);
struct inotify_wd_entry {
InotifyWdEntry e;
FhEntry f_handle;
struct list_head node;
};
struct fanotify_mark_entry {
FanotifyMarkEntry e;
FhEntry f_handle;
struct list_head node;
union {
FanotifyInodeMarkEntry ie;
FanotifyMountMarkEntry me;
};
};
struct eventpoll_tfd_entry {
EventpollTfdEntry e;
struct list_head node;
};
union fdinfo_entries {
EventfdFileEntry efd;
SignalfdEntry sfd;
struct inotify_wd_entry ify;
struct fanotify_mark_entry ffy;
struct eventpoll_tfd_entry epl;
TimerfdEntry tfy;
};
extern void free_inotify_wd_entry(union fdinfo_entries *e);
extern void free_fanotify_mark_entry(union fdinfo_entries *e);
extern void free_event_poll_entry(union fdinfo_entries *e);
struct fdinfo_common {
off64_t pos;
int flags;
int mnt_id;
int owner;
};
extern int parse_fdinfo(int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
extern int parse_fdinfo_pid(int pid, int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
extern int parse_file_locks(void); extern int parse_file_locks(void);
extern int get_fd_mntid(int fd, int *mnt_id); extern int get_fd_mntid(int fd, int *mnt_id);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "vma.h" #include "vma.h"
#include "bfd.h" #include "bfd.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "fdinfo.h"
#include "parasite.h" #include "parasite.h"
#include "cr_options.h" #include "cr_options.h"
#include "sysfs_parse.h" #include "sysfs_parse.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "compiler.h" #include "compiler.h"
#include "asm/types.h" #include "asm/types.h"
#include "signalfd.h" #include "signalfd.h"
#include "proc_parse.h" #include "fdinfo.h"
#include "imgset.h" #include "imgset.h"
#include "image.h" #include "image.h"
#include "util.h" #include "util.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "protobuf.h" #include "protobuf.h"
#include "images/timerfd.pb-c.h" #include "images/timerfd.pb-c.h"
#include "proc_parse.h" #include "fdinfo.h"
#include "rst-malloc.h" #include "rst-malloc.h"
#include "cr_options.h" #include "cr_options.h"
#include "restorer.h" #include "restorer.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment