makefs: diff reduction to sys/fs/msdosfs
No functional change.
This commit is contained in:
parent
b257feb247
commit
2037e9880c
@ -135,12 +135,12 @@ struct winentry {
|
||||
#define DD_YEAR_MASK 0xFE00 /* year - 1980 */
|
||||
#define DD_YEAR_SHIFT 9
|
||||
|
||||
uint8_t winChksum(uint8_t *name);
|
||||
int winSlotCnt(const u_char *un, size_t unlen);
|
||||
int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen);
|
||||
int winChkName(const u_char *un, size_t unlen, struct winentry *wep,
|
||||
int chksum);
|
||||
int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt,
|
||||
int chksum);
|
||||
int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen);
|
||||
int unix2winfn(const u_char *un, size_t unlen, struct winentry *wep, int cnt,
|
||||
int chksum);
|
||||
int winChkName(const u_char *un, size_t unlen, struct winentry *wep,
|
||||
int chksum);
|
||||
uint8_t winChksum(uint8_t *name);
|
||||
int winSlotCnt(const u_char *un, size_t unlen);
|
||||
|
||||
#endif /* !_FS_MSDOSFS_DIRENTRY_H_ */
|
||||
|
@ -1,4 +1,6 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
* Copyright (C) 1994, 1995, 1997 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
@ -29,7 +31,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
/*-
|
||||
* Written by Paul Popelka (paulp@uts.amdahl.com)
|
||||
*
|
||||
* You can do anything you want with this software, just don't say you wrote
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* $NetBSD: msdosfs_denode.c,v 1.7 2015/03/29 05:52:59 agc Exp $ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
* Copyright (C) 1994, 1995, 1997 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
@ -31,7 +33,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
/*-
|
||||
* Written by Paul Popelka (paulp@uts.amdahl.com)
|
||||
*
|
||||
* You can do anything you want with this software, just don't say you wrote
|
||||
@ -261,7 +263,7 @@ detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred)
|
||||
if (error) {
|
||||
MSDOSFS_DPRINTF(("detrunc(): pcbmap fails %d\n",
|
||||
error));
|
||||
return error;
|
||||
return (error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,10 +284,9 @@ detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred)
|
||||
MSDOSFS_DPRINTF(("detrunc(): bread fails %d\n",
|
||||
error));
|
||||
|
||||
return error;
|
||||
return (error);
|
||||
}
|
||||
memset((char *)bp->b_data + boff, 0,
|
||||
pmp->pm_bpcluster - boff);
|
||||
memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff);
|
||||
if (flags & IO_SYNC)
|
||||
bwrite(bp);
|
||||
else
|
||||
@ -326,7 +327,7 @@ detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred)
|
||||
if (chaintofree != 0 && !MSDOSFSEOF(pmp, chaintofree))
|
||||
freeclusterchain(pmp, chaintofree);
|
||||
|
||||
return allerror;
|
||||
return (allerror);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -343,16 +344,16 @@ deextend(struct denode *dep, u_long length, struct ucred *cred)
|
||||
* The root of a DOS filesystem cannot be extended.
|
||||
*/
|
||||
if (dep->de_vnode != NULL && !FAT32(pmp))
|
||||
return EINVAL;
|
||||
return (EINVAL);
|
||||
|
||||
/*
|
||||
* Directories cannot be extended.
|
||||
*/
|
||||
if (dep->de_Attributes & ATTR_DIRECTORY)
|
||||
return EISDIR;
|
||||
return (EISDIR);
|
||||
|
||||
if (length <= dep->de_FileSize)
|
||||
return E2BIG;
|
||||
return (E2BIG);
|
||||
|
||||
/*
|
||||
* Compute the number of clusters to allocate.
|
||||
|
@ -870,10 +870,12 @@ freeclusterchain(struct msdosfsmount *pmp, u_long cluster)
|
||||
int
|
||||
fillinusemap(struct msdosfsmount *pmp)
|
||||
{
|
||||
struct buf *bp = NULL;
|
||||
struct buf *bp;
|
||||
u_long bn, bo, bsize, byteoffset, cn, readcn;
|
||||
int error;
|
||||
|
||||
bp = NULL;
|
||||
|
||||
/*
|
||||
* Mark all clusters in use, we mark the free ones in the FAT scan
|
||||
* loop further down.
|
||||
|
@ -276,7 +276,7 @@ uniqdosname(struct denode *dep, struct componentname *cnp, u_char *cp)
|
||||
return error;
|
||||
}
|
||||
for (dentp = (struct direntry *)bp->b_data;
|
||||
(char *)dentp < (char *)bp->b_data + blsize;
|
||||
(char *)dentp < bp->b_data + blsize;
|
||||
dentp++) {
|
||||
if (dentp->deName[0] == SLOT_EMPTY) {
|
||||
/*
|
||||
|
@ -1,4 +1,6 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
* Copyright (C) 1994, 1995, 1997 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
@ -29,7 +31,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
/*-
|
||||
* Written by Paul Popelka (paulp@uts.amdahl.com)
|
||||
*
|
||||
* You can do anything you want with this software, just don't say you wrote
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.19 2017/04/13 17:10:12 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
* Copyright (C) 1994, 1995, 1997 TooLs GmbH.
|
||||
* All rights reserved.
|
||||
@ -31,7 +33,7 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
/*-
|
||||
* Written by Paul Popelka (paulp@uts.amdahl.com)
|
||||
*
|
||||
* You can do anything you want with this software, just don't say you wrote
|
||||
@ -217,7 +219,7 @@ msdosfs_findslot(struct denode *dp, struct componentname *cnp)
|
||||
for (blkoff = 0; blkoff < blsize;
|
||||
blkoff += sizeof(struct direntry),
|
||||
diroff += sizeof(struct direntry)) {
|
||||
dep = (struct direntry *)((char *)bp->b_data + blkoff);
|
||||
dep = (struct direntry *)(bp->b_data + blkoff);
|
||||
/*
|
||||
* If the slot is empty and we are still looking
|
||||
* for an empty then remember this one. If the
|
||||
@ -493,7 +495,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fsnode *node)
|
||||
goto out;
|
||||
}
|
||||
cpsize = MIN((nsize - offs), blsize - on);
|
||||
memcpy((char *)bp->b_data + on, dat + offs, cpsize);
|
||||
memcpy(bp->b_data + on, dat + offs, cpsize);
|
||||
bwrite(bp);
|
||||
offs += cpsize;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _MSDOSFS_MSDOSFSMOUNT_H_
|
||||
#define _MSDOSFS_MSDOSFSMOUNT_H_
|
||||
#define _MSDOSFS_MSDOSFSMOUNT_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user