Commit 1e6e548b authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

unix: Use generic xptr_pull in dump_one_unix_fd

To unify style of pointers fetching from memory slab.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 1caa5915
...@@ -324,17 +324,18 @@ static int dump_one_unix_fd(int lfd, uint32_t id, const struct fd_parms *p) ...@@ -324,17 +324,18 @@ static int dump_one_unix_fd(int lfd, uint32_t id, const struct fd_parms *p)
SkOptsEntry *skopts; SkOptsEntry *skopts;
FilePermsEntry *perms; FilePermsEntry *perms;
FownEntry *fown; FownEntry *fown;
void *m;
ue = xmalloc(sizeof(UnixSkEntry) + m = xmalloc(sizeof(UnixSkEntry) +
sizeof(SkOptsEntry) + sizeof(SkOptsEntry) +
sizeof(FilePermsEntry) + sizeof(FilePermsEntry) +
sizeof(FownEntry)); sizeof(FownEntry));
if (ue == NULL) if (!m)
return -1; return -ENOMEM;
ue = xptr_pull(&m, UnixSkEntry);
skopts = (void *) ue + sizeof(UnixSkEntry); skopts = xptr_pull(&m, SkOptsEntry);
perms = (void *) skopts + sizeof(SkOptsEntry); perms = xptr_pull(&m, FilePermsEntry);
fown = (void *) perms + sizeof(FilePermsEntry); fown = xptr_pull(&m, FownEntry);
unix_sk_entry__init(ue); unix_sk_entry__init(ue);
sk_opts_entry__init(skopts); sk_opts_entry__init(skopts);
......
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