update to 20010209 for -CURRENT.

This commit is contained in:
FUJISHIMA Satsuki 2001-02-20 14:01:48 +00:00
parent e0057c90d6
commit 2c72e951b2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=38508
4 changed files with 166 additions and 104 deletions

View file

@ -24,13 +24,14 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/msdosfs.ja
.if ${OSVERSION} >= 410001 && ${OSVERSION} < 500000
LAST_UPDATED= 20001027
PATCHDIR= ${MASTERDIR}/patches.4
.elif ${OSVERSION} >= 500013
LAST_UPDATED= 20001022
.elif ${OSVERSION} >= 500016
# runs only after 9th Feb 2001 world
LAST_UPDATED= 20010209
PATCHDIR= ${MASTERDIR}/patches.5
NO_PACKAGE= "to avoid crashing a machine when try to install incorrect version"
.else
LAST_UPDATED= 20001007
BROKEN= "It may not work with your FreeBSD version (but I'm not sure)"
LAST_UPDATED= 20001022
BROKEN= "Supports up-to-date -CURRENT only"
.endif
post-extract:

View file

@ -1,7 +1,6 @@
--- msdosfs_denode.c.orig Mon Apr 10 04:32:36 2000
+++ msdosfs_denode.c Sun Oct 22 23:52:20 2000
@@ -50,24 +50,21 @@
+++ msdosfs_denode.c Sun Feb 11 16:59:48 2001
@@ -51,7 +51,4 @@
#include "opt_msdosfs.h"
-/*
@ -9,13 +8,13 @@
- */
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/mount.h>
@@ -60,13 +57,12 @@
#include <sys/malloc.h>
#include <sys/proc.h>
+#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/vnode.h>
+#include <sys/mutex.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@ -23,15 +22,25 @@
-/*
- * MSDOSFS include files.
- */
+#include <machine/mutex.h>
+
#include <msdosfs/bpb.h>
#include <msdosfs/msdosfsmount.h>
#include <msdosfs/direntry.h>
@@ -117,6 +114,16 @@
return (0);
}
@@ -81,7 +77,5 @@
#define DEHASH(dev, dcl, doff) (dehashtbl[(minor(dev) + (dcl) + (doff) / \
sizeof(struct direntry)) & dehash])
-#ifndef NULL_SIMPLELOCKS
-static struct simplelock dehash_slock;
-#endif
+static struct mtx dehash_mtx;
union _qcvt {
@@ -114,5 +108,16 @@
{
dehashtbl = hashinit(desiredvnodes/2, M_MSDOSFSMNT, &dehash);
- simple_lock_init(&dehash_slock);
+ mtx_init(&dehash_mtx, "msdosfs dehash", MTX_DEF);
+ return (0);
+}
+
+int
+msdosfs_uninit(vfsp)
+ struct vfsconf *vfsp;
@ -39,23 +48,61 @@
+
+ if (dehashtbl)
+ free(dehashtbl, M_MSDOSFSMNT);
+ return (0);
+}
+
static struct denode *
msdosfs_hashget(dev, dirclust, diroff)
dev_t dev;
@@ -135,7 +142,7 @@
&& dev == dep->de_dev
+ mtx_destroy(&dehash_mtx);
return (0);
}
@@ -129,5 +134,5 @@
loop:
- simple_lock(&dehash_slock);
+ mtx_lock(&dehash_mtx);
for (dep = DEHASH(dev, dirclust, diroff); dep; dep = dep->de_next) {
if (dirclust == dep->de_dirclust
@@ -136,6 +141,6 @@
&& dep->de_refcnt != 0) {
vp = DETOV(dep);
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
simple_unlock(&dehash_slock);
- simple_unlock(&dehash_slock);
+ mtx_lock(&vp->v_interlock);
+ mtx_unlock(&dehash_mtx);
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
goto loop;
@@ -259,7 +266,8 @@
return error;
@@ -143,5 +148,5 @@
}
}
- simple_unlock(&dehash_slock);
+ mtx_unlock(&dehash_mtx);
return (NULL);
}
@@ -153,5 +158,5 @@
struct denode **depp, *deq;
- simple_lock(&dehash_slock);
+ mtx_lock(&dehash_mtx);
depp = &DEHASH(dep->de_dev, dep->de_dirclust, dep->de_diroffset);
deq = *depp;
@@ -161,5 +166,5 @@
dep->de_prev = depp;
*depp = dep;
- simple_unlock(&dehash_slock);
+ mtx_unlock(&dehash_mtx);
}
@@ -170,5 +175,5 @@
struct denode *deq;
- simple_lock(&dehash_slock);
+ mtx_lock(&dehash_mtx);
deq = dep->de_next;
if (deq)
@@ -179,5 +184,5 @@
dep->de_prev = NULL;
#endif
- simple_unlock(&dehash_slock);
+ mtx_unlock(&dehash_mtx);
}
@@ -260,5 +265,6 @@
}
bzero((caddr_t)ldep, sizeof *ldep);
- lockinit(&ldep->de_lock, PINOD, "denode", 0, 0);
@ -63,21 +110,23 @@
+ nvp->v_vnlock = &nvp->v_lock;
nvp->v_data = ldep;
ldep->de_vnode = nvp;
ldep->de_flag = 0;
@@ -275,7 +283,7 @@
* of at the start of msdosfs_hashins() so that reinsert() can
@@ -276,5 +282,5 @@
* call msdosfs_hashins() with a locked denode.
*/
- if (lockmgr(&ldep->de_lock, LK_EXCLUSIVE, (struct simplelock *)0, p))
+ if (VOP_LOCK(nvp, LK_EXCLUSIVE, p) != 0)
panic("deget: unexpected lock failure");
/*
@@ -657,6 +665,7 @@
#if 0 /* XXX */
@@ -658,4 +664,5 @@
dep->de_flag = 0;
#endif
+ lockdestroy(&vp->v_lock);
FREE(dep, M_MSDOSFSNODE);
vp->v_data = NULL;
@@ -716,5 +723,5 @@
#endif
if (dep->de_Name[0] == SLOT_DELETED)
- vrecycle(vp, (struct simplelock *)0, p);
+ vrecycle(vp, NULL, p);
return (error);
}

View file

@ -1,7 +1,6 @@
--- msdosfs_vfsops.c.orig Mon Apr 10 04:32:37 2000
+++ msdosfs_vfsops.c Thu Oct 12 00:38:39 2000
@@ -49,10 +49,6 @@
*/
+++ msdosfs_vfsops.c Sun Feb 11 17:01:51 2001
@@ -50,8 +50,4 @@
#include "opt_msdosfs.h"
-
@ -10,9 +9,7 @@
- */
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -61,15 +57,14 @@
#include <sys/kernel.h>
@@ -62,13 +58,11 @@
#include <sys/vnode.h>
#include <sys/mount.h>
+#include <sys/bio.h>
@ -21,70 +18,109 @@
#include <sys/malloc.h>
#include <sys/stat.h> /* defines ALLPERMS */
-#include <vm/vm_zone.h>
+#include <sys/mutex.h>
-/*
- * MSDOSFS include files.
- */
+#include <machine/mutex.h>
+
#include <msdosfs/bpb.h>
#include <msdosfs/bootsect.h>
#include <msdosfs/direntry.h>
@@ -77,6 +72,8 @@
#include <msdosfs/msdosfsmount.h>
@@ -78,4 +72,6 @@
#include <msdosfs/fat.h>
+#define MSDOSFS_DFLTBSIZE 4096
+
#if 1 /*def PC98*/
/*
* XXX - The boot signature formatted by NEC PC-98 DOS looks like a
@@ -635,7 +632,7 @@
if (FAT12(pmp))
@@ -181,6 +177,5 @@
panic("msdosfs_mountroot: can't setup rootvp");
- mp = malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK);
- bzero((char *)mp, (u_long)sizeof(struct mount));
+ mp = malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK | M_ZERO);
mp->mnt_op = &msdosfs_vfsops;
mp->mnt_flag = 0;
@@ -469,6 +464,5 @@
#endif
- pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK);
- bzero((caddr_t)pmp, sizeof *pmp);
+ pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK | M_ZERO);
pmp->pm_mountp = mp;
@@ -636,5 +630,5 @@
pmp->pm_fatblocksize = 3 * pmp->pm_BytesPerSec;
else
- pmp->pm_fatblocksize = DFLTBSIZE;
+ pmp->pm_fatblocksize = MSDOSFS_DFLTBSIZE;
pmp->pm_fatblocksec = pmp->pm_fatblocksize / DEV_BSIZE;
pmp->pm_bnshift = ffs(DEV_BSIZE) - 1;
@@ -729,7 +726,7 @@
mp->mnt_stat.f_fsid.val[0] = dev2udev(dev);
@@ -730,5 +724,5 @@
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
mp->mnt_flag |= MNT_LOCAL;
- devvp->v_specmountpoint = mp;
+ devvp->v_rdev->si_mountpoint = mp;
return 0;
@@ -765,7 +762,7 @@
if (error)
@@ -766,5 +760,5 @@
return error;
pmp = VFSTOMSDOSFS(mp);
- pmp->pm_devvp->v_specmountpoint = NULL;
+ pmp->pm_devvp->v_rdev->si_mountpoint = NULL;
#ifdef MSDOSFS_DEBUG
{
struct vnode *vp = pmp->pm_devvp;
@@ -879,14 +876,14 @@
if (vp->v_mount != mp)
@@ -777,5 +771,5 @@
vp->v_id, vp->v_mount, vp->v_op);
printf("freef %p, freeb %p, mount %p\n",
- vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev,
+ TAILQ_NEXT(vp, v_freelist), vp->v_freelist.tqe_prev,
vp->v_mount);
printf("cleanblkhd %p, dirtyblkhd %p, numoutput %ld, type %d\n",
@@ -870,7 +864,7 @@
* Write back each (modified) denode.
*/
- simple_lock(&mntvnode_slock);
+ mtx_lock(&mntvnode_mtx);
loop:
- for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nvp) {
+ for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL; vp = nvp) {
/*
* If the vnode that we are about to sync is no longer
@@ -880,6 +874,6 @@
goto loop;
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
nvp = vp->v_mntvnodes.le_next;
- nvp = vp->v_mntvnodes.le_next;
+ mtx_lock(&vp->v_interlock);
+ nvp = LIST_NEXT(vp, v_mntvnodes);
dep = VTODE(vp);
if (vp->v_type == VNON ||
((dep->de_flag &
@@ -887,11 +881,11 @@
(DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 &&
(TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY))) {
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
+ mtx_unlock(&vp->v_interlock);
continue;
}
simple_unlock(&mntvnode_slock);
@@ -987,8 +984,8 @@
msdosfs_checkexp,
- simple_unlock(&mntvnode_slock);
+ mtx_unlock(&mntvnode_mtx);
error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p);
if (error) {
- simple_lock(&mntvnode_slock);
+ mtx_lock(&mntvnode_mtx);
if (error == ENOENT)
goto loop;
@@ -903,7 +897,7 @@
VOP_UNLOCK(vp, 0, p);
vrele(vp);
- simple_lock(&mntvnode_slock);
+ mtx_lock(&mntvnode_mtx);
}
- simple_unlock(&mntvnode_slock);
+ mtx_unlock(&mntvnode_mtx);
/*
@@ -988,7 +982,7 @@
msdosfs_vptofh,
msdosfs_init,
- vfs_stduninit,

View file

@ -1,7 +1,6 @@
--- msdosfs_vnops.c.orig Mon Apr 10 04:32:37 2000
+++ msdosfs_vnops.c Sun Oct 22 23:53:01 2000
@@ -50,15 +50,13 @@
+++ msdosfs_vnops.c Sun Feb 11 17:00:36 2001
@@ -51,7 +51,4 @@
#include "opt_msdosfs.h"
-/*
@ -9,16 +8,13 @@
- */
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/namei.h>
#include <sys/resourcevar.h> /* defines plimit structure in proc struct */
@@ -60,4 +57,5 @@
#include <sys/kernel.h>
#include <sys/stat.h>
+#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/mount.h>
@@ -70,12 +68,10 @@
@@ -71,10 +69,8 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
-#include <vm/vm_zone.h>
@ -31,24 +27,20 @@
+
#include <msdosfs/bpb.h>
#include <msdosfs/direntry.h>
#include <msdosfs/denode.h>
@@ -239,12 +235,12 @@
struct denode *dep = VTODE(vp);
@@ -240,10 +236,10 @@
struct timespec ts;
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
+ mtx_lock(&vp->v_interlock);
if (vp->v_usecount > 1) {
getnanotime(&ts);
DETIMES(dep, &ts, &ts, &ts);
}
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
+ mtx_unlock(&vp->v_interlock);
return 0;
}
@@ -260,10 +256,7 @@
struct vnode *vp = ap->a_vp;
@@ -261,8 +257,5 @@
struct denode *dep = VTODE(ap->a_vp);
struct msdosfsmount *pmp = dep->de_pmp;
- struct ucred *cred = ap->a_cred;
@ -58,9 +50,7 @@
+ mode_t file_mode, mode = ap->a_mode;
file_mode = (S_IXUSR|S_IXGRP|S_IXOTH) | (S_IRUSR|S_IRGRP|S_IROTH) |
((dep->de_Attributes & ATTR_READONLY) ? 0 : (S_IWUSR|S_IWGRP|S_IWOTH));
@@ -287,43 +280,8 @@
}
@@ -288,41 +281,6 @@
}
- /* User id 0 always gets access. */
@ -104,9 +94,7 @@
+ ap->a_mode, ap->a_cred, NULL));
}
static int
@@ -914,9 +872,7 @@
}
@@ -915,7 +873,5 @@
/*
- * DOS filesystems don't know what links are. But since we already called
@ -115,9 +103,7 @@
+ * DOS filesystems don't know what links are.
*/
static int
msdosfs_link(ap)
@@ -974,11 +930,6 @@
*
@@ -975,9 +931,4 @@
* On exit:
* all denodes should be released
- *
@ -127,17 +113,13 @@
- * for each rename done.
*/
static int
msdosfs_rename(ap)
@@ -1108,7 +1059,6 @@
VOP_UNLOCK(fvp, 0, p);
@@ -1109,5 +1060,4 @@
if (VTODE(fdvp)->de_StartCluster != VTODE(tdvp)->de_StartCluster)
newparent = 1;
- vrele(fdvp);
if (doingdirectory && newparent) {
if (error) /* write access check above */
goto bad;
@@ -1176,7 +1126,8 @@
panic("msdosfs_rename: lost from startdir");
@@ -1177,5 +1127,6 @@
if (!newparent)
VOP_UNLOCK(tdvp, 0, p);
- (void) relookup(fdvp, &fvp, fcnp);
@ -145,9 +127,7 @@
+ vrele(fdvp);
if (fvp == NULL) {
/*
* From name has disappeared.
@@ -1856,15 +1807,15 @@
error = pcbmap(dep, bp->b_lblkno, &bp->b_blkno, 0, 0);
@@ -1857,6 +1808,6 @@
if (error) {
bp->b_error = error;
- bp->b_flags |= B_ERROR;
@ -156,21 +136,17 @@
+ bufdone(bp);
return (error);
}
if ((long)bp->b_blkno == -1)
vfs_bio_clrbuf(bp);
@@ -1865,5 +1816,5 @@
}
if (bp->b_blkno == -1) {
- biodone(bp);
+ bufdone(bp);
return (0);
}
/*
@@ -1889,7 +1840,7 @@
"tag VT_MSDOSFS, startcluster %lu, dircluster %lu, diroffset %lu ",
@@ -1890,5 +1841,5 @@
dep->de_StartCluster, dep->de_dirclust, dep->de_diroffset);
printf(" dev %d, %d", major(dep->de_dev), minor(dep->de_dev));
- lockmgr_printinfo(&dep->de_lock);
+ lockmgr_printinfo(&ap->a_vp->v_lock);
printf("\n");
return (0);
}