Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: added a tail pointer in mntinfo_add_list #2593

Open
wants to merge 3 commits into
base: criu-dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions criu/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,22 @@ static void mntinfo_add_list(struct mount_info *new)
{
if (!mntinfo) {
mntinfo = new;
mntinfo->tail = new->tail;
}
else {
mntinfo->tail->next = new;
mntinfo->tail = new->tail;
mntinfo->tail = new->tail;
} else {
mntinfo->tail->next = new;
mntinfo->tail = new->tail;
}
}

struct mount_info *tail_buffer;

void mntinfo_add_list_before(struct mount_info **head, struct mount_info *new)
{
if(!*head)
tail_buffer = new;
if (!*head) {
tail_buffer = new;
}

new->next = *head;
new->next = *head;
new->tail = tail_buffer;
*head = new;
}
Expand Down Expand Up @@ -1202,7 +1202,7 @@ int __check_mountpoint_fd(struct mount_info *pm, int mnt_fd, bool parse_mountinf
return 0;

pr_warn("The file system %#x %#x (%#x) %s %s is inaccessible\n", pm->s_dev, pm->s_dev_rt, dev,
pm->fstype->name, pm->ns_mountpoint);
pm->fstype->name, pm->ns_mountpoint);
return -1;
}

Expand Down Expand Up @@ -1959,7 +1959,7 @@ static int dump_mnt_ns(struct ns_id *ns, struct mount_info *pms)
_mi = list_entry(_mi->children._el, struct mount_info, siblings); \
continue; \
} \
up: \
up: \
ankushT369 marked this conversation as resolved.
Show resolved Hide resolved
if (_fn_r(_mi)) \
return -1; \
if (_mi == _r) \
Expand Down