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:
parent
a18b1f1d4d
commit
d32d56a07d
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user