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().
This commit is contained in:
Robert Watson 2000-10-04 04:41:33 +00:00
parent a18b1f1d4d
commit d32d56a07d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66616
2 changed files with 25 additions and 2 deletions

View file

@ -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,

View file

@ -144,6 +144,29 @@ ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm)
uepm->uepm_flags |= UFS_EXTATTR_UEPM_INITIALIZED;
}
/*
* 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
*/
@ -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);
}