mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 15:55:53 +00:00
mount: Remove the len variable
And use the expression for it, it's quite short. This makes the amount of variables in the code fit into brains. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Acked-by: Andrew Vagin <avagin@parallels.com>
This commit is contained in:
9
mount.c
9
mount.c
@@ -428,7 +428,7 @@ static inline int path_length(char *path)
|
|||||||
static int validate_shared(struct mount_info *m)
|
static int validate_shared(struct mount_info *m)
|
||||||
{
|
{
|
||||||
struct mount_info *t, *ct;
|
struct mount_info *t, *ct;
|
||||||
int t_root_l, m_root_l, t_mpnt_l, m_mpnt_l, len;
|
int t_root_l, m_root_l, t_mpnt_l, m_mpnt_l;
|
||||||
char *m_root_rpath;
|
char *m_root_rpath;
|
||||||
LIST_HEAD(children);
|
LIST_HEAD(children);
|
||||||
|
|
||||||
@@ -480,7 +480,6 @@ static int validate_shared(struct mount_info *m)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
m_root_rpath = m->root + t_root_l; /* path from t->root to m->root */
|
m_root_rpath = m->root + t_root_l; /* path from t->root to m->root */
|
||||||
len = m_root_l - t_root_l; /* its length */
|
|
||||||
|
|
||||||
/* Search a child, which is visiable in both mounts. */
|
/* Search a child, which is visiable in both mounts. */
|
||||||
list_for_each_entry(ct, &t->children, siblings) {
|
list_for_each_entry(ct, &t->children, siblings) {
|
||||||
@@ -502,11 +501,11 @@ static int validate_shared(struct mount_info *m)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The ct has peer in m but with the mount path deeper according
|
* The ct has peer in m but with the mount path deeper according
|
||||||
* to m's depth relavie to t. Thus -- trim this difference from
|
* to m's depth relavie to t. Thus -- trim this difference (the
|
||||||
* ct's mountpoint path.
|
* lenght of m_root_rpath) from ct's mountpoint path.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ct_mpnt_rpath += len;
|
ct_mpnt_rpath += m_root_l - t_root_l;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find in m the mountpoint that fully matches with ct (with the
|
* Find in m the mountpoint that fully matches with ct (with the
|
||||||
|
Reference in New Issue
Block a user