linuxÖУ¬vfsmount½á¹¹¼Ç¼¹ÒÔØÎļþϵͳ¡£ÆäÊý¾Ý³ÉÔ±mnt_parentÖ¸Ïò¸ÃÎļþϵͳµÄ¸¸Îļþϵͳ£¬ mnt_mountsÊǺ¢×ÓÎļþϵͳµÄÁ´Í·²¿£¬mnt_childÖ¸ÏòÐֵܽáµã
ÀýÈç ϵͳµÄ¸ùÎļþϵͳÊÇext3¸ñʽ£¬ÔÚ/mnt/winc /mnt/wind /mnt/wine Ŀ¼ÉÏ·Ö±ð¹ÒÔØÈý¸ö·ÖÇø£¨¿ÉÒÔÈÏΪÊÇwindowsϵÄc d e ÅÌ£©¡£ÕâÑùϵͳ¾ÍΪйÒÔصÄÈý¸öÎļþϵͳ·Ö±ð·ÖÅäÁËvfsmount½á¹¹£¬²¢½«Æä mnt_parent Ö¸Ïò¸ùÎļþϵͳµÄvfsmount½á¹¹£¬Í¨¹ýmnt_childÁ´Èë¸úÎļþϵͳvfsmountµÄmnt_mounts Á´±í£¬³õʼ»¯mnt_mountsÖ¸Ïò×ÔÉí.
Äں˴úÂëÖУ¬¶ÔÒ»Ìض¨vfsmountΪ¸ùµÄmountÊ÷±éÀú£¬Óõ½ÁËÏȸù±éÀúËã·¨£º
static struct vfsmount *next_mnt(struct vfsmount *p, struct vfsmount *root)
{
struct list_head *next = p->mnt_mounts.next;
if (next == &p->mnt_mounts) {
while (1) {
if (p == root)
return NULL;
next = p->mnt_child.next;
if (next != &p->mnt_parent->mnt_mounts)
break;
p = p->mnt_parent;
}
}
return list_entry(next, struct vfsmount, mnt_child);
}