bzero->memset, bcopy->memcpy, bcmp->memcmp

This commit is contained in:
perry 1998-08-09 20:15:38 +00:00
parent 8cbcfa0df2
commit 27ca6798df
20 changed files with 106 additions and 106 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: adlookup.c,v 1.21 1998/07/10 20:14:59 mhitch Exp $ */
/* $NetBSD: adlookup.c,v 1.22 1998/08/09 20:20:11 perry Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -41,7 +41,7 @@
#ifdef ADOSFS_EXACTMATCH
#define strmatch(s1, l1, s2, l2, i) \
((l1) == (l2) && bcmp((s1), (s2), (l1)) == 0)
((l1) == (l2) && memcmp((s1), (s2), (l1)) == 0)
#else
#define strmatch(s1, l1, s2, l2, i) \
((l1) == (l2) && adoscaseequ((s1), (s2), (l1), (i)))

View File

@ -1,4 +1,4 @@
/* $NetBSD: advfsops.c,v 1.29 1998/07/05 08:49:44 jonathan Exp $ */
/* $NetBSD: advfsops.c,v 1.30 1998/08/09 20:20:11 perry Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -149,10 +149,10 @@ adosfs_mount(mp, path, data, ndp, p)
amp->gid = args.gid;
amp->mask = args.mask;
(void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname + size, 0, MNAMELEN - size);
return (0);
}
@ -196,7 +196,7 @@ adosfs_mountfs(devvp, mp, p)
parp = &dl.d_partitions[part];
amp = malloc(sizeof(struct adosfsmount), M_ADOSFSMNT, M_WAITOK);
bzero((char *)amp, (u_long)sizeof(struct adosfsmount));
memset((char *)amp, 0, (u_long)sizeof(struct adosfsmount));
amp->mp = mp;
if (dl.d_type == DTYPE_FLOPPY) {
amp->bsize = dl.d_secsize;
@ -341,8 +341,8 @@ adosfs_statfs(mp, sbp, p)
sbp->f_files = 0; /* who knows */
sbp->f_ffree = 0; /* " " */
if (sbp != &mp->mnt_stat) {
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
memcpy(sbp->f_mntonname, mp->mnt_stat.f_mntonname, MNAMELEN);
memcpy(sbp->f_mntfromname, mp->mnt_stat.f_mntfromname, MNAMELEN);
}
strncpy(sbp->f_fstypename, mp->mnt_op->vfs_name, MFSNAMELEN);
return (0);
@ -383,7 +383,7 @@ adosfs_vget(mp, an, vpp)
* setup, insert in hash, and lock before io.
*/
vp->v_data = ap = malloc(sizeof(struct anode), M_ANODE, M_WAITOK);
bzero(ap, sizeof(struct anode));
memset(ap, 0, sizeof(struct anode));
ap->vp = vp;
ap->amp = amp;
ap->block = an;
@ -432,15 +432,15 @@ adosfs_vget(mp, an, vpp)
tmp++;
if (*tmp == 0) {
ap->slinkto = malloc(namlen + 1, M_ANODE, M_WAITOK);
bcopy(nam, ap->slinkto, namlen);
memcpy(ap->slinkto, nam, namlen);
} else if (*nam == ':') {
ap->slinkto = malloc(namlen + 1, M_ANODE, M_WAITOK);
bcopy(nam, ap->slinkto, namlen);
memcpy(ap->slinkto, nam, namlen);
ap->slinkto[0] = '/';
} else {
ap->slinkto = malloc(namlen + 2, M_ANODE, M_WAITOK);
ap->slinkto[0] = '/';
bcopy(nam, &ap->slinkto[1], namlen);
memcpy(&ap->slinkto[1], nam, namlen);
ap->slinkto[tmp - nam + 1] = '/';
namlen++;
}
@ -471,7 +471,7 @@ adosfs_vget(mp, an, vpp)
vput(vp);
return (EINVAL);
}
bcopy(nam, ap->name, namlen);
memcpy(ap->name, nam, namlen);
ap->name[namlen] = 0;
/*
@ -483,7 +483,7 @@ adosfs_vget(mp, an, vpp)
ap->tab = malloc(ANODETABSZ(ap) * 2, M_ANODE, M_WAITOK);
ap->ntabent = ANODETABENT(ap);
ap->tabi = (int *)&ap->tab[ap->ntabent];
bzero(ap->tabi, ANODETABSZ(ap));
memset(ap->tabi, 0, ANODETABSZ(ap));
for (i = 0; i < ap->ntabent; i++)
ap->tab[i] = adoswordn(bp, i + 6);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: advnops.c,v 1.41 1998/08/03 14:19:57 kleink Exp $ */
/* $NetBSD: advnops.c,v 1.42 1998/08/09 20:20:12 perry Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -762,7 +762,7 @@ adosfs_readdir(v)
/*
* Fill in dirent record
*/
bzero(adp, sizeof(struct adirent));
memset(adp, 0, sizeof(struct adirent));
adp->fileno = ap->block;
/*
* this deserves an function in kern/vfs_subr.c
@ -783,7 +783,7 @@ adosfs_readdir(v)
}
adp->reclen = sizeof(struct adirent);
adp->namlen = strlen(ap->name);
bcopy(ap->name, adp->name, adp->namlen);
memcpy(adp->name, ap->name, adp->namlen);
vput(vp);
error = uiomove((caddr_t) adp, sizeof(struct adirent), uio);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs.h,v 1.3 1998/03/01 02:23:45 fvdl Exp $ */
/* $NetBSD: ext2fs.h,v 1.4 1998/08/09 20:15:38 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -190,10 +190,10 @@ struct ext2_gd {
# define h2fs32(x) (x)
# define fs2h16(x) (x)
# define fs2h32(x) (x)
# define e2fs_sbload(old, new) bcopy((old), (new), SBSIZE);
# define e2fs_cgload(old, new, size) bcopy((old), (new), (size));
# define e2fs_sbsave(old, new) bcopy((old), (new), SBSIZE);
# define e2fs_cgsave(old, new, size) bcopy((old), (new), (size));
# define e2fs_sbload(old, new) memcpy((new), (old), SBSIZE);
# define e2fs_cgload(old, new, size) memcpy((new), (old), (size));
# define e2fs_sbsave(old, new) memcpy((new), (old), SBSIZE);
# define e2fs_cgsave(old, new, size) memcpy((new), (old), (size));
#else
void e2fs_sb_bswap __P((struct ext2fs *, struct ext2fs *));
void e2fs_cg_bswap __P((struct ext2_gd *, struct ext2_gd *, int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_alloc.c,v 1.3 1998/03/01 02:23:45 fvdl Exp $ */
/* $NetBSD: ext2fs_alloc.c,v 1.4 1998/08/09 20:15:38 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -183,7 +183,7 @@ ext2fs_valloc(v)
panic("ext2fs_valloc: dup alloc");
}
bzero(&(ip->i_din.e2fs_din), sizeof(struct ext2fs_dinode));
memset(&(ip->i_din.e2fs_din), 0, sizeof(struct ext2fs_dinode));
/*
* Set up a new generation number for this inode.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_bswap.c,v 1.1 1997/10/09 15:42:49 bouyer Exp $ */
/* $NetBSD: ext2fs_bswap.c,v 1.2 1998/08/09 20:15:38 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -105,7 +105,7 @@ void e2fs_i_bswap(old, new)
new->e2di_facl = bswap32(old->e2di_facl);
new->e2di_dacl = bswap32(old->e2di_dacl);
new->e2di_faddr = bswap32(old->e2di_faddr);
bcopy(&old->e2di_blocks[0], &new->e2di_blocks[0],
memcpy(&new->e2di_blocks[0], &old->e2di_blocks[0],
(NDADDR+NIADDR) * sizeof(int));
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_dinode.h,v 1.2 1997/10/09 15:42:49 bouyer Exp $ */
/* $NetBSD: ext2fs_dinode.h,v 1.3 1998/08/09 20:15:38 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -133,8 +133,8 @@ struct ext2fs_dinode {
/* e2fs needs byte swapping on big-endian systems */
#if BYTE_ORDER == LITTLE_ENDIAN
# define e2fs_iload(old, new) bcopy((old),(new),sizeof(struct ext2fs_dinode))
# define e2fs_isave(old, new) bcopy((old),(new),sizeof(struct ext2fs_dinode))
# define e2fs_iload(old, new) memcpy((new),(old),sizeof(struct ext2fs_dinode))
# define e2fs_isave(old, new) memcpy((new),(old),sizeof(struct ext2fs_dinode))
#else
void e2fs_i_bswap __P((struct ext2fs_dinode *, struct ext2fs_dinode *));
# define e2fs_iload(old, new) e2fs_i_bswap((old), (new))

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_inode.c,v 1.7 1998/06/09 06:33:22 mikel Exp $ */
/* $NetBSD: ext2fs_inode.c,v 1.8 1998/08/09 20:15:38 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -212,7 +212,7 @@ ext2fs_truncate(v)
if (length != 0)
panic("ext2fs_truncate: partial truncate of symlink");
#endif
bzero((char *)&oip->i_din.e2fs_din.e2di_shortlink,
memset((char *)&oip->i_din.e2fs_din.e2di_shortlink, 0,
(u_int)oip->i_e2fs_size);
oip->i_e2fs_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
@ -283,7 +283,7 @@ ext2fs_truncate(v)
#else
(void) vnode_pager_uncache(ovp);
#endif
bzero((char *)bp->b_data + offset, (u_int)(size - offset));
memset((char *)bp->b_data + offset, 0, (u_int)(size - offset));
allocbuf(bp, size);
if (aflags & B_SYNC)
bwrite(bp);
@ -312,7 +312,7 @@ ext2fs_truncate(v)
* will be returned to the free list. lastiblock values are also
* normalized to -1 for calls to ext2fs_indirtrunc below.
*/
bcopy((caddr_t)&oip->i_e2fs_blocks[0], (caddr_t)oldblks, sizeof oldblks);
memcpy((caddr_t)oldblks, (caddr_t)&oip->i_e2fs_blocks[0], sizeof oldblks);
for (level = TRIPLE; level >= SINGLE; level--)
if (lastiblock[level] < 0) {
oip->i_e2fs_blocks[NDADDR + level] = 0;
@ -329,8 +329,8 @@ ext2fs_truncate(v)
* Note that we save the new block configuration so we can check it
* when we are done.
*/
bcopy((caddr_t)&oip->i_e2fs_blocks[0], (caddr_t)newblks, sizeof newblks);
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_e2fs_blocks[0], sizeof oldblks);
memcpy((caddr_t)newblks, (caddr_t)&oip->i_e2fs_blocks[0], sizeof newblks);
memcpy((caddr_t)&oip->i_e2fs_blocks[0], (caddr_t)oldblks, sizeof oldblks);
oip->i_e2fs_size = osize;
vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA;
allerror = vinvalbuf(ovp, vflags, ap->a_cred, ap->a_p, 0, 0);
@ -468,8 +468,8 @@ ext2fs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
bap = (ufs_daddr_t *)bp->b_data;
if (lastbn != -1) {
MALLOC(copy, ufs_daddr_t *, fs->e2fs_bsize, M_TEMP, M_WAITOK);
bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->e2fs_bsize);
bzero((caddr_t)&bap[last + 1],
memcpy((caddr_t)copy, (caddr_t)bap, (u_int)fs->e2fs_bsize);
memset((caddr_t)&bap[last + 1], 0,
(u_int)(NINDIR(fs) - (last + 1)) * sizeof (u_int32_t));
error = bwrite(bp);
if (error)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_lookup.c,v 1.6 1998/07/28 20:39:10 mjacob Exp $ */
/* $NetBSD: ext2fs_lookup.c,v 1.7 1998/08/09 20:15:38 perry Exp $ */
/*
* Modified for NetBSD 1.2E
@ -93,7 +93,7 @@ ext2fs_dirconv2ffs( e2dir, ffsdir)
struct ext2fs_direct *e2dir;
struct dirent *ffsdir;
{
bzero(ffsdir, sizeof(struct dirent));
memset(ffsdir, 0, sizeof(struct dirent));
ffsdir->d_fileno = fs2h32(e2dir->e2d_ino);
ffsdir->d_namlen = fs2h16(e2dir->e2d_namlen);
@ -176,7 +176,7 @@ ext2fs_readdir(v)
M_WAITOK);
*ap->a_cookies = cookies;
}
bzero(dirbuf, e2fs_count);
memset(dirbuf, 0, e2fs_count);
aiov.iov_base = dirbuf;
error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred);
@ -478,7 +478,7 @@ searchloop:
if (ep->e2d_ino) {
namlen = fs2h16(ep->e2d_namlen);
if (namlen == cnp->cn_namelen &&
!bcmp(cnp->cn_nameptr, ep->e2d_name,
!memcmp(cnp->cn_nameptr, ep->e2d_name,
(unsigned)namlen)) {
/*
* Save directory entry's inode number and
@ -792,7 +792,7 @@ ext2fs_direnter(ip, dvp, cnp)
dp = VTOI(dvp);
newdir.e2d_ino = h2fs32(ip->i_number);
newdir.e2d_namlen = h2fs16(cnp->cn_namelen);
bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1);
memcpy(newdir.e2d_name, cnp->cn_nameptr, (unsigned)cnp->cn_namelen + 1);
newentrysize = EXT2FS_DIRSIZ(cnp->cn_namelen);
if (dp->i_count == 0) {
/*
@ -862,7 +862,7 @@ ext2fs_direnter(ip, dvp, cnp)
dsize = EXT2FS_DIRSIZ(fs2h16(nep->e2d_namlen));
spacefree += fs2h16(nep->e2d_reclen) - dsize;
loc += fs2h16(nep->e2d_reclen);
bcopy((caddr_t)nep, (caddr_t)ep, dsize);
memcpy((caddr_t)ep, (caddr_t)nep, dsize);
}
/*
* Update the pointer fields in the previous entry (if any),
@ -886,7 +886,7 @@ ext2fs_direnter(ip, dvp, cnp)
ep->e2d_reclen = h2fs16(dsize);
ep = (struct ext2fs_direct *)((char *)ep + dsize);
}
bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize);
memcpy((caddr_t)ep, (caddr_t)&newdir, (u_int)newentrysize);
error = VOP_BWRITE(bp);
dp->i_flag |= IN_CHANGE | IN_UPDATE;
if (!error && dp->i_endoff && dp->i_endoff < dp->i_e2fs_size)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_vfsops.c,v 1.15 1998/07/05 08:49:48 jonathan Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.16 1998/08/09 20:15:39 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -206,7 +206,7 @@ ext2fs_mountroot()
simple_unlock(&mountlist_slock);
ump = VFSTOUFS(mp);
fs = ump->um_e2fs;
bzero(fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt));
memset(fs->e2fs_fsmnt, 0, sizeof(fs->e2fs_fsmnt));
(void) copystr(mp->mnt_stat.f_mntonname, fs->e2fs_fsmnt,
MNAMELEN - 1, 0);
(void)ext2fs_statfs(mp, &mp->mnt_stat, p);
@ -342,11 +342,11 @@ ext2fs_mount(mp, path, data, ndp, p)
ump = VFSTOUFS(mp);
fs = ump->um_e2fs;
(void) copyinstr(path, fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt) - 1, &size);
bzero(fs->e2fs_fsmnt + size, sizeof(fs->e2fs_fsmnt) - size);
bcopy(fs->e2fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
memset(fs->e2fs_fsmnt + size, 0, sizeof(fs->e2fs_fsmnt) - size);
memcpy(mp->mnt_stat.f_mntonname, fs->e2fs_fsmnt, MNAMELEN);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname + size, 0, MNAMELEN - size);
if (fs->e2fs_fmod != 0) { /* XXX */
fs->e2fs_fmod = 0;
if (fs->e2fs.e2fs_state == 0)
@ -579,7 +579,7 @@ ext2fs_mountfs(devvp, mp, p)
}
ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
bzero((caddr_t)ump, sizeof *ump);
memset((caddr_t)ump, 0, sizeof *ump);
ump->um_e2fs = malloc(sizeof(struct m_ext2fs), M_UFSMNT, M_WAITOK);
e2fs_sbload((struct ext2fs*)bp->b_data, &ump->um_e2fs->e2fs);
brelse(bp);
@ -753,8 +753,8 @@ ext2fs_statfs(mp, sbp, p)
sbp->f_files = fs->e2fs.e2fs_icount;
sbp->f_ffree = fs->e2fs.e2fs_ficount;
if (sbp != &mp->mnt_stat) {
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
memcpy(sbp->f_mntonname, mp->mnt_stat.f_mntonname, MNAMELEN);
memcpy(sbp->f_mntfromname, mp->mnt_stat.f_mntfromname, MNAMELEN);
}
strncpy(sbp->f_fstypename, mp->mnt_op->vfs_name, MFSNAMELEN);
return (0);
@ -874,7 +874,7 @@ ext2fs_vget(mp, ino, vpp)
return (error);
}
MALLOC(ip, struct inode *, sizeof(struct inode), M_EXT2FSNODE, M_WAITOK);
bzero((caddr_t)ip, sizeof(struct inode));
memset((caddr_t)ip, 0, sizeof(struct inode));
lockinit(&ip->i_lock, PINOD, "inode", 0, 0);
vp->v_data = ip;
ip->i_vnode = vp;
@ -915,7 +915,7 @@ ext2fs_vget(mp, ino, vpp)
/* If the inode was deleted, reset all fields */
if (ip->i_e2fs_dtime != 0) {
ip->i_e2fs_mode = ip->i_e2fs_size = ip->i_e2fs_nblock = 0;
bzero(ip->i_e2fs_blocks, sizeof(ip->i_e2fs_blocks));
memset(ip->i_e2fs_blocks, 0, sizeof(ip->i_e2fs_blocks));
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_vnops.c,v 1.12 1998/07/28 20:37:33 mjacob Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.13 1998/08/09 20:15:39 perry Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -1045,7 +1045,7 @@ ext2fs_mkdir(v)
goto bad;
/* Initialize directory with "." and ".." from static template. */
bzero(&dirtemplate, sizeof(dirtemplate));
memset(&dirtemplate, 0, sizeof(dirtemplate));
dirtemplate.dot_ino = h2fs32(ip->i_number);
dirtemplate.dot_reclen = h2fs16(12);
dirtemplate.dot_namlen = h2fs16(1);
@ -1200,7 +1200,7 @@ ext2fs_symlink(v)
len = strlen(ap->a_target);
if (len < vp->v_mount->mnt_maxsymlinklen) {
ip = VTOI(vp);
bcopy(ap->a_target, (char *)ip->i_din.e2fs_din.e2di_shortlink, len);
memcpy((char *)ip->i_din.e2fs_din.e2di_shortlink, ap->a_target, len);
ip->i_e2fs_size = len;
ip->i_flag |= IN_CHANGE | IN_UPDATE;
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_alloc.c,v 1.23 1998/07/28 17:30:01 drochner Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.24 1998/08/09 20:15:39 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -226,7 +226,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero((char *)bp->b_data + osize, (u_int)nsize - osize);
memset((char *)bp->b_data + osize, 0, (u_int)nsize - osize);
*bpp = bp;
return (0);
}
@ -295,7 +295,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero((char *)bp->b_data + osize, (u_int)nsize - osize);
memset((char *)bp->b_data + osize, 0, (u_int)nsize - osize);
*bpp = bp;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_bswap.c,v 1.4 1998/06/13 16:26:22 kleink Exp $ */
/* $NetBSD: ffs_bswap.c,v 1.5 1998/08/09 20:15:39 perry Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@ -99,7 +99,7 @@ ffs_dinode_swap(o, n)
n->di_mtimensec = bswap32(o->di_mtimensec);
n->di_ctime = bswap32(o->di_ctime);
n->di_ctimensec = bswap32(o->di_ctimensec);
bcopy(o->di_db, n->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t));
memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t));
n->di_flags = bswap32(o->di_flags);
n->di_blocks = bswap32(o->di_blocks);
n->di_gen = bswap32(o->di_gen);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_inode.c,v 1.21 1998/06/09 07:46:32 scottr Exp $ */
/* $NetBSD: ffs_inode.c,v 1.22 1998/08/09 20:15:39 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -180,7 +180,7 @@ ffs_truncate(v)
if (length != 0)
panic("ffs_truncate: partial truncate of symlink");
#endif
bzero((char *)&oip->i_ffs_shortlink, (u_int)oip->i_ffs_size);
memset((char *)&oip->i_ffs_shortlink, 0, (u_int)oip->i_ffs_size);
oip->i_ffs_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
return (VOP_UPDATE(ovp, &ts, &ts, 1));
@ -253,7 +253,7 @@ ffs_truncate(v)
#else
(void) vnode_pager_uncache(ovp);
#endif
bzero((char *)bp->b_data + offset, (u_int)(size - offset));
memset((char *)bp->b_data + offset, 0, (u_int)(size - offset));
allocbuf(bp, size);
if (aflags & B_SYNC)
bwrite(bp);
@ -282,7 +282,7 @@ ffs_truncate(v)
* will be returned to the free list. lastiblock values are also
* normalized to -1 for calls to ffs_indirtrunc below.
*/
bcopy((caddr_t)&oip->i_ffs_db[0], (caddr_t)oldblks, sizeof oldblks);
memcpy((caddr_t)oldblks, (caddr_t)&oip->i_ffs_db[0], sizeof oldblks);
for (level = TRIPLE; level >= SINGLE; level--)
if (lastiblock[level] < 0) {
oip->i_ffs_ib[level] = 0;
@ -299,8 +299,8 @@ ffs_truncate(v)
* Note that we save the new block configuration so we can check it
* when we are done.
*/
bcopy((caddr_t)&oip->i_ffs_db[0], (caddr_t)newblks, sizeof newblks);
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_ffs_db[0], sizeof oldblks);
memcpy((caddr_t)newblks, (caddr_t)&oip->i_ffs_db[0], sizeof newblks);
memcpy((caddr_t)&oip->i_ffs_db[0], (caddr_t)oldblks, sizeof oldblks);
oip->i_ffs_size = osize;
vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA;
allerror = vinvalbuf(ovp, vflags, ap->a_cred, ap->a_p, 0, 0);
@ -471,8 +471,8 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
bap = (ufs_daddr_t *)bp->b_data;
if (lastbn != -1) {
MALLOC(copy, ufs_daddr_t *, fs->fs_bsize, M_TEMP, M_WAITOK);
bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->fs_bsize);
bzero((caddr_t)&bap[last + 1],
memcpy((caddr_t)copy, (caddr_t)bap, (u_int)fs->fs_bsize);
memset((caddr_t)&bap[last + 1], 0,
(u_int)(NINDIR(fs) - (last + 1)) * sizeof (ufs_daddr_t));
error = bwrite(bp);
if (error)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vfsops.c,v 1.41 1998/07/05 08:49:48 jonathan Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.42 1998/08/09 20:15:39 perry Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@ -141,7 +141,7 @@ ffs_mountroot()
simple_unlock(&mountlist_slock);
ump = VFSTOUFS(mp);
fs = ump->um_fs;
bzero(fs->fs_fsmnt, sizeof(fs->fs_fsmnt));
memset(fs->fs_fsmnt, 0, sizeof(fs->fs_fsmnt));
(void)copystr(mp->mnt_stat.f_mntonname, fs->fs_fsmnt, MNAMELEN - 1, 0);
(void)ffs_statfs(mp, &mp->mnt_stat, p);
vfs_unbusy(mp);
@ -273,11 +273,11 @@ ffs_mount(mp, path, data, ndp, p)
ump = VFSTOUFS(mp);
fs = ump->um_fs;
(void) copyinstr(path, fs->fs_fsmnt, sizeof(fs->fs_fsmnt) - 1, &size);
bzero(fs->fs_fsmnt + size, sizeof(fs->fs_fsmnt) - size);
bcopy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
memset(fs->fs_fsmnt + size, 0, sizeof(fs->fs_fsmnt) - size);
memcpy(mp->mnt_stat.f_mntonname, fs->fs_fsmnt, MNAMELEN);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname + size, 0, MNAMELEN - size);
if (fs->fs_fmod != 0) { /* XXX */
fs->fs_fmod = 0;
if (fs->fs_clean & FS_WASCLEAN)
@ -337,7 +337,7 @@ ffs_reload(mountp, cred, p)
return (error);
fs = VFSTOUFS(mountp)->um_fs;
newfs = malloc(fs->fs_sbsize, M_UFSMNT, M_WAITOK);
bcopy(bp->b_data, newfs, fs->fs_sbsize);
memcpy(newfs, bp->b_data, fs->fs_sbsize);
#ifdef FFS_EI
if (VFSTOUFS(mountp)->um_flags & UFS_NEEDSWAP)
ffs_sb_swap((struct fs*)bp->b_data, newfs, 0);
@ -353,9 +353,9 @@ ffs_reload(mountp, cred, p)
* new superblock. These should really be in the ufsmount. XXX
* Note that important parameters (eg fs_ncg) are unchanged.
*/
bcopy(&fs->fs_csp[0], &newfs->fs_csp[0], sizeof(fs->fs_csp));
memcpy(&newfs->fs_csp[0], &fs->fs_csp[0], sizeof(fs->fs_csp));
newfs->fs_maxcluster = fs->fs_maxcluster;
bcopy(newfs, fs, (u_int)fs->fs_sbsize);
memcpy(fs, newfs, (u_int)fs->fs_sbsize);
if (fs->fs_sbsize < SBSIZE)
bp->b_flags |= B_INVAL;
brelse(bp);
@ -380,7 +380,7 @@ ffs_reload(mountp, cred, p)
(struct csum*)fs->fs_csp[fragstoblks(fs, i)], size);
else
#endif
bcopy(bp->b_data, fs->fs_csp[fragstoblks(fs, i)],
memcpy(fs->fs_csp[fragstoblks(fs, i)], bp->b_data,
(size_t)size);
brelse(bp);
}
@ -510,7 +510,7 @@ ffs_mountfs(devvp, mp, p)
}
fs = malloc((u_long)sbsize, M_UFSMNT, M_WAITOK);
bcopy(bp->b_data, fs, sbsize);
memcpy(fs, bp->b_data, sbsize);
#ifdef FFS_EI
if (needswap)
ffs_sb_swap((struct fs*)bp->b_data, fs, 0);
@ -527,7 +527,7 @@ ffs_mountfs(devvp, mp, p)
goto out2;
}
ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
bzero((caddr_t)ump, sizeof *ump);
memset((caddr_t)ump, 0, sizeof *ump);
ump->um_fs = fs;
if (fs->fs_sbsize < SBSIZE)
bp->b_flags |= B_INVAL;
@ -559,7 +559,7 @@ ffs_mountfs(devvp, mp, p)
(struct csum*)space, size);
else
#endif
bcopy(bp->b_data, space, (u_int)size);
memcpy(space, bp->b_data, (u_int)size);
fs->fs_csp[fragstoblks(fs, i)] = (struct csum *)space;
space += size;
@ -743,8 +743,8 @@ ffs_statfs(mp, sbp, p)
sbp->f_files = fs->fs_ncg * fs->fs_ipg - ROOTINO;
sbp->f_ffree = fs->fs_cstotal.cs_nifree;
if (sbp != &mp->mnt_stat) {
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
memcpy(sbp->f_mntonname, mp->mnt_stat.f_mntonname, MNAMELEN);
memcpy(sbp->f_mntfromname, mp->mnt_stat.f_mntfromname, MNAMELEN);
}
strncpy(sbp->f_fstypename, mp->mnt_op->vfs_name, MFSNAMELEN);
return (0);
@ -866,7 +866,7 @@ ffs_vget(mp, ino, vpp)
}
type = ump->um_devvp->v_tag == VT_MFS ? M_MFSNODE : M_FFSNODE; /* XXX */
MALLOC(ip, struct inode *, sizeof(struct inode), type, M_WAITOK);
bzero((caddr_t)ip, sizeof(struct inode));
memset((caddr_t)ip, 0, sizeof(struct inode));
lockinit(&ip->i_lock, PINOD, "inode", 0, 0);
vp->v_data = ip;
ip->i_vnode = vp;
@ -1065,7 +1065,7 @@ ffs_sbupdate(mp, waitfor)
bp = getblk(mp->um_devvp, SBOFF >> (fs->fs_fshift - fs->fs_fsbtodb),
(int)fs->fs_sbsize, 0, 0);
bcopy(fs, bp->b_data, fs->fs_sbsize);
memcpy(bp->b_data, fs, fs->fs_sbsize);
#ifdef FFS_EI
if (mp->um_flags & UFS_NEEDSWAP)
ffs_sb_swap(fs, (struct fs*)bp->b_data, 1);
@ -1109,7 +1109,7 @@ ffs_cgupdate(mp, waitfor)
(struct csum*)bp->b_data, size);
else
#endif
bcopy(space, bp->b_data, (u_int)size);
memcpy(bp->b_data, space, (u_int)size);
space += size;
if (waitfor == MNT_WAIT)
error = bwrite(bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfs_vfsops.c,v 1.17 1998/07/05 08:49:49 jonathan Exp $ */
/* $NetBSD: mfs_vfsops.c,v 1.18 1998/08/09 20:15:40 perry Exp $ */
/*
* Copyright (c) 1989, 1990, 1993, 1994
@ -253,11 +253,11 @@ mfs_mount(mp, path, data, ndp, p)
ump = VFSTOUFS(mp);
fs = ump->um_fs;
(void) copyinstr(path, fs->fs_fsmnt, sizeof(fs->fs_fsmnt) - 1, &size);
bzero(fs->fs_fsmnt + size, sizeof(fs->fs_fsmnt) - size);
bcopy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
memset(fs->fs_fsmnt + size, 0, sizeof(fs->fs_fsmnt) - size);
memcpy(mp->mnt_stat.f_mntonname, fs->fs_fsmnt, MNAMELEN);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname + size, 0, MNAMELEN - size);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfs_vnops.c,v 1.13 1998/03/01 02:23:29 fvdl Exp $ */
/* $NetBSD: mfs_vnops.c,v 1.14 1998/08/09 20:15:40 perry Exp $ */
/*
* Copyright (c) 1989, 1993
@ -178,9 +178,9 @@ mfs_strategy(v)
base = mfsp->mfs_baseoff + (bp->b_blkno << DEV_BSHIFT);
if (bp->b_flags & B_READ)
bcopy(base, bp->b_data, bp->b_bcount);
memcpy(bp->b_data, base, bp->b_bcount);
else
bcopy(bp->b_data, base, bp->b_bcount);
memcpy(base, bp->b_data, bp->b_bcount);
biodone(bp);
} else if (mfsp->mfs_pid == p->p_pid) {
mfs_doio(bp, mfsp->mfs_baseoff);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_lookup.c,v 1.17 1998/07/28 18:37:48 thorpej Exp $ */
/* $NetBSD: ufs_lookup.c,v 1.18 1998/08/09 20:15:40 perry Exp $ */
/*
* Copyright (c) 1989, 1993
@ -338,7 +338,7 @@ searchloop:
namlen = ep->d_namlen;
#endif
if (namlen == cnp->cn_namelen &&
!bcmp(cnp->cn_nameptr, ep->d_name,
!memcmp(cnp->cn_nameptr, ep->d_name,
(unsigned)namlen)) {
/*
* Save directory entry's inode number and
@ -719,7 +719,7 @@ ufs_direnter(ip, dvp, cnp)
dp = VTOI(dvp);
newdir.d_ino = ip->i_number;
newdir.d_namlen = cnp->cn_namelen;
bcopy(cnp->cn_nameptr, newdir.d_name, (unsigned)cnp->cn_namelen + 1);
memcpy(newdir.d_name, cnp->cn_nameptr, (unsigned)cnp->cn_namelen + 1);
if (dvp->v_mount->mnt_maxsymlinklen > 0)
newdir.d_type = IFTODT(ip->i_ffs_mode);
else
@ -846,7 +846,7 @@ ufs_direnter2(dvp, dirp, cr, p)
dsize = DIRSIZ(FSFMT(dvp), nep, needswap);
spacefree += ufs_rw16(nep->d_reclen, needswap) - dsize;
loc += ufs_rw16(nep->d_reclen, needswap);
bcopy((caddr_t)nep, (caddr_t)ep, dsize);
memcpy((caddr_t)ep, (caddr_t)nep, dsize);
}
/*
* Update the pointer fields in the previous entry (if any),
@ -854,7 +854,7 @@ ufs_direnter2(dvp, dirp, cr, p)
*/
if (ep->d_ino == 0 ||
(ufs_rw32(ep->d_ino, needswap) == WINO &&
bcmp(ep->d_name, dirp->d_name, dirp->d_namlen) == 0)) {
memcmp(ep->d_name, dirp->d_name, dirp->d_namlen) == 0)) {
if (spacefree + dsize < newentrysize)
panic("ufs_direnter2: compact1");
dirp->d_reclen = spacefree + dsize;
@ -877,7 +877,7 @@ ufs_direnter2(dvp, dirp, cr, p)
dirp->d_namlen = dirp->d_type;
dirp->d_type = tmp;
}
bcopy((caddr_t)dirp, (caddr_t)ep, (u_int)newentrysize);
memcpy((caddr_t)ep, (caddr_t)dirp, (u_int)newentrysize);
error = VOP_BWRITE(bp);
dp->i_flag |= IN_CHANGE | IN_UPDATE;
if (!error && dp->i_endoff && dp->i_endoff < dp->i_ffs_size)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_quota.c,v 1.11 1998/03/01 02:23:37 fvdl Exp $ */
/* $NetBSD: ufs_quota.c,v 1.12 1998/08/09 20:15:40 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993, 1995
@ -735,7 +735,7 @@ dqget(vp, id, ump, type, dqp)
desireddquot += DQUOTINC;
if (numdquot < desireddquot) {
dq = (struct dquot *)malloc(sizeof *dq, M_DQUOT, M_WAITOK);
bzero((char *)dq, sizeof *dq);
memset((char *)dq, 0, sizeof *dq);
numdquot++;
} else {
if ((dq = dqfreelist.tqh_first) == NULL) {
@ -770,7 +770,7 @@ dqget(vp, id, ump, type, dqp)
auio.uio_procp = (struct proc *)0;
error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]);
if (auio.uio_resid == sizeof(struct dqblk) && error == 0)
bzero((caddr_t)&dq->dq_dqb, sizeof(struct dqblk));
memset((caddr_t)&dq->dq_dqb, 0, sizeof(struct dqblk));
if (vp != dqvp)
VOP_UNLOCK(dqvp, 0);
if (dq->dq_flags & DQ_WANT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_vnops.c,v 1.45 1998/08/03 14:19:58 kleink Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.46 1998/08/09 20:15:40 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993, 1995
@ -748,7 +748,7 @@ ufs_whiteout(v)
newdir.d_ino = WINO;
newdir.d_namlen = cnp->cn_namelen;
bcopy(cnp->cn_nameptr, newdir.d_name, (unsigned)cnp->cn_namelen + 1);
memcpy(newdir.d_name, cnp->cn_nameptr, (unsigned)cnp->cn_namelen + 1);
newdir.d_type = DT_WHT;
/* byte order swapping handled by ufs_direnter2 */
error = ufs_direnter2(dvp, &newdir, cnp->cn_cred, cnp->cn_proc);
@ -1425,7 +1425,7 @@ ufs_symlink(v)
len = strlen(ap->a_target);
if (len < vp->v_mount->mnt_maxsymlinklen) {
ip = VTOI(vp);
bcopy(ap->a_target, (char *)ip->i_ffs_shortlink, len);
memcpy((char *)ip->i_ffs_shortlink, ap->a_target, len);
ip->i_ffs_size = len;
ip->i_flag |= IN_CHANGE | IN_UPDATE;
} else