Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153892271
D11014.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D11014.id.diff
View Options
Index: head/sys/fs/msdosfs/denode.h
===================================================================
--- head/sys/fs/msdosfs/denode.h
+++ head/sys/fs/msdosfs/denode.h
@@ -179,7 +179,7 @@
#define DE_INTERNALIZE32(dep, dp) \
((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16)
#define DE_INTERNALIZE(dep, dp) \
- (bcopy((dp)->deName, (dep)->de_Name, 11), \
+ (memcpy((dep)->de_Name, (dp)->deName, 11), \
(dep)->de_Attributes = (dp)->deAttributes, \
(dep)->de_LowerCase = (dp)->deLowerCase, \
(dep)->de_CHun = (dp)->deCHundredth, \
@@ -193,7 +193,7 @@
(FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
#define DE_EXTERNALIZE(dp, dep) \
- (bcopy((dep)->de_Name, (dp)->deName, 11), \
+ (memcpy((dp)->deName, (dep)->de_Name, 11), \
(dp)->deAttributes = (dep)->de_Attributes, \
(dp)->deLowerCase = (dep)->de_LowerCase, \
(dp)->deCHundredth = (dep)->de_CHun, \
Index: head/sys/fs/msdosfs/msdosfs_conv.c
===================================================================
--- head/sys/fs/msdosfs/msdosfs_conv.c
+++ head/sys/fs/msdosfs/msdosfs_conv.c
@@ -536,7 +536,7 @@
/*
* Initialize winentry to some useful default
*/
- for (wcp = (uint8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff);
+ memset(wep, 0xff, sizeof(*wep));
wep->weCnt = cnt;
wep->weAttributes = ATTR_WIN95;
wep->weReserved1 = 0;
@@ -1043,11 +1043,11 @@
sizeof(nbp->nb_buf))
return (ENAMETOOLONG);
- bcopy(slot + WIN_CHARS, slot + count, nbp->nb_len);
+ memmove(slot + count, slot + WIN_CHARS, nbp->nb_len);
}
/* Copy in the substring to its slot and update length so far. */
- bcopy(name, slot, count);
+ memcpy(slot, name, count);
nbp->nb_len = newlen;
nbp->nb_last_id = id;
@@ -1069,7 +1069,7 @@
mbnambuf_init(nbp);
return (NULL);
}
- bcopy(&nbp->nb_buf[0], dp->d_name, nbp->nb_len);
+ memcpy(dp->d_name, &nbp->nb_buf[0], nbp->nb_len);
dp->d_name[nbp->nb_len] = '\0';
dp->d_namlen = nbp->nb_len;
Index: head/sys/fs/msdosfs/msdosfs_denode.c
===================================================================
--- head/sys/fs/msdosfs/msdosfs_denode.c
+++ head/sys/fs/msdosfs/msdosfs_denode.c
@@ -410,7 +410,7 @@
#endif
return (error);
}
- bzero(bp->b_data + boff, pmp->pm_bpcluster - boff);
+ memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff);
if (flags & IO_SYNC)
bwrite(bp);
else
Index: head/sys/fs/msdosfs/msdosfs_fat.c
===================================================================
--- head/sys/fs/msdosfs/msdosfs_fat.c
+++ head/sys/fs/msdosfs/msdosfs_fat.c
@@ -335,7 +335,7 @@
/* getblk() never fails */
bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount,
0, 0, 0);
- bcopy(bp->b_data, bpn->b_data, bp->b_bcount);
+ memcpy(bpn->b_data, bp->b_data, bp->b_bcount);
/* Force the clean bit on in the other copies. */
if (cleanfat == 16)
((uint8_t *)bpn->b_data)[3] |= 0x80;
Index: head/sys/fs/msdosfs/msdosfs_vnops.c
===================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c
+++ head/sys/fs/msdosfs/msdosfs_vnops.c
@@ -165,7 +165,7 @@
if ((cnp->cn_flags & HASBUF) == 0)
panic("msdosfs_create: no name");
#endif
- bzero(&ndirent, sizeof(ndirent));
+ memset(&ndirent, 0, sizeof(ndirent));
error = uniqdosname(pdep, cnp, ndirent.de_Name);
if (error)
goto bad;
@@ -1156,13 +1156,13 @@
* we moved a directory, then update its .. entry to point
* to the new parent directory.
*/
- bcopy(ip->de_Name, oldname, 11);
- bcopy(toname, ip->de_Name, 11); /* update denode */
+ memcpy(oldname, ip->de_Name, 11);
+ memcpy(ip->de_Name, toname, 11); /* update denode */
dp->de_fndoffset = to_diroffset;
dp->de_fndcnt = to_count;
error = createde(ip, dp, (struct denode **)0, tcnp);
if (error) {
- bcopy(oldname, ip->de_Name, 11);
+ memcpy(ip->de_Name, oldname, 11);
if (newparent)
VOP_UNLOCK(fdvp, 0);
VOP_UNLOCK(fvp, 0);
@@ -1178,7 +1178,7 @@
* to pass the correct name to createde(). Undo this.
*/
if ((ip->de_Attributes & ATTR_DIRECTORY) != 0)
- bcopy(oldname, ip->de_Name, 11);
+ memcpy(ip->de_Name, oldname, 11);
ip->de_refcnt++;
zp->de_fndoffset = from_diroffset;
error = removede(zp, ip);
@@ -1324,7 +1324,7 @@
if (error)
goto bad2;
- bzero(&ndirent, sizeof(ndirent));
+ memset(&ndirent, 0, sizeof(ndirent));
ndirent.de_pmp = pmp;
ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
getnanotime(&ts);
@@ -1338,8 +1338,8 @@
bn = cntobn(pmp, newcluster);
/* always succeeds */
bp = getblk(pmp->pm_devvp, bn, pmp->pm_bpcluster, 0, 0, 0);
- bzero(bp->b_data, pmp->pm_bpcluster);
- bcopy(&dosdirtemplate, bp->b_data, sizeof dosdirtemplate);
+ memset(bp->b_data, 0, pmp->pm_bpcluster);
+ memcpy(bp->b_data, &dosdirtemplate, sizeof dosdirtemplate);
denp = (struct direntry *)bp->b_data;
putushort(denp[0].deStartCluster, newcluster);
putushort(denp[0].deCDate, ndirent.de_CDate);
@@ -1504,7 +1504,7 @@
/*
* To be safe, initialize dirbuf
*/
- bzero(dirbuf.d_name, sizeof(dirbuf.d_name));
+ memset(dirbuf.d_name, 0, sizeof(dirbuf.d_name));
/*
* If the user buffer is smaller than the size of one dos directory
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 25, 2:11 PM (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32129186
Default Alt Text
D11014.id.diff (5 KB)
Attached To
Mode
D11014: msdosfs: use mem{cpy,move,set} instead of bcopy,bzero
Attached
Detach File
Event Timeline
Log In to Comment