CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Wed May 17 06:44:38 UTC 2023 Modified Files: src/sys/fs/autofs: autofs.h Log Message: sys/fs/autofs: Remove unused APRINTF macro Remove a debug print macro (originates from DragonFly autofs) I had intentionally kept at the time. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs.h diff -u src/sys/fs/autofs/autofs.h:1.4 src/sys/fs/autofs/autofs.h:1.5 --- src/sys/fs/autofs/autofs.h:1.4 Sat Nov 23 17:13:46 2019 +++ src/sys/fs/autofs/autofs.h Wed May 17 06:44:38 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs.h,v 1.4 2019/11/23 17:13:46 tkusumi Exp $ */ +/* $NetBSD: autofs.h,v 1.5 2023/05/17 06:44:38 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -95,13 +95,6 @@ extern int autofs_interruptible; } \ } while (0) -/* - * APRINTF is only for debugging. - */ -#define APRINTF(X, ...) \ - printf("### %s(%s): " X, \ - __func__, curproc->p_comm, ## __VA_ARGS__) - struct autofs_node { RB_ENTRY(autofs_node) an_entry; char*an_name;
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Wed May 17 06:44:38 UTC 2023 Modified Files: src/sys/fs/autofs: autofs.h Log Message: sys/fs/autofs: Remove unused APRINTF macro Remove a debug print macro (originates from DragonFly autofs) I had intentionally kept at the time. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/fs/autofs
On Tue, Dec 13, 2022 at 12:32:26AM +1100, matthew green wrote: > "Michael van Elst" writes: > > Module Name:src > > Committed By: mlelstv > > Date: Sun Dec 11 11:31:55 UTC 2022 > > > > Modified Files: > > src/sys/fs/autofs: autofs_vnops.c > > > > Log Message: > > Use genfs_pathconf for VOP_PATHCONF. > > Fixes bin/57103. > > i see pathconf failures with puffs (mount_psshfs) as well. psshfs doesn't implement PUFFS_VN_PATHCONF and libpuffs does: { puffs_vnmsg_pathconf *auxt = auxbuf; if (pops->puffs_node_pathconf == NULL) { error = 0; break; } ... } So that's "success" with an undefined (?) result. changing this to error = EINVAL; should help. Greetings, -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."
re: CVS commit: src/sys/fs/autofs
"Michael van Elst" writes: > Module Name: src > Committed By: mlelstv > Date: Sun Dec 11 11:31:55 UTC 2022 > > Modified Files: > src/sys/fs/autofs: autofs_vnops.c > > Log Message: > Use genfs_pathconf for VOP_PATHCONF. > Fixes bin/57103. i see pathconf failures with puffs (mount_psshfs) as well. .mrg.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: mlelstv Date: Sun Dec 11 11:31:55 UTC 2022 Modified Files: src/sys/fs/autofs: autofs_vnops.c Log Message: Use genfs_pathconf for VOP_PATHCONF. Fixes bin/57103. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs_vnops.c diff -u src/sys/fs/autofs/autofs_vnops.c:1.7 src/sys/fs/autofs/autofs_vnops.c:1.8 --- src/sys/fs/autofs/autofs_vnops.c:1.7 Tue Jun 29 22:34:06 2021 +++ src/sys/fs/autofs/autofs_vnops.c Sun Dec 11 11:31:55 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs_vnops.c,v 1.7 2021/06/29 22:34:06 dholland Exp $ */ +/* $NetBSD: autofs_vnops.c,v 1.8 2022/12/11 11:31:55 mlelstv Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. * Copyright (c) 2016 The DragonFly Project @@ -34,7 +34,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.7 2021/06/29 22:34:06 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.8 2022/12/11 11:31:55 mlelstv Exp $"); #include "autofs.h" @@ -604,6 +604,7 @@ static const struct vnodeopv_entry_desc { &vop_islocked_desc, genfs_islocked }, { &vop_getpages_desc, genfs_getpages }, { &vop_putpages_desc, genfs_putpages }, + { &vop_pathconf_desc, genfs_pathconf }, { NULL, NULL } };
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: mlelstv Date: Sun Dec 11 11:31:55 UTC 2022 Modified Files: src/sys/fs/autofs: autofs_vnops.c Log Message: Use genfs_pathconf for VOP_PATHCONF. Fixes bin/57103. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Tue Nov 26 16:17:31 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c Log Message: autofs: Use NULLVP for NULL vnode I originally used NULL for NetBSD autofs, but it got mixed up with NULLVP when merged with NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vfsops.c cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Tue Nov 26 16:17:31 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c Log Message: autofs: Use NULLVP for NULL vnode I originally used NULL for NetBSD autofs, but it got mixed up with NULLVP when merged with NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vfsops.c cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs_vfsops.c diff -u src/sys/fs/autofs/autofs_vfsops.c:1.7 src/sys/fs/autofs/autofs_vfsops.c:1.8 --- src/sys/fs/autofs/autofs_vfsops.c:1.7 Sat Nov 23 15:17:46 2019 +++ src/sys/fs/autofs/autofs_vfsops.c Tue Nov 26 16:17:31 2019 @@ -33,7 +33,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.7 2019/11/23 15:17:46 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.8 2019/11/26 16:17:31 tkusumi Exp $"); #include "autofs.h" @@ -273,7 +273,7 @@ autofs_root(struct mount *mp, struct vno error = vn_lock(*vpp, LK_EXCLUSIVE); if (error) { vrele(*vpp); - *vpp = NULL; + *vpp = NULLVP; return error; } Index: src/sys/fs/autofs/autofs_vnops.c diff -u src/sys/fs/autofs/autofs_vnops.c:1.3 src/sys/fs/autofs/autofs_vnops.c:1.4 --- src/sys/fs/autofs/autofs_vnops.c:1.3 Sat Nov 23 17:13:46 2019 +++ src/sys/fs/autofs/autofs_vnops.c Tue Nov 26 16:17:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $ */ +/* $NetBSD: autofs_vnops.c,v 1.4 2019/11/26 16:17:31 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. * Copyright (c) 2016 The DragonFly Project @@ -34,7 +34,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.4 2019/11/26 16:17:31 tkusumi Exp $"); #include "autofs.h" @@ -87,7 +87,7 @@ autofs_getattr(void *v) if (autofs_mount_on_stat && autofs_cached(anp, NULL, 0) == false && autofs_ignore_thread() == false) { - struct vnode *newvp = NULL; + struct vnode *newvp = NULLVP; int error = autofs_trigger_vn(vp, "", 0, &newvp); if (error) return error; @@ -171,7 +171,7 @@ mounted: return error; if (!vp->v_mountedhere) { - *newvp = NULL; + *newvp = NULLVP; return 0; } else { /* @@ -212,7 +212,7 @@ autofs_lookup(void *v) KASSERT(VOP_ISLOCKED(dvp)); anp = VTOI(dvp); - *vpp = NULL; + *vpp = NULLVP; /* Check accessibility of directory. */ KASSERT(!VOP_ACCESS(dvp, VEXEC, cnp->cn_cred)); @@ -259,7 +259,7 @@ autofs_lookup(void *v) if (autofs_cached(anp, cnp->cn_nameptr, cnp->cn_namelen) == false && autofs_ignore_thread() == false) { - struct vnode *newvp = NULL; + struct vnode *newvp = NULLVP; error = autofs_trigger_vn(dvp, cnp->cn_nameptr, cnp->cn_namelen, &newvp); if (error) @@ -468,7 +468,7 @@ autofs_readdir(void *v) if (autofs_cached(anp, NULL, 0) == false && autofs_ignore_thread() == false) { - struct vnode *newvp = NULL; + struct vnode *newvp = NULLVP; error = autofs_trigger_vn(vp, "", 0, &newvp); if (error) return error; @@ -578,7 +578,7 @@ autofs_reclaim(void *v) * We do not free autofs_node here; instead we are * destroying them in autofs_node_delete(). */ - anp->an_vnode = NULL; + anp->an_vnode = NULLVP; vp->v_data = NULL; return 0; @@ -630,7 +630,7 @@ autofs_node_new(struct autofs_node *pare getnanotime(&anp->an_ctime); anp->an_parent = parent; anp->an_mount = amp; - anp->an_vnode = NULL; + anp->an_vnode = NULLVP; anp->an_cached = false; anp->an_wildcards = false; anp->an_retries = 0;
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 17:13:46 UTC 2019 Modified Files: src/sys/fs/autofs: autofs.h autofs_vnops.c Log Message: autofs: Remove unused autofs_node::an_vnode_lock Unlike FreeBSD and DragonFlyBSD, this is unused in NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs.h cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 17:13:46 UTC 2019 Modified Files: src/sys/fs/autofs: autofs.h autofs_vnops.c Log Message: autofs: Remove unused autofs_node::an_vnode_lock Unlike FreeBSD and DragonFlyBSD, this is unused in NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs.h cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs.h diff -u src/sys/fs/autofs/autofs.h:1.3 src/sys/fs/autofs/autofs.h:1.4 --- src/sys/fs/autofs/autofs.h:1.3 Sat Nov 23 08:00:59 2019 +++ src/sys/fs/autofs/autofs.h Sat Nov 23 17:13:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs.h,v 1.3 2019/11/23 08:00:59 tkusumi Exp $ */ +/* $NetBSD: autofs.h,v 1.4 2019/11/23 17:13:46 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -111,7 +111,6 @@ struct autofs_node { autofs_node) an_children; struct autofs_mount *an_mount; struct vnode *an_vnode; - kmutex_t an_vnode_lock; boolan_cached; boolan_wildcards; struct callout an_callout; Index: src/sys/fs/autofs/autofs_vnops.c diff -u src/sys/fs/autofs/autofs_vnops.c:1.2 src/sys/fs/autofs/autofs_vnops.c:1.3 --- src/sys/fs/autofs/autofs_vnops.c:1.2 Sat Nov 23 15:17:46 2019 +++ src/sys/fs/autofs/autofs_vnops.c Sat Nov 23 17:13:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $ */ +/* $NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. * Copyright (c) 2016 The DragonFly Project @@ -34,7 +34,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $"); #include "autofs.h" @@ -578,10 +578,8 @@ autofs_reclaim(void *v) * We do not free autofs_node here; instead we are * destroying them in autofs_node_delete(). */ - mutex_enter(&anp->an_vnode_lock); anp->an_vnode = NULL; vp->v_data = NULL; - mutex_exit(&anp->an_vnode_lock); return 0; } @@ -629,7 +627,6 @@ autofs_node_new(struct autofs_node *pare anp->an_name = autofs_strndup(name, namelen, KM_SLEEP); anp->an_ino = amp->am_last_ino++; callout_init(&anp->an_callout, 0); - mutex_init(&anp->an_vnode_lock, MUTEX_DEFAULT, IPL_NONE); getnanotime(&anp->an_ctime); anp->an_parent = parent; anp->an_mount = amp; @@ -681,7 +678,6 @@ autofs_node_delete(struct autofs_node *a if (anp->an_parent) RB_REMOVE(autofs_node_tree, &anp->an_parent->an_children, anp); - mutex_destroy(&anp->an_vnode_lock); kmem_strfree(anp->an_name); pool_put(&autofs_node_pool, anp); }
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 15:17:46 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c Log Message: autofs: Don't calculate dirent reclen twice Taken-from: DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/fs/autofs/autofs_vfsops.c cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 15:17:46 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c Log Message: autofs: Don't calculate dirent reclen twice Taken-from: DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/fs/autofs/autofs_vfsops.c cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs_vfsops.c diff -u src/sys/fs/autofs/autofs_vfsops.c:1.6 src/sys/fs/autofs/autofs_vfsops.c:1.7 --- src/sys/fs/autofs/autofs_vfsops.c:1.6 Sat Nov 16 09:22:00 2019 +++ src/sys/fs/autofs/autofs_vfsops.c Sat Nov 23 15:17:46 2019 @@ -33,7 +33,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.6 2019/11/16 09:22:00 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.7 2019/11/23 15:17:46 tkusumi Exp $"); #include "autofs.h" @@ -74,6 +74,7 @@ autofs_init(void) static void autofs_done(void) { + KASSERT(autofs_softc); KASSERT(!autofs_softc->sc_dev_opened); Index: src/sys/fs/autofs/autofs_vnops.c diff -u src/sys/fs/autofs/autofs_vnops.c:1.1 src/sys/fs/autofs/autofs_vnops.c:1.2 --- src/sys/fs/autofs/autofs_vnops.c:1.1 Tue Jan 9 03:31:14 2018 +++ src/sys/fs/autofs/autofs_vnops.c Sat Nov 23 15:17:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs_vnops.c,v 1.1 2018/01/09 03:31:14 christos Exp $ */ +/* $NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. * Copyright (c) 2016 The DragonFly Project @@ -34,7 +34,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.1 2018/01/09 03:31:14 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $"); #include "autofs.h" @@ -413,8 +413,7 @@ autofs_print(void *v) } static int -autofs_readdir_one(struct uio *uio, const char *name, ino_t ino, -size_t *reclenp) +autofs_readdir_one(struct uio *uio, const char *name, ino_t ino) { struct dirent dirent; @@ -424,9 +423,6 @@ autofs_readdir_one(struct uio *uio, cons dirent.d_namlen = strlen(dirent.d_name); dirent.d_reclen = _DIRENT_SIZE(&dirent); - if (reclenp) - *reclenp = dirent.d_reclen; - if (!uio) return 0; @@ -439,11 +435,12 @@ autofs_readdir_one(struct uio *uio, cons static size_t autofs_dirent_reclen(const char *name) { - size_t reclen; + struct dirent dirent; - (void)autofs_readdir_one(NULL, name, -1, &reclen); + strlcpy(dirent.d_name, name, sizeof(dirent.d_name)); + dirent.d_namlen = strlen(dirent.d_name); - return reclen; + return _DIRENT_SIZE(&dirent); } static int @@ -463,7 +460,7 @@ autofs_readdir(void *v) struct autofs_mount *amp = VFSTOAUTOFS(vp->v_mount); struct autofs_node *anp = VTOI(vp); struct autofs_node *child; - size_t reclen, reclens; + size_t reclens; int error; if (vp->v_type != VDIR) @@ -496,7 +493,7 @@ autofs_readdir(void *v) * Write out the directory entry for ".". */ if (uio->uio_offset == 0) { - error = autofs_readdir_one(uio, ".", anp->an_ino, &reclen); + error = autofs_readdir_one(uio, ".", anp->an_ino); if (error) goto out; } @@ -509,8 +506,7 @@ autofs_readdir(void *v) if (uio->uio_offset != reclens) return EINVAL; error = autofs_readdir_one(uio, "..", - (anp->an_parent ? anp->an_parent->an_ino : anp->an_ino), - &reclen); + anp->an_parent ? anp->an_parent->an_ino : anp->an_ino); if (error) goto out; } @@ -538,9 +534,8 @@ autofs_readdir(void *v) return EINVAL; } - error = autofs_readdir_one(uio, child->an_name, - child->an_ino, &reclen); - reclens += reclen; + error = autofs_readdir_one(uio, child->an_name, child->an_ino); + reclens += autofs_dirent_reclen(child->an_name); if (error) { mutex_exit(&->am_lock); goto out; @@ -562,7 +557,7 @@ out: /* * Don't return an error if we managed to copy out some entries. */ - if (uio->uio_resid < reclen) + if (uio->uio_resid < initial_resid) return 0; return error;
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 08:30:39 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_mount.h Log Message: autofs: Fix a comment on autofs_args mount_autofs(8) also uses this. mount_autofs(8) was added by NetBSD as an optional command (not needed to use autofs). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs_mount.h diff -u src/sys/fs/autofs/autofs_mount.h:1.2 src/sys/fs/autofs/autofs_mount.h:1.3 --- src/sys/fs/autofs/autofs_mount.h:1.2 Sun Jan 14 22:43:18 2018 +++ src/sys/fs/autofs/autofs_mount.h Sat Nov 23 08:30:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs_mount.h,v 1.2 2018/01/14 22:43:18 christos Exp $ */ +/* $NetBSD: autofs_mount.h,v 1.3 2019/11/23 08:30:39 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -36,7 +36,6 @@ /* * Arguments to mount autofs filesystem. - * This structure should only be used by automount(8). */ struct autofs_args { char *from;
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 08:30:39 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_mount.h Log Message: autofs: Fix a comment on autofs_args mount_autofs(8) also uses this. mount_autofs(8) was added by NetBSD as an optional command (not needed to use autofs). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 08:00:59 UTC 2019 Modified Files: src/sys/fs/autofs: autofs.h Log Message: autofs: u_int -> unsigned int To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs.h diff -u src/sys/fs/autofs/autofs.h:1.2 src/sys/fs/autofs/autofs.h:1.3 --- src/sys/fs/autofs/autofs.h:1.2 Sat Nov 23 07:38:03 2019 +++ src/sys/fs/autofs/autofs.h Sat Nov 23 08:00:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs.h,v 1.2 2019/11/23 07:38:03 tkusumi Exp $ */ +/* $NetBSD: autofs.h,v 1.3 2019/11/23 08:00:59 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -145,7 +145,7 @@ struct autofs_request { charar_key[AUTOFS_MAXPATHLEN]; charar_options[AUTOFS_MAXPATHLEN]; struct callout ar_callout; - volatile u_int ar_refcount; + volatile unsigned int ar_refcount; }; struct autofs_softc {
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 08:00:59 UTC 2019 Modified Files: src/sys/fs/autofs: autofs.h Log Message: autofs: u_int -> unsigned int To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 07:38:03 UTC 2019 Modified Files: src/sys/fs/autofs: autofs.h Log Message: autofs: Drop unused autofs_mount field which originates from FreeBSD Taken-from: DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 23 07:38:03 UTC 2019 Modified Files: src/sys/fs/autofs: autofs.h Log Message: autofs: Drop unused autofs_mount field which originates from FreeBSD Taken-from: DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs.h diff -u src/sys/fs/autofs/autofs.h:1.1 src/sys/fs/autofs/autofs.h:1.2 --- src/sys/fs/autofs/autofs.h:1.1 Tue Jan 9 03:31:14 2018 +++ src/sys/fs/autofs/autofs.h Sat Nov 23 07:38:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autofs.h,v 1.1 2018/01/09 03:31:14 christos Exp $ */ +/* $NetBSD: autofs.h,v 1.2 2019/11/23 07:38:03 tkusumi Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -120,7 +120,6 @@ struct autofs_node { }; struct autofs_mount { - TAILQ_ENTRY(autofs_mount) am_next; struct autofs_node *am_root; struct mount *am_mp; kmutex_t am_lock;
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 16 09:22:00 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c Log Message: autofs: Fix change by r1.3 "prevent assert on unmount." Must delete all nodes on unmount, otherwise automounts with >1 level of directories can't be deleted. taken-from: FreeBSD and DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/fs/autofs/autofs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Sat Nov 16 09:22:00 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c Log Message: autofs: Fix change by r1.3 "prevent assert on unmount." Must delete all nodes on unmount, otherwise automounts with >1 level of directories can't be deleted. taken-from: FreeBSD and DragonFlyBSD To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/fs/autofs/autofs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs_vfsops.c diff -u src/sys/fs/autofs/autofs_vfsops.c:1.5 src/sys/fs/autofs/autofs_vfsops.c:1.6 --- src/sys/fs/autofs/autofs_vfsops.c:1.5 Thu Nov 14 08:45:24 2019 +++ src/sys/fs/autofs/autofs_vfsops.c Sat Nov 16 09:22:00 2019 @@ -33,7 +33,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.5 2019/11/14 08:45:24 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.6 2019/11/16 09:22:00 tkusumi Exp $"); #include "autofs.h" @@ -232,13 +232,14 @@ autofs_unmount(struct mount *mp, int mnt mutex_enter(&->am_lock); while (!RB_EMPTY(&->am_root->an_children)) { struct autofs_node *anp; + /* + * Force delete all nodes when more than one level of + * directories are created via indirect map. Autofs doesn't + * support rmdir(2), thus this is the only way to get out. + */ anp = RB_MIN(autofs_node_tree, &->am_root->an_children); - if (!RB_EMPTY(&anp->an_children)) { - AUTOFS_DEBUG("%s: %s has children", __func__, - anp->an_name); - mutex_exit(&->am_lock); - return EBUSY; - } + while (!RB_EMPTY(&anp->an_children)) + anp = RB_MIN(autofs_node_tree, &anp->an_children); autofs_node_delete(anp); } autofs_node_delete(amp->am_root);
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Thu Nov 14 08:45:24 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c Log Message: autofs: Whitespace fix To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/fs/autofs
Module Name:src Committed By: tkusumi Date: Thu Nov 14 08:45:24 UTC 2019 Modified Files: src/sys/fs/autofs: autofs_vfsops.c Log Message: autofs: Whitespace fix To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/autofs/autofs_vfsops.c diff -u src/sys/fs/autofs/autofs_vfsops.c:1.4 src/sys/fs/autofs/autofs_vfsops.c:1.5 --- src/sys/fs/autofs/autofs_vfsops.c:1.4 Sun Jan 14 22:43:18 2018 +++ src/sys/fs/autofs/autofs_vfsops.c Thu Nov 14 08:45:24 2019 @@ -33,7 +33,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.4 2018/01/14 22:43:18 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.5 2019/11/14 08:45:24 tkusumi Exp $"); #include "autofs.h" @@ -239,7 +239,6 @@ autofs_unmount(struct mount *mp, int mnt mutex_exit(&->am_lock); return EBUSY; } - autofs_node_delete(anp); } autofs_node_delete(amp->am_root);