summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_fat.c36
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c38
-rw-r--r--sys/fs/msdosfs/msdosfsmount.h1
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c2
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c4
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c2
6 files changed, 47 insertions, 36 deletions
diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c
index 3994042..c660601 100644
--- a/sys/fs/msdosfs/msdosfs_fat.c
+++ b/sys/fs/msdosfs/msdosfs_fat.c
@@ -328,29 +328,6 @@ updatefats(pmp, bp, fatbn)
printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn);
#endif
- /*
- * If we have an FSInfo block, update it.
- */
- if (pmp->pm_fsinfo) {
- if (bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec,
- NOCRED, &bpn) != 0) {
- /*
- * Ignore the error, but turn off FSInfo update for the future.
- */
- pmp->pm_fsinfo = 0;
- brelse(bpn);
- } else {
- struct fsinfo *fp = (struct fsinfo *)bpn->b_data;
-
- putulong(fp->fsinfree, pmp->pm_freeclustercount);
- putulong(fp->fsinxtfree, pmp->pm_nxtfree);
- if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT)
- bwrite(bpn);
- else
- bdwrite(bpn);
- }
- }
-
if (pmp->pm_flags & MSDOSFS_FATMIRROR) {
/*
* Now copy the block(s) of the modified fat to the other copies of
@@ -393,9 +370,6 @@ updatefats(pmp, bp, fatbn)
bwrite(bp);
else
bdwrite(bp);
- /*
- * Maybe update fsinfo sector here?
- */
}
/*
@@ -431,6 +405,7 @@ usemap_alloc(pmp, cn)
pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little"));
pmp->pm_freeclustercount--;
+ pmp->pm_flags |= MSDOSFS_FSIMOD;
}
static __inline void
@@ -441,6 +416,7 @@ usemap_free(pmp, cn)
MSDOSFS_ASSERT_MP_LOCKED(pmp);
pmp->pm_freeclustercount++;
+ pmp->pm_flags |= MSDOSFS_FSIMOD;
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
!= 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
@@ -742,7 +718,10 @@ chainalloc(pmp, start, count, fillwith, retcluster, got)
for (cl = start, n = count; n-- > 0;)
usemap_alloc(pmp, cl++);
-
+ pmp->pm_nxtfree = start + count;
+ if (pmp->pm_nxtfree > pmp->pm_maxcluster)
+ pmp->pm_nxtfree = CLUST_FIRST;
+ pmp->pm_flags |= MSDOSFS_FSIMOD;
error = fatchain(pmp, start, count, fillwith);
if (error != 0)
return (error);
@@ -754,9 +733,6 @@ chainalloc(pmp, start, count, fillwith, retcluster, got)
*retcluster = start;
if (got)
*got = count;
- pmp->pm_nxtfree = start + count;
- if (pmp->pm_nxtfree > pmp->pm_maxcluster)
- pmp->pm_nxtfree = CLUST_FIRST;
return (0);
}
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index a209970..213dd00 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -896,6 +896,40 @@ msdosfs_statfs(struct mount *mp, struct statfs *sbp)
return (0);
}
+/*
+ * If we have an FSInfo block, update it.
+ */
+static int
+msdosfs_fsiflush(struct msdosfsmount *pmp, int waitfor)
+{
+ struct fsinfo *fp;
+ struct buf *bp;
+ int error;
+
+ MSDOSFS_LOCK_MP(pmp);
+ if (pmp->pm_fsinfo == 0 || (pmp->pm_flags & MSDOSFS_FSIMOD) == 0) {
+ error = 0;
+ goto unlock;
+ }
+ error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec,
+ NOCRED, &bp);
+ if (error != 0) {
+ brelse(bp);
+ goto unlock;
+ }
+ fp = (struct fsinfo *)bp->b_data;
+ putulong(fp->fsinfree, pmp->pm_freeclustercount);
+ putulong(fp->fsinxtfree, pmp->pm_nxtfree);
+ pmp->pm_flags &= ~MSDOSFS_FSIMOD;
+ if (waitfor == MNT_WAIT)
+ error = bwrite(bp);
+ else
+ bawrite(bp);
+unlock:
+ MSDOSFS_UNLOCK_MP(pmp);
+ return (error);
+}
+
static int
msdosfs_sync(struct mount *mp, int waitfor)
{
@@ -958,6 +992,10 @@ loop:
allerror = error;
VOP_UNLOCK(pmp->pm_devvp, 0);
}
+
+ error = msdosfs_fsiflush(pmp, waitfor);
+ if (error != 0)
+ allerror = error;
return (allerror);
}
diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h
index 673095e..10ed95b 100644
--- a/sys/fs/msdosfs/msdosfsmount.h
+++ b/sys/fs/msdosfs/msdosfsmount.h
@@ -262,6 +262,7 @@ struct msdosfs_args {
#define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */
#define MSDOSFS_FATMIRROR 0x20000000 /* FAT is mirrored */
#define MSDOSFS_LARGEFS 0x10000000 /* perform fileno mapping */
+#define MSDOSFS_FSIMOD 0x01000000
#define MSDOSFS_ARGSMAGIC 0xe4eff300
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index f08ba85..86b6987 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -1080,7 +1080,6 @@ newnfs_set_sigmask(struct thread *td, sigset_t *oldset)
SIGDELSET(newset, newnfs_sig_set[i]);
}
mtx_unlock(&p->p_sigacts->ps_mtx);
- sigdeferstop(td);
kern_sigprocmask(td, SIG_SETMASK, &newset, oldset,
SIGPROCMASK_PROC_LOCKED);
PROC_UNLOCK(p);
@@ -1092,7 +1091,6 @@ newnfs_restore_sigmask(struct thread *td, sigset_t *set)
if (td == NULL)
td = curthread; /* XXX */
kern_sigprocmask(td, SIG_SETMASK, set, NULL, 0);
- sigallowstop(td);
}
/*
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index a774103..c62000c 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -1888,7 +1888,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p)
struct nfsreq *rep;
u_int64_t len;
u_int32_t delegtype = NFSV4OPEN_DELEGATEWRITE, mode;
- int i, igotlock = 0, error, trycnt, firstlock, s;
+ int i, igotlock = 0, error, trycnt, firstlock;
struct nfscllayout *lyp, *nlyp;
/*
@@ -1945,14 +1945,12 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p)
* This will be translated to NFSERR_STALEDONTRECOVER when
* R_DONTRECOVER is set.
*/
- s = splsoftclock();
NFSLOCKREQ();
TAILQ_FOREACH(rep, &nfsd_reqq, r_chain) {
if (rep->r_nmp == nmp)
rep->r_flags |= R_DONTRECOVER;
}
NFSUNLOCKREQ();
- splx(s);
/*
* Now, mark all delegations "need reclaim".
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index 83ce3cb..281ce44 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -132,7 +132,7 @@ static struct vfsops nfs_vfsops = {
.vfs_unmount = nfs_unmount,
.vfs_sysctl = nfs_sysctl,
};
-VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK);
+VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY);
/* So that loader and kldload(2) can find us, wherever we are.. */
MODULE_VERSION(nfs, 1);
OpenPOWER on IntegriCloud