Skip to content

Commit

Permalink
optimize: added a tail pointer in mntinfo_add_list
Browse files Browse the repository at this point in the history
  • Loading branch information
ankushT369 committed Feb 7, 2025
1 parent bf8c2e8 commit 679741f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions criu/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ struct mount_info *tail_buffer;

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

new->next = *head;
new->tail = tail_buffer;
Expand Down Expand Up @@ -1202,7 +1201,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 +1958,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: \
if (_fn_r(_mi)) \
return -1; \
if (_mi == _r) \
Expand Down

0 comments on commit 679741f

Please sign in to comment.