aboutsummaryrefslogtreecommitdiff
path: root/sys/pcfs
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
committersvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /sys/pcfs
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
This commit was manufactured to restore the state of the 1.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'sys/pcfs')
-rw-r--r--sys/pcfs/bootsect.h6
-rw-r--r--sys/pcfs/bpb.h6
-rw-r--r--sys/pcfs/denode.h41
-rw-r--r--sys/pcfs/direntry.h6
-rw-r--r--sys/pcfs/fat.h6
-rw-r--r--sys/pcfs/pcfs_conv.c5
-rw-r--r--sys/pcfs/pcfs_denode.c18
-rw-r--r--sys/pcfs/pcfs_fat.c8
-rw-r--r--sys/pcfs/pcfs_lookup.c15
-rw-r--r--sys/pcfs/pcfs_vfsops.c10
-rw-r--r--sys/pcfs/pcfs_vnops.c14
-rw-r--r--sys/pcfs/pcfsmount.h8
12 files changed, 101 insertions, 42 deletions
diff --git a/sys/pcfs/bootsect.h b/sys/pcfs/bootsect.h
index 8465767bf815..ff4e029da9c3 100644
--- a/sys/pcfs/bootsect.h
+++ b/sys/pcfs/bootsect.h
@@ -15,9 +15,12 @@
*
* October 1992
*
- * $Id: bootsect.h,v 1.2 1993/10/16 19:29:24 rgrimes Exp $
+ * $Id: bootsect.h,v 1.3 1993/11/07 17:51:10 wollman Exp $
*/
+#ifndef _PCFS_BOOTSECT_H_
+#define _PCFS_BOOTSECT_H_ 1
+
/*
* Format of a boot sector. This is the first sector
* on a DOS floppy disk or the fist sector of a partition
@@ -70,3 +73,4 @@ union bootsector {
#define bsHeads bsBPB.bpbHeads
#define bsHiddenSecs bsBPB.bpbHiddenSecs
#define bsHugeSectors bsBPB.bpbHugeSectors
+#endif /* _PCFS_BOOTSECT_H_ */
diff --git a/sys/pcfs/bpb.h b/sys/pcfs/bpb.h
index 41d798a73b89..a3e719ccc173 100644
--- a/sys/pcfs/bpb.h
+++ b/sys/pcfs/bpb.h
@@ -15,9 +15,12 @@
*
* October 1992
*
- * $Id: bpb.h,v 1.2 1993/10/16 19:29:25 rgrimes Exp $
+ * $Id: bpb.h,v 1.3 1993/11/07 17:51:11 wollman Exp $
*/
+#ifndef _PCFS_BPB_H_
+#define _PCFS_BPB_H_ 1
+
/*
* BIOS Parameter Block (BPB) for DOS 3.3
*/
@@ -108,3 +111,4 @@ struct byte_bpb50 {
char bpbHiddenSecs[4]; /* number of hidden sectors */
char bpbHugeSectors[4]; /* number of sectrs if bpbSectors == 0 */
};
+#endif /* _PCFS_BPB_H_ */
diff --git a/sys/pcfs/denode.h b/sys/pcfs/denode.h
index ddd964ecbeee..c2f2c1e023cc 100644
--- a/sys/pcfs/denode.h
+++ b/sys/pcfs/denode.h
@@ -15,9 +15,12 @@
*
* October 1992
*
- * $Id: denode.h,v 1.2 1993/10/16 19:29:26 rgrimes Exp $
+ * $Id: denode.h,v 1.6 1993/12/19 00:54:25 wollman Exp $
*/
+#ifndef _PCFS_DENODE_H_
+#define _PCFS_DENODE_H_ 1
+
/*
* This is the pc filesystem specific portion of the
* vnode structure.
@@ -158,7 +161,9 @@ struct denode {
#define DETOV(de) ((de)->de_vnode)
#define DELOCK(de) delock(de)
+extern void delock(struct denode *);
#define DEUNLOCK(de) deunlock(de)
+extern void deunlock(struct denode *);
#define DEUPDAT(dep, t, waitfor) \
if (dep->de_flag & DEUPD) \
@@ -182,7 +187,7 @@ struct defid {
u_long defid_dirclust; /* cluster this dir entry came from */
u_long defid_dirofs; /* index of entry within the cluster */
-/* u_long defid_gen; /* generation number */
+/* u_long defid_gen;*/ /* generation number */
};
/*
@@ -235,7 +240,7 @@ int pcfs_unlock __P((struct vnode *vp));
int pcfs_bmap __P((struct vnode *vp, daddr_t bn, struct vnode **vpp,
daddr_t *bnp));
int pcfs_strategy __P((struct buf *bp));
-int pcfs_print __P((struct vnode *vp));
+void pcfs_print __P((struct vnode *vp));
int pcfs_islocked __P((struct vnode *vp));
int pcfs_advlock __P((struct vnode *vp, caddr_t id, int op, struct flock *fl,
int flags));
@@ -245,4 +250,34 @@ int pcfs_advlock __P((struct vnode *vp, caddr_t id, int op, struct flock *fl,
*/
int deget __P((struct pcfsmount *pmp, u_long dirclust, u_long diroffset,
struct direntry *direntptr, struct denode **depp));
+
+extern int pcbmap(struct denode *, u_long, daddr_t *, u_long *);
+extern void fc_purge(struct denode *, u_int);
+extern void updateotherfats(struct pcfsmount *, struct buf *, u_long);
+extern int clusterfree(struct pcfsmount *, u_long, u_long *);
+extern int fatentry(int, struct pcfsmount *, u_long, u_long *, u_long);
+extern int clusteralloc(struct pcfsmount *, u_long *, u_long);
+extern int freeclusterchain(struct pcfsmount *, u_long);
+extern int fillinusemap(struct pcfsmount *);
+extern int extendfile(struct denode *, struct buf **, u_int *);
+extern int readep(struct pcfsmount *, u_long, u_long, struct buf **,
+ struct direntry **);
+extern int readde(struct denode *, struct buf **, struct direntry **);
+extern int doscheckpath(struct denode *, struct denode *);
+extern int dosdirempty(struct denode *);
+extern int removede(struct nameidata *);
+extern int markdeleted(struct pcfsmount *, u_long, u_long);
+extern int createde(struct denode *, struct nameidata *, struct denode **);
+extern int pcfs_lookup(struct vnode *, struct nameidata *, struct proc *);
+
+extern void pcfs_init(void);
+extern void deput(struct denode *);
+extern int deupdat(struct denode *, struct timeval *, int);
+extern int detrunc(struct denode *, u_long, int);
+extern void reinsert(struct denode *);
+extern int pcfs_reclaim(struct vnode *);
+extern int pcfs_inactive(struct vnode *, struct proc *);
+
+
#endif /* defined(KERNEL) */
+#endif /* _PCFS_DENODE_H_ */
diff --git a/sys/pcfs/direntry.h b/sys/pcfs/direntry.h
index 28ec7c60fe4c..588525e8170d 100644
--- a/sys/pcfs/direntry.h
+++ b/sys/pcfs/direntry.h
@@ -15,9 +15,12 @@
*
* October 1992
*
- * $Id: direntry.h,v 1.2 1993/10/16 19:29:28 rgrimes Exp $
+ * $Id: direntry.h,v 1.3 1993/11/07 17:51:14 wollman Exp $
*/
+#ifndef _PCFS_DIRENTRY_H_
+#define _PCFS_DIRENTRY_H_ 1
+
/*
* Structure of a dos directory entry.
*/
@@ -94,3 +97,4 @@ void dos2unixtime __P((union dosdate *ddp,
int dos2unixfn __P((u_char dn[11], u_char *un));
void unix2dosfn __P((u_char *un, u_char dn[11], int unlen));
#endif /* defined(KERNEL) */
+#endif /* _PCFS_DIRENTRY_H_ */
diff --git a/sys/pcfs/fat.h b/sys/pcfs/fat.h
index 1b3404165711..0790d1e8153c 100644
--- a/sys/pcfs/fat.h
+++ b/sys/pcfs/fat.h
@@ -15,9 +15,12 @@
*
* October 1992
*
- * $Id: fat.h,v 1.2 1993/10/16 19:29:29 rgrimes Exp $
+ * $Id: fat.h,v 1.3 1993/11/07 17:51:15 wollman Exp $
*/
+#ifndef _PCFS_FAT_H_
+#define _PCFS_FAT_H_ 1
+
/*
* Some useful cluster numbers.
*/
@@ -65,3 +68,4 @@ int fatentry __P((int function, struct pcfsmount *pmp,
u_long cluster, u_long *oldcontents, u_long newcontents));
int freeclusterchain __P((struct pcfsmount *pmp, u_long startchain));
#endif /* defined(KERNEL) */
+#endif /* _PCFS_FAT_H_ */
diff --git a/sys/pcfs/pcfs_conv.c b/sys/pcfs/pcfs_conv.c
index 3f3fc07656a7..66fbba06216f 100644
--- a/sys/pcfs/pcfs_conv.c
+++ b/sys/pcfs/pcfs_conv.c
@@ -15,13 +15,14 @@
*
* October 1992
*
- * $Id: pcfs_conv.c,v 1.2 1993/10/16 19:29:31 rgrimes Exp $
+ * $Id: pcfs_conv.c,v 1.4 1993/12/19 00:54:27 wollman Exp $
*/
/*
* System include files.
*/
#include "param.h"
+#include "systm.h"
#include "time.h"
#include "kernel.h" /* defines tz */
@@ -283,7 +284,7 @@ unix2dosfn(un, dn, unlen)
int unlen;
{
int i;
- u_char c;
+ u_char c = 0;
/*
* Fill the dos filename string with blanks.
diff --git a/sys/pcfs/pcfs_denode.c b/sys/pcfs/pcfs_denode.c
index 888f0185bd3a..e73ce89ee403 100644
--- a/sys/pcfs/pcfs_denode.c
+++ b/sys/pcfs/pcfs_denode.c
@@ -15,7 +15,7 @@
*
* October 1992
*
- * $Id: pcfs_denode.c,v 1.2 1993/10/16 19:29:32 rgrimes Exp $
+ * $Id: pcfs_denode.c,v 1.5 1993/12/19 00:54:30 wollman Exp $
*/
#include "param.h"
@@ -44,7 +44,8 @@ union dehead {
struct denode *deh_chain[2];
} dehead[DEHSZ];
-pcfs_init()
+void
+pcfs_init(void)
{
int i;
union dehead *deh;
@@ -131,7 +132,7 @@ loop:
/* should we brelse() the passed buf hdr to
* avoid some potential deadlock? */
ldep->de_flag |= DEWANT;
- sleep((caddr_t)ldep, PINOD);
+ tsleep((caddr_t)ldep, PINOD, "deget", 0);
goto loop;
}
if (vget(DETOV(ldep)))
@@ -468,6 +469,7 @@ printf("detrunc(): fatentry errors %d\n", error);
* the file it represents has been moved to a new
* directory.
*/
+void
reinsert(dep)
struct denode *dep;
{
@@ -586,7 +588,7 @@ printf("pcfs_inactive(): v_usecount %d, de_Name[0] %x\n", vp->v_usecount,
return error;
}
-int
+void
delock(dep)
struct denode *dep;
{
@@ -595,16 +597,14 @@ delock(dep)
if (dep->de_spare0 == curproc->p_pid)
panic("delock: locking against myself");
dep->de_spare1 = curproc->p_pid;
- (void) sleep((caddr_t)dep, PINOD);
+ (void) tsleep((caddr_t)dep, PINOD, "delock", 0);
}
dep->de_spare1 = 0;
dep->de_spare0 = curproc->p_pid;
dep->de_flag |= DELOCKED;
-
- return 0;
}
-int
+void
deunlock(dep)
struct denode *dep;
{
@@ -616,6 +616,4 @@ deunlock(dep)
dep->de_flag &= ~DEWANT;
wakeup((caddr_t)dep);
}
-
- return 0;
}
diff --git a/sys/pcfs/pcfs_fat.c b/sys/pcfs/pcfs_fat.c
index 71771a6490a8..3e66739e2618 100644
--- a/sys/pcfs/pcfs_fat.c
+++ b/sys/pcfs/pcfs_fat.c
@@ -15,7 +15,7 @@
*
* October 1992
*
- * $Id: pcfs_fat.c,v 1.2 1993/10/16 19:29:34 rgrimes Exp $
+ * $Id: pcfs_fat.c,v 1.3 1993/11/25 01:37:11 wollman Exp $
*/
/*
@@ -39,6 +39,8 @@
#include "denode.h"
#include "fat.h"
+static void fc_lookup(struct denode *, u_long, u_long *, u_long *);
+
/*
* Fat cache stats.
*/
@@ -106,7 +108,7 @@ pcbmap(dep, findcn, bnp, cnp)
int error;
u_long i;
u_long cn;
- u_long prevcn;
+ u_long prevcn = 0;
u_long byteoffset;
u_long bn;
u_long bo;
@@ -224,6 +226,7 @@ hiteof:;
* Find the closest entry in the fat cache to the
* cluster we are looking for.
*/
+static void
fc_lookup(dep, findcn, frcnp, fsrcnp)
struct denode *dep;
u_long findcn;
@@ -251,6 +254,7 @@ fc_lookup(dep, findcn, frcnp, fsrcnp)
* Purge the fat cache in denode dep of all entries
* relating to file relative cluster frcn and beyond.
*/
+void
fc_purge(dep, frcn)
struct denode *dep;
u_int frcn;
diff --git a/sys/pcfs/pcfs_lookup.c b/sys/pcfs/pcfs_lookup.c
index 03b4fb7fb038..86d92637a03e 100644
--- a/sys/pcfs/pcfs_lookup.c
+++ b/sys/pcfs/pcfs_lookup.c
@@ -15,7 +15,7 @@
*
* October 1992
*
- * $Id: pcfs_lookup.c,v 1.4 1993/10/17 01:48:37 rgrimes Exp $
+ * $Id: pcfs_lookup.c,v 1.7 1993/12/19 00:54:31 wollman Exp $
*/
#include "param.h"
@@ -63,8 +63,8 @@ pcfs_lookup(vdp, ndp, p)
int slotstatus;
#define NONE 0
#define FOUND 1
- int slotoffset;
- int slotcluster;
+ int slotoffset = 0;
+ int slotcluster = 0;
int frcn;
u_long cluster;
int rootreloff;
@@ -76,7 +76,7 @@ pcfs_lookup(vdp, ndp, p)
struct denode *tdp;
struct pcfsmount *pmp;
struct buf *bp = 0;
- struct direntry *dep;
+ struct direntry *dep = 0;
u_char dosfilename[12];
#if defined(PCFSDEBUG)
@@ -165,7 +165,7 @@ printf("pcfs_lookup(): cache hit, vnode %08x, file %s\n", vdp, dp->de_Name);
#if defined(PCFSDEBUG)
printf("pcfs_lookup(): looking for . or .. in root directory\n");
#endif /* defined(PCFSDEBUG) */
- cluster == PCFSROOT;
+ cluster = PCFSROOT;
diroff = PCFSROOT_OFS;
goto foundroot;
}
@@ -296,7 +296,7 @@ printf("pcfs_lookup(): saving empty slot location\n");
ndp->ni_pcfs.pcfs_cluster = slotcluster;
ndp->ni_pcfs.pcfs_count = 1;
}
-/* dp->de_flag |= DEUPD; /* never update dos directories */
+/* dp->de_flag |= DEUPD;*/ /* never update dos directories */
ndp->ni_nameiop |= SAVENAME;
if (!lockparent) /* leave searched dir locked? */
DEUNLOCK(dp);
@@ -427,7 +427,8 @@ createde(dep, ndp, depp)
{
int bn;
int error;
- u_long dirclust, diroffset;
+ u_int dirclust;
+ u_long diroffset;
struct direntry *ndep;
struct denode *ddep = VTODE(ndp->ni_dvp); /* directory to add to */
struct pcfsmount *pmp = dep->de_pmp;
diff --git a/sys/pcfs/pcfs_vfsops.c b/sys/pcfs/pcfs_vfsops.c
index 0cb1ad2e7a00..2fac8237dfe3 100644
--- a/sys/pcfs/pcfs_vfsops.c
+++ b/sys/pcfs/pcfs_vfsops.c
@@ -15,7 +15,7 @@
*
* October 1992
*
- * $Id: pcfs_vfsops.c,v 1.3 1993/10/16 19:29:37 rgrimes Exp $
+ * $Id: pcfs_vfsops.c,v 1.5 1993/12/19 02:07:58 ache Exp $
*/
#include "param.h"
@@ -57,7 +57,7 @@ pcfs_mount(mp, path, data, ndp, p)
{
struct vnode *devvp; /* vnode for blk device to mount */
struct pcfs_args args; /* will hold data from mount request */
- struct pcfsmount *pmp; /* pcfs specific mount control block */
+ struct pcfsmount *pmp = 0; /* pcfs specific mount control block */
int error;
u_int size;
@@ -296,9 +296,10 @@ mountpcfs(devvp, mp, p)
pmp->pm_fatblocksize = MAXBSIZE;
pmp->pm_fatblocksec = pmp->pm_fatblocksize / pmp->pm_BytesPerSec;
+#if defined(PCFSDEBUG)
if ((pmp->pm_rootdirsize % pmp->pm_SectPerClust) != 0)
printf("mountpcfs(): root directory is not a multiple of the clustersize in length\n");
-
+#endif
/*
* Compute mask and shift value for isolating cluster relative
* byte offsets and cluster numbers from a file offset.
@@ -488,10 +489,7 @@ pcfs_quotactl(mp, cmds, uid, arg, p)
caddr_t arg;
struct proc *p;
{
-#if defined(QUOTA)
-#else
return EOPNOTSUPP;
-#endif /* defined(QUOTA) */
}
int
diff --git a/sys/pcfs/pcfs_vnops.c b/sys/pcfs/pcfs_vnops.c
index 4cbd3ab1e7f7..b3975f6face3 100644
--- a/sys/pcfs/pcfs_vnops.c
+++ b/sys/pcfs/pcfs_vnops.c
@@ -15,7 +15,7 @@
*
* October 1992
*
- * $Id: pcfs_vnops.c,v 1.2 1993/10/16 19:29:39 rgrimes Exp $
+ * $Id: pcfs_vnops.c,v 1.4 1993/12/19 00:54:32 wollman Exp $
*/
#include "param.h"
@@ -314,7 +314,7 @@ printf(" va_uid %x, va_gid %x, va_atime.tv_sec %x\n",
if (cred->cr_uid == 0)
dep->de_flag = vap->va_flags;
else {
- dep->de_flag &= 0xffff0000;
+ dep->de_flag &= 0xffff0000UL;
dep->de_flag |= (vap->va_flags & 0xffff);
}
dep->de_flag |= DEUPD;
@@ -585,6 +585,7 @@ pcfs_ioctl(vp, com, data, fflag, cred, p)
struct vnode *vp;
int com;
caddr_t data;
+ int fflag;
struct ucred *cred;
struct proc *p;
{
@@ -718,7 +719,8 @@ printf("seek: newoff %d > foff %d\n", newoff, foff);
dep->de_FileSize += pmp->pm_bpcluster;
} /* end while() */
dep->de_FileSize = newoff;
- return deupdat(dep, &time);
+ return deupdat(dep, &time,
+ pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS);
}
return 0;
}
@@ -894,7 +896,7 @@ printf("pcfs_rename(fndp %08x, tndp %08x, p %08x\n", fndp, tndp, p);
tdep = NULL;
}
/* doscheckpath() deput()'s tddep */
- error = doscheckpath(fdep, tddep, tndp->ni_cred);
+ error = doscheckpath(fdep, tddep);
tddep = NULL;
if (error) {
goto bad;
@@ -970,7 +972,7 @@ printf("pcfs_rename(fndp %08x, tndp %08x, p %08x\n", fndp, tndp, p);
* tdep is unlocked and unreferenced
*/
} else {
- u_long dirsize;
+ u_long dirsize = 0;
/*
* If the source and destination are in different
* directories, then mark the entry in the source
@@ -1591,7 +1593,7 @@ pcfs_strategy(bp)
return 0;
}
-int
+void
pcfs_print(vp)
struct vnode *vp;
{
diff --git a/sys/pcfs/pcfsmount.h b/sys/pcfs/pcfsmount.h
index 29cd92319798..857ef30b806e 100644
--- a/sys/pcfs/pcfsmount.h
+++ b/sys/pcfs/pcfsmount.h
@@ -15,9 +15,12 @@
*
* October 1992
*
- * $Id: pcfsmount.h,v 1.2 1993/10/16 19:29:41 rgrimes Exp $
+ * $Id: pcfsmount.h,v 1.4 1993/11/25 01:37:17 wollman Exp $
*/
+#ifndef _PCFS_PCFSMOUNT_H_
+#define _PCFS_PCFSMOUNT_H_ 1
+
/*
* Layout of the mount control block for a msdos
* file system.
@@ -139,4 +142,5 @@ int pcfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
int pcfs_sync __P((struct mount *mp, int waitfor));
int pcfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp));
int pcfs_vptofh __P((struct vnode *vp, struct fid *fhp));
-int pcfs_init __P(());
+void pcfs_init __P((void));
+#endif /* _PCFS_PCFSMOUNT_H_ */