Commit 7f682bdc authored by Konstantin Belousov's avatar Konstantin Belousov
Browse files

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
parent 81cdb19e
......@@ -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);
/*
......
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment