diff options
author | rwatson <rwatson@FreeBSD.org> | 2000-10-04 04:41:33 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2000-10-04 04:41:33 +0000 |
commit | 4e1437729385a3d9cb9842e9255eda4f3e76fc2e (patch) | |
tree | 90f7d2e61dd3d733a4670eee052e55d7c0d7f2c3 | |
parent | 4e290e67b7310d906f113850fddfdf1017a9d15b (diff) | |
download | FreeBSD-src-4e1437729385a3d9cb9842e9255eda4f3e76fc2e.zip FreeBSD-src-4e1437729385a3d9cb9842e9255eda4f3e76fc2e.tar.gz |
o Correct use of lockdestroy() by adding a new ufs_extattr_uepm_destroy()
call, which should be the last thing down to a per-mount extattr
management structure, after ufs_extattr_stop() on the file system.
This currently has the effect only of destroying the per-mount lock
on extended attributes, and clearing appropriate flags.
o Remove inappropriate invocation in ufs_extattr_vnode_inactive().
-rw-r--r-- | sys/ufs/ufs/extattr.h | 3 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 24 |
2 files changed, 25 insertions, 2 deletions
diff --git a/sys/ufs/ufs/extattr.h b/sys/ufs/ufs/extattr.h index 834efd5..b58a173 100644 --- a/sys/ufs/ufs/extattr.h +++ b/sys/ufs/ufs/extattr.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ + * $FreeBSD$ */ /* * TrustedBSD Project - extended attribute support for UFS-like file systems @@ -89,6 +89,7 @@ struct ufs_extattr_per_mount { }; void ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm); +void ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm); int ufs_extattr_start(struct mount *mp, struct proc *p); int ufs_extattr_stop(struct mount *mp, struct proc *p); int ufs_extattrctl(struct mount *mp, int cmd, const char *attrname, diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index da9ede2..6b45bb8 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -145,6 +145,29 @@ ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm) } /* + * Destroy per-FS structures supporting extended attributes. Assumes + * that EAs have already been stopped, and will panic if not. + */ +void +ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm) +{ + + if (!(uepm->uepm_flags & UFS_EXTATTR_UEPM_INITIALIZED)) + panic("ufs_extattr_uepm_destroy: not initialized"); + + if (!(uepm->uepm_flags & UFS_EXTATTR_UEPM_STARTED)) + panic("ufs_extattr_uepm_destroy: called while still started"); + + /* + * XXX: It's not clear that either order for the next two lines is + * ideal, and it should never be a problem if this is only called + * during unmount, and with vfs_busy(). + */ + uepm->uepm_flags &= ~UFS_EXTATTR_UEPM_INITIALIZED; + lockdestroy(&uepm->uepm_lock); +} + +/* * Start extended attribute support on an FS */ int @@ -855,5 +878,4 @@ ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p) ufs_extattr_rm(vp, uele->uele_attrname, 0, p); ufs_extattr_uepm_unlock(ump, p); - lockdestroy(&ump->um_extattr.uepm_lock); } |