Rework MOUNTED/DOING SOFTDEP/SUJ macros

Now MNT_SOFTDEP indicates that SU are active in any variant +-J, and
SU+J is indicated by MNT_SOFTDEP | MNT_SUJ combination.  The reason is
that unmount will be able to easily hide SU from other operations by
clearing MNT_SOFTDEP while keeping the record of the active journal.

Reviewed by:	mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D29178
This commit is contained in:
Konstantin Belousov 2021-03-03 19:43:17 +02:00
parent 81cdb19e04
commit 7f682bdcab
2 changed files with 5 additions and 6 deletions

View File

@ -3024,7 +3024,6 @@ journal_mount(mp, fs, cred)
MNT_ILOCK(mp);
mp->mnt_flag |= MNT_SUJ;
mp->mnt_flag &= ~MNT_SOFTDEP;
MNT_IUNLOCK(mp);
/*

View File

@ -265,11 +265,11 @@ struct indir {
#define ITOV(ip) ((ip)->i_vnode)
/* Determine if soft dependencies are being done */
#define DOINGSOFTDEP(vp) \
(((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) != 0)
#define MOUNTEDSOFTDEP(mp) (((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) != 0)
#define DOINGSUJ(vp) (((vp)->v_mount->mnt_flag & MNT_SUJ) != 0)
#define MOUNTEDSUJ(mp) (((mp)->mnt_flag & MNT_SUJ) != 0)
#define MOUNTEDSOFTDEP(mp) (((mp)->mnt_flag & MNT_SOFTDEP) != 0)
#define DOINGSOFTDEP(vp) MOUNTEDSOFTDEP((vp)->v_mount)
#define MOUNTEDSUJ(mp) (((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) == \
(MNT_SOFTDEP | MNT_SUJ))
#define DOINGSUJ(vp) MOUNTEDSUJ((vp)->v_mount)
/* This overlays the fid structure (see mount.h). */
struct ufid {