summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-09-22 08:56:54 +0000
committerkib <kib@FreeBSD.org>2016-09-22 08:56:54 +0000
commit924101bf21d10b51836d7a3b03634c22c4959183 (patch)
treeb90887f5eae8f4a49803cd8ddf1529356c13b5de /sys/ufs/ffs
parent2db21703b6fa0a8620e01220b5a3981323e5babb (diff)
downloadFreeBSD-src-924101bf21d10b51836d7a3b03634c22c4959183.zip
FreeBSD-src-924101bf21d10b51836d7a3b03634c22c4959183.tar.gz
MFC r305592:
Partially lift suspension when ffs_reload() finished with cgs and going to re-read inodes.
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_extern.h3
-rw-r--r--sys/ufs/ffs/ffs_suspend.c2
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c16
3 files changed, 16 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 203bc66..56f5cd8 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -106,6 +106,9 @@ void ffs_susp_uninitialize(void);
#define FFSV_FORCEINSMQ 0x0001
+#define FFSR_FORCE 0x0001
+#define FFSR_UNSUSPEND 0x0002
+
extern struct vop_vector ffs_vnodeops1;
extern struct vop_vector ffs_fifoops1;
extern struct vop_vector ffs_vnodeops2;
diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c
index 450282c..926dba3 100644
--- a/sys/ufs/ffs/ffs_suspend.c
+++ b/sys/ufs/ffs/ffs_suspend.c
@@ -235,7 +235,7 @@ ffs_susp_dtor(void *data)
KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0,
("MNTK_SUSPEND not set"));
- error = ffs_reload(mp, curthread, 1);
+ error = ffs_reload(mp, curthread, FFSR_FORCE | FFSR_UNSUSPEND);
if (error != 0)
panic("failed to unsuspend writes on %s", fs->fs_fsmnt);
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index d644b73..b28b742 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -573,11 +573,13 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags)
* 2) re-read superblock from disk.
* 3) re-read summary information from disk.
* 4) invalidate all inactive vnodes.
- * 5) invalidate all cached file data.
- * 6) re-read inode data for all active vnodes.
+ * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary
+ * writers, if requested.
+ * 6) invalidate all cached file data.
+ * 7) re-read inode data for all active vnodes.
*/
int
-ffs_reload(struct mount *mp, struct thread *td, int force)
+ffs_reload(struct mount *mp, struct thread *td, int flags)
{
struct vnode *vp, *mvp, *devvp;
struct inode *ip;
@@ -592,7 +594,7 @@ ffs_reload(struct mount *mp, struct thread *td, int force)
ump = VFSTOUFS(mp);
MNT_ILOCK(mp);
- if ((mp->mnt_flag & MNT_RDONLY) == 0 && force == 0) {
+ if ((mp->mnt_flag & MNT_RDONLY) == 0 && (flags & FFSR_FORCE) == 0) {
MNT_IUNLOCK(mp);
return (EINVAL);
}
@@ -682,6 +684,12 @@ ffs_reload(struct mount *mp, struct thread *td, int force)
size = fs->fs_ncg * sizeof(u_int8_t);
fs->fs_contigdirs = (u_int8_t *)space;
bzero(fs->fs_contigdirs, size);
+ if ((flags & FFSR_UNSUSPEND) != 0) {
+ MNT_ILOCK(mp);
+ mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2);
+ wakeup(&mp->mnt_flag);
+ MNT_IUNLOCK(mp);
+ }
loop:
MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {
OpenPOWER on IntegriCloud