Subject: Re: mp->mnt_vnodelist change
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 10/20/2006 15:10:44
In article <20061019230224.GA676@rangerover.13thmonkey.org>,
Reinoud Zandijk <reinoud@netbsd.org> wrote:
>
>If noone objects i'd like to commit this patch.
>
>With regards,
>Reinoud
>
>
>-=-=-=-=-=-
>
>- if ((vp->v_mount = mp) != NULL)
>- LIST_INSERT_HEAD(&mp->mnt_vnodelist, vp, v_mntvnodes);
>+ if ((vp->v_mount = mp) != NULL) {
>+ if (TAILQ_EMPTY(&mp->mnt_vnodelist)) {
>+ TAILQ_INSERT_HEAD(&mp->mnt_vnodelist, vp, v_mntvnodes);
>+ } else {
>+ TAILQ_INSERT_TAIL(&mp->mnt_vnodelist, vp, v_mntvnodes);
>+ }
>+ }
Why do you need to special case the empty TAILQ? Doesnt' TAILQ_INSTERT_TAIL
work all the time?
christos