Re: 2.6.6-rc1-mm1

From: Christoph Hellwig
Date: Wed Apr 21 2004 - 08:19:38 EST


On Wed, Apr 21, 2004 at 08:31:38PM +0800, raven@xxxxxxxxxx wrote:
> If it is decided to do this then would something like this be approiate
> Andrew?
>
> I have
> - renamed autofs4_may_umount to may_umount_tree and moved
> it to namespace.c
> - removed the EXPORT_SYMBOL for vfsmount_lock
> - updated autofs4 to suit
>
> It is not possible to merge the functionality of may_umount into this as,
> it stands, as autofs v3 requires a slightly different semantic. That is if
> there are submounts that are not busy then it should return -EBUSY but
> may_umount_tree would return not busy.

What about adding a paramter 'ignore_busy_submounts' and use most of the
function in common for both autofs3 and autofs4?

> + struct list_head *next;
> + struct vfsmount *this_parent = mnt;
> + int actual_refs;
> + int minimum_refs;
> +
> + spin_lock(&vfsmount_lock);
> + actual_refs = atomic_read(&mnt->mnt_count);
> + minimum_refs = 2;
> +repeat:
> + next = this_parent->mnt_mounts.next;
> +resume:
> + while (next != &this_parent->mnt_mounts) {
> + struct vfsmount *p = list_entry(next, struct vfsmount, mnt_child);
> +
> + next = next->next;

Any chance to use list_for_each_entry here?

> + if ( !list_empty(&p->mnt_mounts) ) {

This wants a white-space fixup.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/