remap: Sanitize ghost file path printing

First -- avoid two memory copies by printing ns root directly, and
second -- remove extra argument from create_ghost, the mnt_id value
we need there can be found on the ghost_file object.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2015-09-23 15:39:48 +03:00
parent 6cf77f6726
commit 152222a6b7
3 changed files with 24 additions and 23 deletions

View file

@ -115,7 +115,7 @@ extern bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev,
extern int restore_task_mnt_ns(struct pstree_item *current);
extern int depopulate_roots_yard(void);
extern char *rst_get_mnt_root(int mnt_id);
extern int rst_get_mnt_root(int mnt_id, char *path, int plen);
extern int ext_mount_add(char *key, char *val);
extern int mntns_maybe_create_roots(void);
extern void cleanup_mnt_ns(void);