Commit 0468355c authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

protobuf: Drop fown_t type

We are ready to use FownEntry everywhere,
so drop fown_t type and clean up source code.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8d92c2c3
...@@ -159,7 +159,7 @@ int do_dump_gen_file(struct fd_parms *p, int lfd, ...@@ -159,7 +159,7 @@ int do_dump_gen_file(struct fd_parms *p, int lfd,
static int dump_task_exe_link(pid_t pid, MmEntry *mm) static int dump_task_exe_link(pid_t pid, MmEntry *mm)
{ {
struct fd_parms params = { }; struct fd_parms params = FD_PARMS_INIT;
int fd, ret; int fd, ret;
fd = open_proc(pid, "exe"); fd = open_proc(pid, "exe");
...@@ -195,7 +195,8 @@ static int fill_fd_params(pid_t pid, int fd, int lfd, char fd_flags, struct fd_p ...@@ -195,7 +195,8 @@ static int fill_fd_params(pid_t pid, int fd, int lfd, char fd_flags, struct fd_p
p->flags = fcntl(lfd, F_GETFL); p->flags = fcntl(lfd, F_GETFL);
p->pid = pid; p->pid = pid;
p->fd_flags = fd_flags; p->fd_flags = fd_flags;
p->fown = (fown_t){ };
fown_entry__init(&p->fown);
pr_info("%d fdinfo %d: pos: 0x%16lx flags: %16o/%#x\n", pr_info("%d fdinfo %d: pos: 0x%16lx flags: %16o/%#x\n",
pid, fd, p->pos, p->flags, (int)fd_flags); pid, fd, p->pos, p->flags, (int)fd_flags);
...@@ -346,7 +347,7 @@ err: ...@@ -346,7 +347,7 @@ err:
static int dump_task_fs(pid_t pid, struct cr_fdset *fdset) static int dump_task_fs(pid_t pid, struct cr_fdset *fdset)
{ {
struct fd_parms p = { .fd = FD_DESC_INVALID, }; struct fd_parms p = FD_PARMS_INIT;
FsEntry fe = FS_ENTRY__INIT; FsEntry fe = FS_ENTRY__INIT;
int fd, ret; int fd, ret;
...@@ -393,7 +394,7 @@ static int dump_task_fs(pid_t pid, struct cr_fdset *fdset) ...@@ -393,7 +394,7 @@ static int dump_task_fs(pid_t pid, struct cr_fdset *fdset)
static int dump_filemap(pid_t pid, struct vma_entry *vma, int file_fd, static int dump_filemap(pid_t pid, struct vma_entry *vma, int file_fd,
const struct cr_fdset *fdset) const struct cr_fdset *fdset)
{ {
struct fd_parms p = { }; struct fd_parms p = FD_PARMS_INIT;
if (fstat(file_fd, &p.stat) < 0) { if (fstat(file_fd, &p.stat) < 0) {
pr_perror("Can't stat file for vma"); pr_perror("Can't stat file for vma");
......
...@@ -74,14 +74,7 @@ void show_files(int fd_files, struct cr_options *o) ...@@ -74,14 +74,7 @@ void show_files(int fd_files, struct cr_options *o)
pb_show_plain(fd_files, fdinfo_entry); pb_show_plain(fd_files, fdinfo_entry);
} }
void show_fown_cont(fown_t *fown) void show_fown_cont(void *p)
{
pr_msg("fown: uid: %#x euid: %#x signum: %#x pid_type: %#x pid: %u",
fown->uid, fown->euid, fown->signum, fown->pid_type, fown->pid);
}
/* FIXME Drop once PB transition complete */
void pb_show_fown_cont(void *p)
{ {
FownEntry *fown = p; FownEntry *fown = p;
pr_msg("fown: uid: %#x euid: %#x signum: %#x pid_type: %#x pid: %u", pr_msg("fown: uid: %#x euid: %#x signum: %#x pid_type: %#x pid: %u",
......
...@@ -55,19 +55,16 @@ struct eventfd_dump_arg { ...@@ -55,19 +55,16 @@ struct eventfd_dump_arg {
static int dump_eventfd_entry(union fdinfo_entries *e, void *arg) static int dump_eventfd_entry(union fdinfo_entries *e, void *arg)
{ {
struct eventfd_dump_arg *da = arg; struct eventfd_dump_arg *da = arg;
FownEntry fown;
if (da->dumped) { if (da->dumped) {
pr_err("Several counters in a file?\n"); pr_err("Several counters in a file?\n");
return -1; return -1;
} }
pb_prep_fown(&fown, &da->p->fown);
da->dumped = true; da->dumped = true;
e->efd.id = da->id; e->efd.id = da->id;
e->efd.flags = da->p->flags; e->efd.flags = da->p->flags;
e->efd.fown = &fown; e->efd.fown = (FownEntry *)&da->p->fown;
pr_info_eventfd("Dumping ", &e->efd); pr_info_eventfd("Dumping ", &e->efd);
return pb_write(fdset_fd(glob_fdset, CR_FD_EVENTFD), return pb_write(fdset_fd(glob_fdset, CR_FD_EVENTFD),
...@@ -105,7 +102,7 @@ static int eventfd_open(struct file_desc *d) ...@@ -105,7 +102,7 @@ static int eventfd_open(struct file_desc *d)
return -1; return -1;
} }
if (pb_rst_file_params(tmp, info->efe->fown, info->efe->flags)) { if (rst_file_params(tmp, info->efe->fown, info->efe->flags)) {
pr_perror("Can't restore params on eventfd %#08x", pr_perror("Can't restore params on eventfd %#08x",
info->efe->id); info->efe->id);
goto err_close; goto err_close;
......
...@@ -76,13 +76,10 @@ static int dump_eventpoll_entry(union fdinfo_entries *e, void *arg) ...@@ -76,13 +76,10 @@ static int dump_eventpoll_entry(union fdinfo_entries *e, void *arg)
static int dump_one_eventpoll(int lfd, u32 id, const struct fd_parms *p) static int dump_one_eventpoll(int lfd, u32 id, const struct fd_parms *p)
{ {
EventpollFileEntry e = EVENTPOLL_FILE_ENTRY__INIT; EventpollFileEntry e = EVENTPOLL_FILE_ENTRY__INIT;
FownEntry fown;
pb_prep_fown(&fown, &p->fown);
e.id = id; e.id = id;
e.flags = p->flags; e.flags = p->flags;
e.fown = &fown; e.fown = (FownEntry *)&p->fown;
pr_info_eventpoll("Dumping ", &e); pr_info_eventpoll("Dumping ", &e);
if (pb_write(fdset_fd(glob_fdset, CR_FD_EVENTPOLL), if (pb_write(fdset_fd(glob_fdset, CR_FD_EVENTPOLL),
...@@ -118,7 +115,7 @@ static int eventpoll_open(struct file_desc *d) ...@@ -118,7 +115,7 @@ static int eventpoll_open(struct file_desc *d)
return -1; return -1;
} }
if (pb_rst_file_params(tmp, info->efe->fown, info->efe->flags)) { if (rst_file_params(tmp, info->efe->fown, info->efe->flags)) {
pr_perror("Can't restore file params on epoll %#08x", pr_perror("Can't restore file params on epoll %#08x",
info->efe->id); info->efe->id);
goto err_close; goto err_close;
......
...@@ -308,7 +308,6 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p) ...@@ -308,7 +308,6 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
int len, rfd; int len, rfd;
RegFileEntry rfe = REG_FILE_ENTRY__INIT; RegFileEntry rfe = REG_FILE_ENTRY__INIT;
FownEntry fown;
snprintf(fd_str, sizeof(fd_str), "/proc/self/fd/%d", lfd); snprintf(fd_str, sizeof(fd_str), "/proc/self/fd/%d", lfd);
len = readlink(fd_str, path, sizeof(path) - 1); len = readlink(fd_str, path, sizeof(path) - 1);
...@@ -324,12 +323,10 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p) ...@@ -324,12 +323,10 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
if (check_path_remap(path, &p->stat, lfd, id)) if (check_path_remap(path, &p->stat, lfd, id))
return -1; return -1;
pb_prep_fown(&fown, &p->fown);
rfe.id = id; rfe.id = id;
rfe.flags = p->flags; rfe.flags = p->flags;
rfe.pos = p->pos; rfe.pos = p->pos;
rfe.fown = &fown; rfe.fown = (FownEntry *)&p->fown;
rfe.name = path; rfe.name = path;
rfd = fdset_fd(glob_fdset, CR_FD_REG_FILES); rfd = fdset_fd(glob_fdset, CR_FD_REG_FILES);
...@@ -373,7 +370,7 @@ static int open_path(struct file_desc *d, ...@@ -373,7 +370,7 @@ static int open_path(struct file_desc *d,
if (rfi->remap_path) if (rfi->remap_path)
unlink(rfi->path); unlink(rfi->path);
if (pb_restore_fown(tmp, rfi->rfe->fown)) if (restore_fown(tmp, rfi->rfe->fown))
return -1; return -1;
return tmp; return tmp;
......
...@@ -102,8 +102,7 @@ void show_saved_files(void) ...@@ -102,8 +102,7 @@ void show_saved_files(void)
} }
} }
/* FIXME Drop it after PB merged */ int restore_fown(int fd, FownEntry *fown)
int restore_fown(int fd, fown_t *fown)
{ {
struct f_owner_ex owner; struct f_owner_ex owner;
uid_t uids[3]; uid_t uids[3];
...@@ -147,52 +146,7 @@ int restore_fown(int fd, fown_t *fown) ...@@ -147,52 +146,7 @@ int restore_fown(int fd, fown_t *fown)
return 0; return 0;
} }
int pb_restore_fown(int fd, FownEntry *fown) int rst_file_params(int fd, FownEntry *fown, int flags)
{
struct f_owner_ex owner;
uid_t uids[3];
pid_t pid = getpid();
if (fown->signum) {
if (fcntl(fd, F_SETSIG, fown->signum)) {
pr_perror("%d: Can't set signal", pid);
return -1;
}
}
/* May be untouched */
if (!fown->pid)
return 0;
if (getresuid(&uids[0], &uids[1], &uids[2])) {
pr_perror("%d: Can't get current UIDs", pid);
return -1;
}
if (setresuid(fown->uid, fown->euid, uids[2])) {
pr_perror("%d: Can't set UIDs", pid);
return -1;
}
owner.type = fown->pid_type;
owner.pid = fown->pid;
if (fcntl(fd, F_SETOWN_EX, &owner)) {
pr_perror("%d: Can't setup %d file owner pid",
pid, fd);
return -1;
}
if (setresuid(uids[0], uids[1], uids[2])) {
pr_perror("%d: Can't revert UIDs back", pid);
return -1;
}
return 0;
}
/* FIXME Drop it after PB merged */
int rst_file_params(int fd, fown_t *fown, int flags)
{ {
if (set_fd_flags(fd, flags) < 0) if (set_fd_flags(fd, flags) < 0)
return -1; return -1;
...@@ -201,27 +155,6 @@ int rst_file_params(int fd, fown_t *fown, int flags) ...@@ -201,27 +155,6 @@ int rst_file_params(int fd, fown_t *fown, int flags)
return 0; return 0;
} }
/* FIXME Drop once PB merged */
void pb_prep_fown(FownEntry *dst, const fown_t *src)
{
fown_entry__init(dst);
dst->uid = src->uid;
dst->euid = src->euid;
dst->signum = src->signum;
dst->pid_type = src->pid_type;
dst->pid = src->pid;
}
int pb_rst_file_params(int fd, FownEntry *fown, int flags)
{
if (set_fd_flags(fd, flags) < 0)
return -1;
if (pb_restore_fown(fd, fown) < 0)
return -1;
return 0;
}
static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info) static int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info)
{ {
struct fdinfo_list_entry *l, *le = &fdinfo_list[nr_fdinfo_list]; struct fdinfo_list_entry *l, *le = &fdinfo_list[nr_fdinfo_list];
......
...@@ -115,11 +115,9 @@ void show_creds(int fd, struct cr_options *o); ...@@ -115,11 +115,9 @@ void show_creds(int fd, struct cr_options *o);
void show_fs(int fd, struct cr_options *o); void show_fs(int fd, struct cr_options *o);
void show_remap_files(int fd, struct cr_options *o); void show_remap_files(int fd, struct cr_options *o);
void show_ghost_file(int fd, struct cr_options *o); void show_ghost_file(int fd, struct cr_options *o);
void show_fown_cont(fown_t *fown); void show_fown_cont(void *p);
void show_eventfds(int fd, struct cr_options *o); void show_eventfds(int fd, struct cr_options *o);
void pb_show_fown_cont(void *p);
extern void print_data(unsigned long addr, unsigned char *data, size_t size); extern void print_data(unsigned long addr, unsigned char *data, size_t size);
extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX]; extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX];
......
...@@ -22,9 +22,15 @@ struct fd_parms { ...@@ -22,9 +22,15 @@ struct fd_parms {
char fd_flags; char fd_flags;
struct stat stat; struct stat stat;
pid_t pid; pid_t pid;
fown_t fown; FownEntry fown;
}; };
#define FD_PARMS_INIT \
{ \
.fd = FD_DESC_INVALID, \
.fown = FOWN_ENTRY__INIT, \
}
enum fdinfo_states { enum fdinfo_states {
FD_STATE_PREP, /* Create unix sockets */ FD_STATE_PREP, /* Create unix sockets */
FD_STATE_CREATE, /* Create and send fd */ FD_STATE_CREATE, /* Create and send fd */
...@@ -73,12 +79,8 @@ extern struct fdinfo_list_entry *file_master(struct file_desc *d); ...@@ -73,12 +79,8 @@ extern struct fdinfo_list_entry *file_master(struct file_desc *d);
extern struct file_desc *find_file_desc_raw(int type, u32 id); extern struct file_desc *find_file_desc_raw(int type, u32 id);
extern int send_fd_to_peer(int fd, struct fdinfo_list_entry *fle, int transport); extern int send_fd_to_peer(int fd, struct fdinfo_list_entry *fle, int transport);
extern int restore_fown(int fd, fown_t *fown); extern int restore_fown(int fd, FownEntry *fown);
extern int rst_file_params(int fd, fown_t *fown, int flags); extern int rst_file_params(int fd, FownEntry *fown, int flags);
extern int pb_restore_fown(int fd, FownEntry *fown);
extern int pb_rst_file_params(int fd, FownEntry *fown, int flags);
extern void pb_prep_fown(FownEntry *dst, const fown_t *src);
extern void show_saved_files(void); extern void show_saved_files(void);
......
...@@ -61,14 +61,6 @@ enum fd_types { ...@@ -61,14 +61,6 @@ enum fd_types {
#define PAGE_RSS 1 #define PAGE_RSS 1
#define PAGE_ANON 2 #define PAGE_ANON 2
typedef struct {
u32 uid;
u32 euid;
u32 signum;
u32 pid_type;
u32 pid;
} __packed fown_t;
/* /*
* Top bit set in the tgt id means we've remapped * Top bit set in the tgt id means we've remapped
* to a ghost file. * to a ghost file.
......
...@@ -83,13 +83,10 @@ static int dump_inotify_entry(union fdinfo_entries *e, void *arg) ...@@ -83,13 +83,10 @@ static int dump_inotify_entry(union fdinfo_entries *e, void *arg)
static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p) static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
{ {
InotifyFileEntry ie = INOTIFY_FILE_ENTRY__INIT; InotifyFileEntry ie = INOTIFY_FILE_ENTRY__INIT;
FownEntry fown;
pb_prep_fown(&fown, &p->fown);
ie.id = id; ie.id = id;
ie.flags = p->flags; ie.flags = p->flags;
ie.fown = &fown; ie.fown = (FownEntry *)&p->fown;
pr_info("inotify: id 0x%08x flags 0x%08x\n", ie.id, ie.flags); pr_info("inotify: id 0x%08x flags 0x%08x\n", ie.id, ie.flags);
if (pb_write(fdset_fd(glob_fdset, CR_FD_INOTIFY), &ie, inotify_file_entry)) if (pb_write(fdset_fd(glob_fdset, CR_FD_INOTIFY), &ie, inotify_file_entry))
...@@ -191,7 +188,7 @@ static int open_inotify_fd(struct file_desc *d) ...@@ -191,7 +188,7 @@ static int open_inotify_fd(struct file_desc *d)
} }
} }
if (pb_restore_fown(tmp, info->ife->fown)) if (restore_fown(tmp, info->ife->fown))
close_safe(&tmp); close_safe(&tmp);
return tmp; return tmp;
......
...@@ -231,7 +231,7 @@ static int recv_pipe_fd(struct pipe_info *pi) ...@@ -231,7 +231,7 @@ static int recv_pipe_fd(struct pipe_info *pi)
close(tmp); close(tmp);
if (fd >= 0) { if (fd >= 0) {
if (pb_restore_fown(fd, pi->pe->fown)) { if (restore_fown(fd, pi->pe->fown)) {
close(fd); close(fd);
return -1; return -1;
} }
...@@ -288,7 +288,7 @@ static int open_pipe(struct file_desc *d) ...@@ -288,7 +288,7 @@ static int open_pipe(struct file_desc *d)
close(pfd[!(pi->pe->flags & O_WRONLY)]); close(pfd[!(pi->pe->flags & O_WRONLY)]);
tmp = pfd[pi->pe->flags & O_WRONLY]; tmp = pfd[pi->pe->flags & O_WRONLY];
if (pb_rst_file_params(tmp, pi->pe->fown, pi->pe->flags)) if (rst_file_params(tmp, pi->pe->fown, pi->pe->flags))
return -1; return -1;
return tmp; return tmp;
...@@ -430,17 +430,14 @@ static struct pipe_data_dump pd_pipes = { .img_type = CR_FD_PIPES_DATA, }; ...@@ -430,17 +430,14 @@ static struct pipe_data_dump pd_pipes = { .img_type = CR_FD_PIPES_DATA, };
static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p) static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p)
{ {
PipeEntry pe = PIPE_ENTRY__INIT; PipeEntry pe = PIPE_ENTRY__INIT;
FownEntry fown = FOWN_ENTRY__INIT;
pr_info("Dumping pipe %d with id %#x pipe_id %#x\n", pr_info("Dumping pipe %d with id %#x pipe_id %#x\n",
lfd, id, pipe_id(p)); lfd, id, pipe_id(p));
pb_prep_fown(&fown, &p->fown);
pe.id = id; pe.id = id;
pe.pipe_id = pipe_id(p); pe.pipe_id = pipe_id(p);
pe.flags = p->flags; pe.flags = p->flags;
pe.fown = &fown; pe.fown = (FownEntry *)&p->fown;
if (pb_write(fdset_fd(glob_fdset, CR_FD_PIPES), &pe, pipe_entry)) if (pb_write(fdset_fd(glob_fdset, CR_FD_PIPES), &pe, pipe_entry))
return -1; return -1;
......
...@@ -169,7 +169,6 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -169,7 +169,6 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p)
struct inet_sk_desc *sk; struct inet_sk_desc *sk;
InetSkEntry ie = INET_SK_ENTRY__INIT; InetSkEntry ie = INET_SK_ENTRY__INIT;
SkOptsEntry skopts = SK_OPTS_ENTRY__INIT; SkOptsEntry skopts = SK_OPTS_ENTRY__INIT;
FownEntry fown;
int ret = -1; int ret = -1;
sk = (struct inet_sk_desc *)lookup_socket(p->stat.st_ino); sk = (struct inet_sk_desc *)lookup_socket(p->stat.st_ino);
...@@ -184,8 +183,6 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -184,8 +183,6 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p)
BUG_ON(sk->sd.already_dumped); BUG_ON(sk->sd.already_dumped);
pb_prep_fown(&fown, &p->fown);
ie.id = id; ie.id = id;
ie.ino = sk->sd.ino; ie.ino = sk->sd.ino;
ie.family = sk->sd.family; ie.family = sk->sd.family;
...@@ -197,7 +194,7 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -197,7 +194,7 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p)
ie.backlog = sk->wqlen; ie.backlog = sk->wqlen;
ie.flags = p->flags; ie.flags = p->flags;
ie.fown = &fown; ie.fown = (FownEntry *)&p->fown;
ie.opts = &skopts; ie.opts = &skopts;
ie.n_src_addr = 4; ie.n_src_addr = 4;
...@@ -390,7 +387,7 @@ static int open_inet_sk(struct file_desc *d) ...@@ -390,7 +387,7 @@ static int open_inet_sk(struct file_desc *d)
inet_connect(sk, ii)) inet_connect(sk, ii))
goto err; goto err;
done: done:
if (pb_rst_file_params(sk, ii->ie->fown, ii->ie->flags)) if (rst_file_params(sk, ii->ie->fown, ii->ie->flags))
goto err; goto err;
if (pb_restore_socket_opts(sk, ii->ie->opts)) if (pb_restore_socket_opts(sk, ii->ie->opts))
...@@ -503,7 +500,7 @@ void show_inetsk(int fd, struct cr_options *o) ...@@ -503,7 +500,7 @@ void show_inetsk(int fd, struct cr_options *o)
pr_msg("id %#x ino %#x family %s type %s proto %s state %s %s:%d <-> %s:%d flags 0x%2x\n", pr_msg("id %#x ino %#x family %s type %s proto %s state %s %s:%d <-> %s:%d flags 0x%2x\n",
ie->id, ie->ino, skfamily2s(ie->family), sktype2s(ie->type), skproto2s(ie->proto), ie->id, ie->ino, skfamily2s(ie->family), sktype2s(ie->type), skproto2s(ie->proto),
skstate2s(ie->state), src_addr, ie->src_port, dst_addr, ie->dst_port, ie->flags); skstate2s(ie->state), src_addr, ie->src_port, dst_addr, ie->dst_port, ie->flags);
pr_msg("\t"), pb_show_fown_cont(ie->fown), pr_msg("\n"); pr_msg("\t"), show_fown_cont(ie->fown), pr_msg("\n");
pb_show_socket_opts(ie->opts); pb_show_socket_opts(ie->opts);
inet_sk_entry__free_unpacked(ie, NULL); inet_sk_entry__free_unpacked(ie, NULL);
......
...@@ -111,7 +111,6 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -111,7 +111,6 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p)
{ {
struct unix_sk_desc *sk; struct unix_sk_desc *sk;
UnixSkEntry ue = UNIX_SK_ENTRY__INIT; UnixSkEntry ue = UNIX_SK_ENTRY__INIT;
FownEntry fown = FOWN_ENTRY__INIT;
SkOptsEntry skopts = SK_OPTS_ENTRY__INIT; SkOptsEntry skopts = SK_OPTS_ENTRY__INIT;
sk = (struct unix_sk_desc *)lookup_socket(p->stat.st_ino); sk = (struct unix_sk_desc *)lookup_socket(p->stat.st_ino);
...@@ -123,8 +122,6 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -123,8 +122,6 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p)
BUG_ON(sk->sd.already_dumped); BUG_ON(sk->sd.already_dumped);
pb_prep_fown(&fown, &p->fown);
ue.name.len = (size_t)sk->namelen; ue.name.len = (size_t)sk->namelen;
ue.name.data = (void *)sk->name; ue.name.data = (void *)sk->name;
...@@ -135,7 +132,7 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p) ...@@ -135,7 +132,7 @@ static int dump_one_unix_fd(int lfd, u32 id, const struct fd_parms *p)
ue.flags = p->flags; ue.flags = p->flags;
ue.backlog = sk->wqlen; ue.backlog = sk->wqlen;
ue.peer = sk->peer_ino; ue.peer = sk->peer_ino;
ue.fown = &fown; ue.fown = (FownEntry *)&p->fown;
ue.opts = &skopts; ue.opts = &skopts;
ue.uflags = 0; ue.uflags = 0;
...@@ -469,7 +466,7 @@ void show_unixsk(int fd, struct cr_options *o) ...@@ -469,7 +466,7 @@ void show_unixsk(int fd, struct cr_options *o)
pr_msg(" --> %s\n", ue->name.data); pr_msg(" --> %s\n", ue->name.data);
} else } else
pr_msg("\n"); pr_msg("\n");
pb_show_fown_cont(ue->fown); show_fown_cont(ue->fown);
pr_msg("\n"); pr_msg("\n");
if (ue->opts) if (ue->opts)
...@@ -540,7 +537,7 @@ try_again: ...@@ -540,7 +537,7 @@ try_again:
if (restore_sk_queue(fle->fe->fd, peer->ue->id)) if (restore_sk_queue(fle->fe->fd, peer->ue->id))
return -1; return -1;
if (pb_rst_file_params(fle->fe->fd, ui->ue->fown, ui->ue->flags)) if (rst_file_params(fle->fe->fd, ui->ue->fown, ui->ue->flags))
return -1; return -1;
if (pb_restore_socket_opts(fle->fe->fd, ui->ue->opts)) if (pb_restore_socket_opts(fle->fe->fd, ui->ue->opts))
...@@ -610,7 +607,7 @@ static int open_unixsk_pair_master(struct unix_sk_info *ui) ...@@ -610,7 +607,7 @@ static int open_unixsk_pair_master(struct unix_sk_info *ui)
if (bind_unix_sk(sk[0], ui)) if (bind_unix_sk(sk[0], ui))
return -1; return -1;
if (pb_rst_file_params(sk[0], ui->ue->fown, ui->ue->flags)) if (rst_file_params(sk[0], ui->ue->fown, ui->ue->flags))
return -1; return -1;
tsk = socket(PF_UNIX, SOCK_DGRAM, 0); tsk = socket(PF_UNIX, SOCK_DGRAM, 0);
...@@ -651,7 +648,7 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui) ...@@ -651,7 +648,7 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui)
if (bind_unix_sk(sk, ui)) if (bind_unix_sk(sk, ui))
return -1; return -1;
if (pb_rst_file_params(sk, ui->ue->fown, ui->ue->flags)) if (rst_file_params(sk, ui->ue->fown, ui->ue->flags))
return -1; return -1;
if (pb_restore_socket_opts(sk, ui->ue->opts)) if (pb_restore_socket_opts(sk, ui->ue->opts))
...@@ -683,7 +680,7 @@ static int open_unixsk_standalone(struct unix_sk_info *ui) ...@@ -683,7 +680,7 @@ static int open_unixsk_standalone(struct unix_sk_info *ui)
return -1; return -1;
} }
if (pb_rst_file_params(sk, ui->ue->fown, ui->ue->flags)) if (rst_file_params(sk, ui->ue->fown, ui->ue->flags))
return -1; return -1;
if (pb_restore_socket_opts(sk, ui->ue->opts)) if (pb_restore_socket_opts(sk, ui->ue->opts))
......
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