Remove sysv3 legacy functions
PATCH 1/1 Remove sysv3 legacy functions
Remove legacy sysv3 functions.
-N
copy/xfs_copy.c +1 -1
@@ -903,7 +903,7 @@/* save what we need (agf) in the btree buffer */ -bcopy (ag_hdr.xfs_agf, btree_buf.data, source_sectorsize); +memmove (btree_buf.data, ag_hdr.xfs_agf, source_sectorsize); ag_hdr.xfs_agf = (xfs_agf_t *) btree_buf.data; btree_buf.length = source_blocksize;
growfs/xfs_growfs.c +1 -1
@@ -250,7 +250,7 @@* Need root access from here on (using raw devices)... */ -bzero (&xi,sizeof (xi)); +memset (&xi,0 ,sizeof (xi)); xi.dname = datadev; xi.logname = logdev; xi.rtname = rtdev;
io/bmap.c +1 -1
@@ -175,7 +175,7 @@ do { /* loop a miximum of two times */ - bzero(map, sizeof(*map)); /* zero header */ + memset(map, 0, sizeof(*map)); /* zero header */ map->bmv_length = -1; map->bmv_count = map_size;
libhandle/jdm.c +1 -1
@@ -47,7 +47,7 @@ { handlep->fh_fshandle = *fshandlep; handlep->fh_sz_following =FILEHANDLE_SZ_FOLLOWING ; -bzero (handlep->fh_pad,FILEHANDLE_SZ_PAD ); +memset (handlep->fh_pad,0 ,FILEHANDLE_SZ_PAD ); handlep->fh_gen = statp->bs_gen; handlep->fh_ino = statp->bs_ino; }
logprint/log_misc.c +23 -23
135 lines not on this page · raw message
mkfs/proto.c +6 -6
@@ -234,7 +234,7 @@if (dolocal && len <=XFS_IFORK_DSIZE (ip)) {libxfs_idata_realloc (ip, len,XFS_DATA_FORK );if (buf) -bcopy (buf, ip->i_df.if_u1.if_data, len); +memmove (ip->i_df.if_u1.if_data, buf, len); ip->i_d.di_size = len; ip->i_df.if_flags &= ~XFS_IFEXTENTS ; ip->i_df.if_flags |=XFS_IFINLINE ;
@@ -257,9 +257,9 @@ d =XFS_FSB_TO_DADDR (mp, map.br_startblock); bp =libxfs_trans_get_buf (logit ? tp :0 , mp->m_dev, d, nb << mp->m_blkbb_log,0 ); -bcopy (buf,XFS_BUF_PTR (bp), len); +memmove (XFS_BUF_PTR (bp), buf, len);if (len <XFS_BUF_COUNT (bp)) -bzero (XFS_BUF_PTR (bp) + len,XFS_BUF_COUNT (bp) - len); +memset (XFS_BUF_PTR (bp) + len,0 ,XFS_BUF_COUNT (bp) - len);if (logit)libxfs_trans_log_buf (tp, bp,0 ,XFS_BUF_COUNT (bp) -1 );else
@@ -376,7 +376,7 @@cred_t creds;char *value; -bzero (&creds,sizeof (creds)); +memset (&creds,0 ,sizeof (creds)); mstr =getstr (pp);switch (mstr[0 ]) {case '-' :
@@ -635,8 +635,8 @@ tp =libxfs_trans_alloc (mp,0 );if ((i =libxfs_trans_reserve (tp,MKFS_BLOCKRES_INODE ,0 ,0 ,0 ,0 )))res_failed (i); -bzero (&creds,sizeof (creds)); -bzero (&fsxattrs,sizeof (fsxattrs)); +memset (&creds,0 ,sizeof (creds)); +memset (&fsxattrs,0 ,sizeof (fsxattrs)); error =libxfs_inode_alloc (&tp,NULL ,S_IFREG ,1 ,0 , &creds, &fsxattrs, &rbmip);if (error) {
mkfs/xfs_mkfs.c +15 -15
@@ -631,9 +631,9 @@ extent_flagging =1 ; force_overwrite =0 ; worst_freelist =0 ; -bzero (&fsx,sizeof (fsx)); +memset (&fsx,0 ,sizeof (fsx)); -bzero (&xi,sizeof (xi)); +memset (&xi,0 ,sizeof (xi)); xi.notvolok =1 ; xi.setblksize =1 ; xi.isreadonly =LIBXFS_EXCLUSIVELY ;
@@ -1882,7 +1882,7 @@ bsize =1 << (blocklog -BBSHIFT ); mp = &mbuf; sbp = &mp->m_sb; -bzero (mp,sizeof (xfs_mount_t)); +memset (mp,0 ,sizeof (xfs_mount_t)); sbp->sb_blocklog = (__uint8_t )blocklog; sbp->sb_sectlog = (__uint8_t )sectorlog; sbp->sb_agblklog = (__uint8_t )libxfs_log2_roundup ((unsigned int )agsize);
@@ -2028,12 +2028,12 @@* ext[2,3] and reiserfs (64k) - and hopefully all else. */ buf =libxfs_getbuf (xi.ddev,0 ,BTOBB (WHACK_SIZE )); -bzero (XFS_BUF_PTR (buf),WHACK_SIZE ); +memset (XFS_BUF_PTR (buf),0 ,WHACK_SIZE );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );/* OK, now write the superblock */ buf =libxfs_getbuf (xi.ddev,XFS_SB_DADDR ,XFS_FSS_TO_BB (mp,1 )); -bzero (XFS_BUF_PTR (buf), sectorsize); +memset (XFS_BUF_PTR (buf),0 , sectorsize);libxfs_xlate_sb (XFS_BUF_PTR (buf), sbp,-1 ,XFS_SB_ALL_BITS );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );
@@ -2056,7 +2056,7 @@if (!xi.disfile) { buf =libxfs_getbuf (xi.ddev, (xi.dsize -BTOBB (WHACK_SIZE )),BTOBB (WHACK_SIZE )); -bzero (XFS_BUF_PTR (buf),WHACK_SIZE ); +memset (XFS_BUF_PTR (buf),0 ,WHACK_SIZE );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE ); }
@@ -2084,7 +2084,7 @@ buf =libxfs_getbuf (xi.ddev,XFS_AG_DADDR (mp, agno,XFS_SB_DADDR ),XFS_FSS_TO_BB (mp,1 )); -bzero (XFS_BUF_PTR (buf), sectorsize); +memset (XFS_BUF_PTR (buf),0 , sectorsize);libxfs_xlate_sb (XFS_BUF_PTR (buf), sbp,-1 ,XFS_SB_ALL_BITS );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );
@@ -2095,7 +2095,7 @@XFS_AG_DADDR (mp, agno,XFS_AGF_DADDR (mp)), XFS_FSS_TO_BB(mp, 1)); agf =XFS_BUF_TO_AGF (buf); -bzero (agf, sectorsize); +memset (agf,0 , sectorsize);if (agno == agcount -1 ) agsize = dblocks - (xfs_drfsbno_t)(agno * agsize);INT_SET (agf->agf_magicnum,ARCH_CONVERT ,XFS_AGF_MAGIC );
@@ -2130,7 +2130,7 @@XFS_AG_DADDR (mp, agno,XFS_AGI_DADDR (mp)), XFS_FSS_TO_BB(mp, 1)); agi =XFS_BUF_TO_AGI (buf); -bzero (agi, sectorsize); +memset (agi,0 , sectorsize);INT_SET (agi->agi_magicnum,ARCH_CONVERT ,XFS_AGI_MAGIC );INT_SET (agi->agi_versionnum,ARCH_CONVERT ,XFS_AGI_VERSION );INT_SET (agi->agi_seqno,ARCH_CONVERT , agno);
@@ -2152,7 +2152,7 @@XFS_AGB_TO_DADDR (mp, agno,XFS_BNO_BLOCK (mp)), bsize); block =XFS_BUF_TO_SBLOCK (buf); -bzero (block, blocksize); +memset (block,0 , blocksize);INT_SET (block->bb_magic,ARCH_CONVERT ,XFS_ABTB_MAGIC );INT_SET (block->bb_level,ARCH_CONVERT ,0 );INT_SET (block->bb_numrecs,ARCH_CONVERT ,1 );
@@ -2202,7 +2202,7 @@XFS_AGB_TO_DADDR (mp, agno,XFS_CNT_BLOCK (mp)), bsize); block =XFS_BUF_TO_SBLOCK (buf); -bzero (block, blocksize); +memset (block,0 , blocksize);INT_SET (block->bb_magic,ARCH_CONVERT ,XFS_ABTC_MAGIC );INT_SET (block->bb_level,ARCH_CONVERT ,0 );INT_SET (block->bb_numrecs,ARCH_CONVERT ,1 );
@@ -2239,7 +2239,7 @@XFS_AGB_TO_DADDR (mp, agno,XFS_IBT_BLOCK (mp)), bsize); block =XFS_BUF_TO_SBLOCK (buf); -bzero (block, blocksize); +memset (block,0 , blocksize);INT_SET (block->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC );INT_SET (block->bb_level,ARCH_CONVERT ,0 );INT_SET (block->bb_numrecs,ARCH_CONVERT ,0 );
@@ -2253,7 +2253,7 @@*/ buf =libxfs_getbuf (mp->m_dev, (xfs_daddr_t )XFS_FSB_TO_BB (mp, dblocks -1LL ), bsize); -bzero (XFS_BUF_PTR (buf), blocksize); +memset (XFS_BUF_PTR (buf),0 , blocksize);libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );/*
@@ -2262,7 +2262,7 @@if (mp->m_rtdev && rtblocks >0 ) { buf =libxfs_getbuf (mp->m_rtdev,XFS_FSB_TO_BB (mp, rtblocks -1LL ), bsize); -bzero (XFS_BUF_PTR (buf), blocksize); +memset (XFS_BUF_PTR (buf),0 , blocksize);libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE ); }
@@ -2273,7 +2273,7 @@xfs_alloc_arg_t args;xfs_trans_t *tp; -bzero (&args,sizeof (args)); +memset (&args,0 ,sizeof (args)); args.tp = tp =libxfs_trans_alloc (mp,0 ); args.mp = mp; args.agno = agno;
repair/agheader.c +4 -4
@@ -184,7 +184,7 @@* the inprogress fields, version numbers, and counters * are allowed to differ as well as all fields after the -* counters to cope with the pre-6.5 mkfs non-bzeroed +* counters to cope with the pre-6.5 mkfs non-zeroed * secondary superblock sectors. */
@@ -233,7 +233,7 @@* (e.g. were pre-6.5 beta) could leave garbage in the secondary * superblock sectors. Anything stamping the shared fs bit or better * into the secondaries is ok and should generate clean secondary -* superblock sectors. so only run the bzero check on the +* superblock sectors. so only run the zero check on the * potentially garbaged secondaries. */ if (pre_65_beta ||
@@ -275,7 +275,7 @@do_warn (_ ("zeroing unused portion of %s superblock (AG #%u)\n" ), !i ?_ ("primary" ) :_ ("secondary" ), i); -bzero ((void *)((__psint_t )sb + size), +memset ((void *)((__psint_t )sb + size),0 , mp->m_sb.sb_sectsize - size); }else do_warn(
@@ -286,7 +286,7 @@/* * now look for the fields we can manipulate directly. -* if we did a bzero and that bzero could have included +* if we did a zero and that zero could have included * the field in question, just silently reset it. otherwise, * complain. *
repair/attr_repair.c +7 -7
@@ -83,7 +83,7 @@int valuecheck (char *namevalue,char *value,int namelen,int valuelen) { -/* for proper alignment issues, get the structs and bcopy the values */ +/* for proper alignment issues, get the structs and memmove the values */ xfs_mac_label_t macl;xfs_acl_t thisacl;void *valuep;
@@ -93,8 +93,8 @@ (strncmp(namevalue, SGI_ACL_DEFAULT, SGI_ACL_DEFAULT_SIZE) == 0)) {if (value ==NULL ) { -bzero (&thisacl,sizeof (xfs_acl_t)); -bcopy (namevalue+namelen, &thisacl, valuelen); +memset (&thisacl,0 ,sizeof (xfs_acl_t)); +memmove (&thisacl, namevalue+namelen, valuelen); valuep = &thisacl; }else valuep = value;
@@ -107,8 +107,8 @@ } }else if (strncmp (namevalue,SGI_MAC_FILE ,SGI_MAC_FILE_SIZE ) ==0 ) {if (value ==NULL ) { -bzero (&macl,sizeof (xfs_mac_label_t)); -bcopy (namevalue+namelen, &macl, valuelen); +memset (&macl,0 ,sizeof (xfs_mac_label_t)); +memmove (&macl, namevalue+namelen, valuelen); valuep = &macl; }else valuep = value;
@@ -357,7 +357,7 @@ }ASSERT (mp->m_sb.sb_blocksize ==XFS_BUF_COUNT (bp)); length =MIN (XFS_BUF_COUNT (bp), valuelen - amountdone); -bcopy (XFS_BUF_PTR (bp), value, length); +memmove (value,XFS_BUF_PTR (bp), length); amountdone += length; value += length; i++;
@@ -803,7 +803,7 @@* the way. Then walk the leaf blocks left-to-right, calling * a parent-verification routine each time we traverse a block. */ -bzero (&da_cursor,sizeof (da_bt_cursor_t)); +memset (&da_cursor,0 ,sizeof (da_bt_cursor_t)); da_cursor.active =0 ; da_cursor.type =0 ; da_cursor.ino = ino;
repair/dinode.c +4 -4
@@ -296,7 +296,7 @@/* and clear the forks */ if (dirty && !no_modify) -bzero (&dino->di_u,XFS_LITINO (mp)); +memset (&dino->di_u,0 ,XFS_LITINO (mp));return (dirty); }
@@ -1516,8 +1516,8 @@* local symlink, just copy the symlink out of the * inode into the data area */ -bcopy ((char *)XFS_DFORK_DPTR (dino), - symlink,INT_GET (dinoc->di_size,ARCH_CONVERT )); +memmove (symlink, (char *)XFS_DFORK_DPTR (dino), +INT_GET (dinoc->di_size,ARCH_CONVERT )); }else {/* * stored in a meta-data file, have to bmap one block
@@ -1542,7 +1542,7 @@ buf_data = (char *)XFS_BUF_PTR (bp); size =MIN (INT_GET (dinoc->di_size,ARCH_CONVERT ) - amountdone, (int )XFS_FSB_TO_BB (mp,1 )*BBSIZE ); -bcopy (buf_data, cptr, size); +memmove (cptr, buf_data, size); cptr += size; amountdone += size; i++;
repair/dir.c +23 -23
148 lines not on this page · raw message
repair/dir2.c +8 -8
@@ -124,7 +124,7 @@ }for (i = off =0 ; i < nex; i++, off +=XFS_BUF_COUNT (bp)) { bp = bplist[i]; -bcopy (XFS_BUF_PTR (bp), (char *)dabuf->data + off, +memmove ((char *)dabuf->data + off,XFS_BUF_PTR (bp),XFS_BUF_COUNT (bp)); } }
@@ -149,7 +149,7 @@ dabuf->dirty =0 ;for (i=off=0 ; i < dabuf->nbuf; i++, off +=XFS_BUF_COUNT (bp)) { bp = dabuf->bps[i]; -bcopy ((char *)dabuf->data + off,XFS_BUF_PTR (bp), +memmove (XFS_BUF_PTR (bp), (char *)dabuf->data + off,XFS_BUF_COUNT (bp)); } }
@@ -187,10 +187,10 @@do_error (_ ("couldn't malloc dir2 buffer list\n" ));exit (1 ); } -bcopy (dabuf->bps, bplist, nbuf *sizeof (*bplist)); +memmove (bplist, dabuf->bps, nbuf *sizeof (*bplist));for (i = off =0 ; i < nbuf; i++, off +=XFS_BUF_COUNT (bp)) { bp = bplist[i]; -bcopy ((char *)dabuf->data + off,XFS_BUF_PTR (bp), +memmove (XFS_BUF_PTR (bp), (char *)dabuf->data + off,XFS_BUF_COUNT (bp)); } }
@@ -223,7 +223,7 @@do_error (_ ("couldn't malloc dir2 buffer list\n" ));exit (1 ); } -bcopy (dabuf->bps, bplist, nbuf *sizeof (*bplist)); +memmove (bplist, dabuf->bps, nbuf *sizeof (*bplist)); }da_buf_done (dabuf);for (i =0 ; i < nbuf; i++)
@@ -1076,7 +1076,7 @@* happened. */ if (junkit) { -bcopy (sfep->name, name, namelen); +memmove (name, sfep->name, namelen); name[namelen] ='\0' ;if (!no_modify) {
@@ -1095,7 +1095,7 @@INT_MOD (sfp->hdr.count,ARCH_CONVERT ,-1 ); num_entries--; -bzero ((void *) ((__psint_t ) sfep + tmp_len), +memset ((void *) ((__psint_t ) sfep + tmp_len),0 , tmp_elen);/*
@@ -1921,7 +1921,7 @@* Then walk the leaf blocks left-to-right, calling a parent * verification routine each time we traverse a block. */ -bzero (&da_cursor,sizeof (da_cursor)); +memset (&da_cursor,0 ,sizeof (da_cursor)); da_cursor.ino = ino; da_cursor.dip = dip; da_cursor.blkmap = blkmap;
repair/globals.h +1 -1
@@ -66,7 +66,7 @@* the partial sb mask bit set, then you depend on the fields * in it up to and including sb_inoalignmt but the unused part of the * sector may have trash in it. If the sb has any bits set that are in -* the good mask, then the entire sb and sector are good (was bzero'ed +* the good mask, then the entire sb and sector are good (was zero'ed * by mkfs). The third mask is for filesystems made by pre-6.5 campus * alpha mkfs's. Those are rare so we'll check for those under * a special option.
repair/incore.c +1 -1
@@ -74,7 +74,7 @@ numblocks);return ; } -bzero (ba_bmap[i], size); +memset (ba_bmap[i],0 , size); }if (rtblocks ==0 ) {
repair/incore_bmc.c +1 -1
@@ -29,7 +29,7 @@ {int i; -bzero (cursor,sizeof (bmap_cursor_t)); +memset (cursor,0 ,sizeof (bmap_cursor_t)); cursor->ino =NULLFSINO ; cursor->num_levels = num_levels;
repair/incore_ino.c +5 -6
@@ -515,12 +515,11 @@if (!tmp)do_error (_ ("couldn't memalign pentries table\n" )); - (void )bcopy (irec->ino_un.plist->pentries, tmp, +memmove (tmp, irec->ino_un.plist->pentries, target *sizeof (parent_entry_t));if (cnt > target) - (void )bcopy (irec->ino_un.plist->pentries + target, - tmp + target +1 , +memmove (tmp + target +1 , irec->ino_un.plist->pentries + target, (cnt - target) *sizeof (parent_entry_t));free (irec->ino_un.plist->pentries);
@@ -674,7 +673,7 @@if (bptrs_index ==BPTR_ALLOC_NUM ) bptrs =NULL ; -bzero (bptr,sizeof (backptrs_t)); +memset (bptr,0 ,sizeof (backptrs_t));return (bptr); }
@@ -688,7 +687,7 @@if ((ptr =malloc (sizeof (backptrs_t))) ==NULL )do_error (_ ("could not malloc back pointer table\n" )); -bzero (ptr,sizeof (backptrs_t)); +memset (ptr,0 ,sizeof (backptrs_t));return (ptr); }
@@ -802,7 +801,7 @@if ((last_rec =malloc (sizeof (ino_tree_node_t *) * agcount)) ==NULL )do_error (_ ("couldn't malloc uncertain inode cache area\n" )); -bzero (last_rec,sizeof (ino_tree_node_t *) * agcount); +memset (last_rec,0 ,sizeof (ino_tree_node_t *) * agcount); full_backptrs =0 ;
repair/phase4.c +7 -7
@@ -68,7 +68,7 @@ namest =XFS_DIR_LEAF_NAMESTRUCT (leaf,INT_GET (entry->nameidx,ARCH_CONVERT ));XFS_DIR_SF_GET_DIRINO (&namest->inumber, &lino); -bcopy (namest->name, fname, entry->namelen); +memmove (fname, namest->name, entry->namelen); fname[entry->namelen] ='\0' ;if (fname[0 ] !='/' && !strcmp (fname,ORPHANAGE )) {
@@ -316,7 +316,7 @@ tmp_sfe =NULL ; sf_entry = next_sfe;XFS_DIR_SF_GET_DIRINO (&sf_entry->inumber, &lino); -bcopy (sf_entry->name, fname, sf_entry->namelen); +memmove (fname, sf_entry->name, sf_entry->namelen); fname[sf_entry->namelen] ='\0' ;if (!strcmp (ORPHANAGE , fname)) {
@@ -447,7 +447,7 @@INT_MOD (sf->hdr.count,ARCH_CONVERT ,-1 ); -bzero ((void *) ((__psint_t ) sf_entry + tmp_len), +memset ((void *) ((__psint_t ) sf_entry + tmp_len),0 , tmp_elen);/*
@@ -534,7 +534,7 @@ } dep = (xfs_dir2_data_entry_t *)ptr; lino =INT_GET (dep->inumber,ARCH_CONVERT ); -bcopy (dep->name, fname, dep->namelen); +memmove (fname, dep->name, dep->namelen); fname[dep->namelen] ='\0' ;if (fname[0 ] !='/' && !strcmp (fname,ORPHANAGE )) {
@@ -797,7 +797,7 @@ sf_entry = next_sfe; lino =XFS_DIR2_SF_GET_INUMBER (sf,XFS_DIR2_SF_INUMBERP (sf_entry)); -bcopy (sf_entry->name, fname, sf_entry->namelen); +memmove (fname, sf_entry->name, sf_entry->namelen); fname[sf_entry->namelen] ='\0' ;if (!strcmp (ORPHANAGE , fname)) {
@@ -931,7 +931,7 @@if (lino >XFS_DIR2_MAX_SHORT_INUM ) sf->hdr.i8count--; -bzero ((void *) ((__psint_t ) sf_entry + tmp_len), +memset ((void *) ((__psint_t ) sf_entry + tmp_len),0 , tmp_elen);/*
@@ -1292,7 +1292,7 @@/* * now reset the bitmap for all ags */ -bzero (ba_bmap[i],roundup (mp->m_sb.sb_agblocks/(NBBY /XR_BB ), +memset (ba_bmap[i],0 ,roundup (mp->m_sb.sb_agblocks/(NBBY /XR_BB ),sizeof (__uint64_t)));for (j =0 ; j < ag_hdr_block; j++)set_agbno_state (mp, i, j,XR_E_INUSE_FS );
repair/phase5.c +10 -10
@@ -93,7 +93,7 @@* extents of free blocks. At this point, we know * that blocks in the bitmap are either set to an * "in use" state or set to unknown (0) since the -* bmaps were bzero'ed in phase 4 and only blocks +* bmaps were zero'ed in phase 4 and only blocks * being used by inodes, inode bmaps, ag headers, * and the files themselves were put into the bitmap. *
@@ -664,7 +664,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_ALLOC_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT , magic);INT_SET (bt_hdr->bb_level,ARCH_CONVERT , level);
@@ -741,7 +741,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_ALLOC_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT , magic);INT_SET (bt_hdr->bb_level,ARCH_CONVERT , i);
@@ -772,7 +772,7 @@* block initialization, lay in block header */ bt_hdr =XFS_BUF_TO_ALLOC_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT , magic); bt_hdr->bb_level =0 ;
@@ -1021,7 +1021,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_INOBT_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC );INT_SET (bt_hdr->bb_level,ARCH_CONVERT , level);
@@ -1060,7 +1060,7 @@XFS_AG_DADDR (mp, agno,XFS_AGI_DADDR (mp)), mp->m_sb.sb_sectsize/BBSIZE); agi =XFS_BUF_TO_AGI (agi_buf); -bzero (agi, mp->m_sb.sb_sectsize); +memset (agi,0 , mp->m_sb.sb_sectsize);INT_SET (agi->agi_magicnum,ARCH_CONVERT ,XFS_AGI_MAGIC );INT_SET (agi->agi_versionnum,ARCH_CONVERT ,XFS_AGI_VERSION );
@@ -1124,7 +1124,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_INOBT_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC );INT_SET (bt_hdr->bb_level,ARCH_CONVERT , i);
@@ -1152,7 +1152,7 @@* block initialization, lay in block header */ bt_hdr =XFS_BUF_TO_INOBT_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC ); bt_hdr->bb_level =0 ;
@@ -1239,7 +1239,7 @@XFS_AG_DADDR (mp, agno,XFS_AGF_DADDR (mp)), mp->m_sb.sb_sectsize/BBSIZE); agf =XFS_BUF_TO_AGF (agf_buf); -bzero (agf, mp->m_sb.sb_sectsize); +memset (agf,0 , mp->m_sb.sb_sectsize);#ifdef XR_BLD_FREE_TRACE fprintf(stderr, "agf = 0x%x, agf_buf->b_un.b_addr = 0x%x\n",
@@ -1287,7 +1287,7 @@XFS_AG_DADDR (mp, agno,XFS_AGFL_DADDR (mp)), mp->m_sb.sb_sectsize/BBSIZE); agfl =XFS_BUF_TO_AGFL (agfl_buf); -bzero (agfl, mp->m_sb.sb_sectsize); +memset (agfl,0 , mp->m_sb.sb_sectsize);/* * ok, now grab as many blocks as we can */
repair/phase6.c +23 -23
178 lines not on this page · raw message
repair/rt.c +1 -1
@@ -275,7 +275,7 @@continue ; } bytes = bp->b_un.b_addr; -bcopy (bytes, (char *)sumfile + sumbno * mp->m_sb.sb_blocksize, +memmove ((char *)sumfile + sumbno * mp->m_sb.sb_blocksize, bytes, mp->m_sb.sb_blocksize);libxfs_putbuf (bp); }
repair/sb.c +5 -5
@@ -77,7 +77,7 @@ dest->sb_fdblocks =0 ; dest->sb_frextents =0 ; -bzero (source->sb_fname,12 ); +memset (source->sb_fname,0 ,12 ); }/*
@@ -105,7 +105,7 @@exit (1 ); } -bzero (&bufsb,sizeof (xfs_sb_t)); +memset (&bufsb,0 ,sizeof (xfs_sb_t)); retval =0 ; dirty =0 ; bsize =0 ;
@@ -144,7 +144,7 @@* found one. now verify it by looking * for other secondaries. */ -bcopy (&bufsb, rsb,sizeof (xfs_sb_t)); +memmove (rsb, &bufsb,sizeof (xfs_sb_t)); rsb->sb_inprogress =0 ; clear_sunit =1 ;
@@ -576,7 +576,7 @@void get_sb_geometry (fs_geometry_t *geo,xfs_sb_t *sbp) { -bzero (geo,sizeof (fs_geometry_t)); +memset (geo,0 ,sizeof (fs_geometry_t));/* * blindly set fields that we know are always good
@@ -643,7 +643,7 @@* superblock fields located after sb_widthfields get set * into the geometry structure only if we can determine * from the features enabled in this superblock whether -* or not the sector was bzero'd at mkfs time. +* or not the sector was zero'd at mkfs time. */ if ((!pre_65_beta && (sbp->sb_versionnum &XR_GOOD_SECSB_VNMASK )) || (pre_65_beta && (sbp->sb_versionnum &XR_ALPHA_SECSB_VNMASK ))) {
rtcp/xfs_rtcp.c +1 -1
@@ -365,7 +365,7 @@return (-1 ); } -bzero ( fbuf, iosz); +memset ( fbuf,0 , iosz); }close (fromfd);
Quoted 3 lines · Nigel Kukard
Remove legacy sysv3 functions.
-N
Thanks for this patch, it looks good and I'll apply it in the near future.
Regards,
Barry.
Re: [PATCH] Remove susv3 legacy functions
Quoted 7 lines
Quoted 4 lines
Remove legacy susv3 functions.
-N
Thanks for this patch, it looks good and I'll apply it in the near future.
Updated patch attached. I missed one bzero().
-N
copy/xfs_copy.c +1 -1
@@ -903,7 +903,7 @@/* save what we need (agf) in the btree buffer */ -bcopy (ag_hdr.xfs_agf, btree_buf.data, source_sectorsize); +memmove (btree_buf.data, ag_hdr.xfs_agf, source_sectorsize); ag_hdr.xfs_agf = (xfs_agf_t *) btree_buf.data; btree_buf.length = source_blocksize;
growfs/xfs_growfs.c +1 -1
@@ -250,7 +250,7 @@* Need root access from here on (using raw devices)... */ -bzero (&xi,sizeof (xi)); +memset (&xi,0 ,sizeof (xi)); xi.dname = datadev; xi.logname = logdev; xi.rtname = rtdev;
io/bmap.c +1 -1
@@ -175,7 +175,7 @@ do { /* loop a miximum of two times */ - bzero(map, sizeof(*map)); /* zero header */ + memset(map, 0, sizeof(*map)); /* zero header */ map->bmv_length = -1; map->bmv_count = map_size;
libhandle/jdm.c +1 -1
@@ -47,7 +47,7 @@ { handlep->fh_fshandle = *fshandlep; handlep->fh_sz_following =FILEHANDLE_SZ_FOLLOWING ; -bzero (handlep->fh_pad,FILEHANDLE_SZ_PAD ); +memset (handlep->fh_pad,0 ,FILEHANDLE_SZ_PAD ); handlep->fh_gen = statp->bs_gen; handlep->fh_ino = statp->bs_ino; }
logprint/log_misc.c +23 -23
135 lines not on this page · raw message
mkfs/proto.c +6 -6
@@ -234,7 +234,7 @@if (dolocal && len <=XFS_IFORK_DSIZE (ip)) {libxfs_idata_realloc (ip, len,XFS_DATA_FORK );if (buf) -bcopy (buf, ip->i_df.if_u1.if_data, len); +memmove (ip->i_df.if_u1.if_data, buf, len); ip->i_d.di_size = len; ip->i_df.if_flags &= ~XFS_IFEXTENTS ; ip->i_df.if_flags |=XFS_IFINLINE ;
@@ -257,9 +257,9 @@ d =XFS_FSB_TO_DADDR (mp, map.br_startblock); bp =libxfs_trans_get_buf (logit ? tp :0 , mp->m_dev, d, nb << mp->m_blkbb_log,0 ); -bcopy (buf,XFS_BUF_PTR (bp), len); +memmove (XFS_BUF_PTR (bp), buf, len);if (len <XFS_BUF_COUNT (bp)) -bzero (XFS_BUF_PTR (bp) + len,XFS_BUF_COUNT (bp) - len); +memset (XFS_BUF_PTR (bp) + len,0 ,XFS_BUF_COUNT (bp) - len);if (logit)libxfs_trans_log_buf (tp, bp,0 ,XFS_BUF_COUNT (bp) -1 );else
@@ -376,7 +376,7 @@cred_t creds;char *value; -bzero (&creds,sizeof (creds)); +memset (&creds,0 ,sizeof (creds)); mstr =getstr (pp);switch (mstr[0 ]) {case '-' :
@@ -635,8 +635,8 @@ tp =libxfs_trans_alloc (mp,0 );if ((i =libxfs_trans_reserve (tp,MKFS_BLOCKRES_INODE ,0 ,0 ,0 ,0 )))res_failed (i); -bzero (&creds,sizeof (creds)); -bzero (&fsxattrs,sizeof (fsxattrs)); +memset (&creds,0 ,sizeof (creds)); +memset (&fsxattrs,0 ,sizeof (fsxattrs)); error =libxfs_inode_alloc (&tp,NULL ,S_IFREG ,1 ,0 , &creds, &fsxattrs, &rbmip);if (error) {
mkfs/xfs_mkfs.c +15 -15
@@ -631,9 +631,9 @@ extent_flagging =1 ; force_overwrite =0 ; worst_freelist =0 ; -bzero (&fsx,sizeof (fsx)); +memset (&fsx,0 ,sizeof (fsx)); -bzero (&xi,sizeof (xi)); +memset (&xi,0 ,sizeof (xi)); xi.notvolok =1 ; xi.setblksize =1 ; xi.isreadonly =LIBXFS_EXCLUSIVELY ;
@@ -1882,7 +1882,7 @@ bsize =1 << (blocklog -BBSHIFT ); mp = &mbuf; sbp = &mp->m_sb; -bzero (mp,sizeof (xfs_mount_t)); +memset (mp,0 ,sizeof (xfs_mount_t)); sbp->sb_blocklog = (__uint8_t )blocklog; sbp->sb_sectlog = (__uint8_t )sectorlog; sbp->sb_agblklog = (__uint8_t )libxfs_log2_roundup ((unsigned int )agsize);
@@ -2028,12 +2028,12 @@* ext[2,3] and reiserfs (64k) - and hopefully all else. */ buf =libxfs_getbuf (xi.ddev,0 ,BTOBB (WHACK_SIZE )); -bzero (XFS_BUF_PTR (buf),WHACK_SIZE ); +memset (XFS_BUF_PTR (buf),0 ,WHACK_SIZE );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );/* OK, now write the superblock */ buf =libxfs_getbuf (xi.ddev,XFS_SB_DADDR ,XFS_FSS_TO_BB (mp,1 )); -bzero (XFS_BUF_PTR (buf), sectorsize); +memset (XFS_BUF_PTR (buf),0 , sectorsize);libxfs_xlate_sb (XFS_BUF_PTR (buf), sbp,-1 ,XFS_SB_ALL_BITS );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );
@@ -2056,7 +2056,7 @@if (!xi.disfile) { buf =libxfs_getbuf (xi.ddev, (xi.dsize -BTOBB (WHACK_SIZE )),BTOBB (WHACK_SIZE )); -bzero (XFS_BUF_PTR (buf),WHACK_SIZE ); +memset (XFS_BUF_PTR (buf),0 ,WHACK_SIZE );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE ); }
@@ -2084,7 +2084,7 @@ buf =libxfs_getbuf (xi.ddev,XFS_AG_DADDR (mp, agno,XFS_SB_DADDR ),XFS_FSS_TO_BB (mp,1 )); -bzero (XFS_BUF_PTR (buf), sectorsize); +memset (XFS_BUF_PTR (buf),0 , sectorsize);libxfs_xlate_sb (XFS_BUF_PTR (buf), sbp,-1 ,XFS_SB_ALL_BITS );libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );
@@ -2095,7 +2095,7 @@XFS_AG_DADDR (mp, agno,XFS_AGF_DADDR (mp)), XFS_FSS_TO_BB(mp, 1)); agf =XFS_BUF_TO_AGF (buf); -bzero (agf, sectorsize); +memset (agf,0 , sectorsize);if (agno == agcount -1 ) agsize = dblocks - (xfs_drfsbno_t)(agno * agsize);INT_SET (agf->agf_magicnum,ARCH_CONVERT ,XFS_AGF_MAGIC );
@@ -2130,7 +2130,7 @@XFS_AG_DADDR (mp, agno,XFS_AGI_DADDR (mp)), XFS_FSS_TO_BB(mp, 1)); agi =XFS_BUF_TO_AGI (buf); -bzero (agi, sectorsize); +memset (agi,0 , sectorsize);INT_SET (agi->agi_magicnum,ARCH_CONVERT ,XFS_AGI_MAGIC );INT_SET (agi->agi_versionnum,ARCH_CONVERT ,XFS_AGI_VERSION );INT_SET (agi->agi_seqno,ARCH_CONVERT , agno);
@@ -2152,7 +2152,7 @@XFS_AGB_TO_DADDR (mp, agno,XFS_BNO_BLOCK (mp)), bsize); block =XFS_BUF_TO_SBLOCK (buf); -bzero (block, blocksize); +memset (block,0 , blocksize);INT_SET (block->bb_magic,ARCH_CONVERT ,XFS_ABTB_MAGIC );INT_SET (block->bb_level,ARCH_CONVERT ,0 );INT_SET (block->bb_numrecs,ARCH_CONVERT ,1 );
@@ -2202,7 +2202,7 @@XFS_AGB_TO_DADDR (mp, agno,XFS_CNT_BLOCK (mp)), bsize); block =XFS_BUF_TO_SBLOCK (buf); -bzero (block, blocksize); +memset (block,0 , blocksize);INT_SET (block->bb_magic,ARCH_CONVERT ,XFS_ABTC_MAGIC );INT_SET (block->bb_level,ARCH_CONVERT ,0 );INT_SET (block->bb_numrecs,ARCH_CONVERT ,1 );
@@ -2239,7 +2239,7 @@XFS_AGB_TO_DADDR (mp, agno,XFS_IBT_BLOCK (mp)), bsize); block =XFS_BUF_TO_SBLOCK (buf); -bzero (block, blocksize); +memset (block,0 , blocksize);INT_SET (block->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC );INT_SET (block->bb_level,ARCH_CONVERT ,0 );INT_SET (block->bb_numrecs,ARCH_CONVERT ,0 );
@@ -2253,7 +2253,7 @@*/ buf =libxfs_getbuf (mp->m_dev, (xfs_daddr_t )XFS_FSB_TO_BB (mp, dblocks -1LL ), bsize); -bzero (XFS_BUF_PTR (buf), blocksize); +memset (XFS_BUF_PTR (buf),0 , blocksize);libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE );/*
@@ -2262,7 +2262,7 @@if (mp->m_rtdev && rtblocks >0 ) { buf =libxfs_getbuf (mp->m_rtdev,XFS_FSB_TO_BB (mp, rtblocks -1LL ), bsize); -bzero (XFS_BUF_PTR (buf), blocksize); +memset (XFS_BUF_PTR (buf),0 , blocksize);libxfs_writebuf (buf,LIBXFS_EXIT_ON_FAILURE ); }
@@ -2273,7 +2273,7 @@xfs_alloc_arg_t args;xfs_trans_t *tp; -bzero (&args,sizeof (args)); +memset (&args,0 ,sizeof (args)); args.tp = tp =libxfs_trans_alloc (mp,0 ); args.mp = mp; args.agno = agno;
repair/agheader.c +4 -4
@@ -184,7 +184,7 @@* the inprogress fields, version numbers, and counters * are allowed to differ as well as all fields after the -* counters to cope with the pre-6.5 mkfs non-bzeroed +* counters to cope with the pre-6.5 mkfs non-zeroed * secondary superblock sectors. */
@@ -233,7 +233,7 @@* (e.g. were pre-6.5 beta) could leave garbage in the secondary * superblock sectors. Anything stamping the shared fs bit or better * into the secondaries is ok and should generate clean secondary -* superblock sectors. so only run the bzero check on the +* superblock sectors. so only run the zero check on the * potentially garbaged secondaries. */ if (pre_65_beta ||
@@ -275,7 +275,7 @@do_warn (_ ("zeroing unused portion of %s superblock (AG #%u)\n" ), !i ?_ ("primary" ) :_ ("secondary" ), i); -bzero ((void *)((__psint_t )sb + size), +memset ((void *)((__psint_t )sb + size),0 , mp->m_sb.sb_sectsize - size); }else do_warn(
@@ -286,7 +286,7 @@/* * now look for the fields we can manipulate directly. -* if we did a bzero and that bzero could have included +* if we did a zero and that zero could have included * the field in question, just silently reset it. otherwise, * complain. *
repair/attr_repair.c +7 -7
@@ -83,7 +83,7 @@int valuecheck (char *namevalue,char *value,int namelen,int valuelen) { -/* for proper alignment issues, get the structs and bcopy the values */ +/* for proper alignment issues, get the structs and memmove the values */ xfs_mac_label_t macl;xfs_acl_t thisacl;void *valuep;
@@ -93,8 +93,8 @@ (strncmp(namevalue, SGI_ACL_DEFAULT, SGI_ACL_DEFAULT_SIZE) == 0)) {if (value ==NULL ) { -bzero (&thisacl,sizeof (xfs_acl_t)); -bcopy (namevalue+namelen, &thisacl, valuelen); +memset (&thisacl,0 ,sizeof (xfs_acl_t)); +memmove (&thisacl, namevalue+namelen, valuelen); valuep = &thisacl; }else valuep = value;
@@ -107,8 +107,8 @@ } }else if (strncmp (namevalue,SGI_MAC_FILE ,SGI_MAC_FILE_SIZE ) ==0 ) {if (value ==NULL ) { -bzero (&macl,sizeof (xfs_mac_label_t)); -bcopy (namevalue+namelen, &macl, valuelen); +memset (&macl,0 ,sizeof (xfs_mac_label_t)); +memmove (&macl, namevalue+namelen, valuelen); valuep = &macl; }else valuep = value;
@@ -357,7 +357,7 @@ }ASSERT (mp->m_sb.sb_blocksize ==XFS_BUF_COUNT (bp)); length =MIN (XFS_BUF_COUNT (bp), valuelen - amountdone); -bcopy (XFS_BUF_PTR (bp), value, length); +memmove (value,XFS_BUF_PTR (bp), length); amountdone += length; value += length; i++;
@@ -803,7 +803,7 @@* the way. Then walk the leaf blocks left-to-right, calling * a parent-verification routine each time we traverse a block. */ -bzero (&da_cursor,sizeof (da_bt_cursor_t)); +memset (&da_cursor,0 ,sizeof (da_bt_cursor_t)); da_cursor.active =0 ; da_cursor.type =0 ; da_cursor.ino = ino;
repair/dinode.c +4 -4
@@ -296,7 +296,7 @@/* and clear the forks */ if (dirty && !no_modify) -bzero (&dino->di_u,XFS_LITINO (mp)); +memset (&dino->di_u,0 ,XFS_LITINO (mp));return (dirty); }
@@ -1516,8 +1516,8 @@* local symlink, just copy the symlink out of the * inode into the data area */ -bcopy ((char *)XFS_DFORK_DPTR (dino), - symlink,INT_GET (dinoc->di_size,ARCH_CONVERT )); +memmove (symlink, (char *)XFS_DFORK_DPTR (dino), +INT_GET (dinoc->di_size,ARCH_CONVERT )); }else {/* * stored in a meta-data file, have to bmap one block
@@ -1542,7 +1542,7 @@ buf_data = (char *)XFS_BUF_PTR (bp); size =MIN (INT_GET (dinoc->di_size,ARCH_CONVERT ) - amountdone, (int )XFS_FSB_TO_BB (mp,1 )*BBSIZE ); -bcopy (buf_data, cptr, size); +memmove (cptr, buf_data, size); cptr += size; amountdone += size; i++;
repair/dir.c +23 -23
148 lines not on this page · raw message
repair/dir2.c +8 -8
@@ -124,7 +124,7 @@ }for (i = off =0 ; i < nex; i++, off +=XFS_BUF_COUNT (bp)) { bp = bplist[i]; -bcopy (XFS_BUF_PTR (bp), (char *)dabuf->data + off, +memmove ((char *)dabuf->data + off,XFS_BUF_PTR (bp),XFS_BUF_COUNT (bp)); } }
@@ -149,7 +149,7 @@ dabuf->dirty =0 ;for (i=off=0 ; i < dabuf->nbuf; i++, off +=XFS_BUF_COUNT (bp)) { bp = dabuf->bps[i]; -bcopy ((char *)dabuf->data + off,XFS_BUF_PTR (bp), +memmove (XFS_BUF_PTR (bp), (char *)dabuf->data + off,XFS_BUF_COUNT (bp)); } }
@@ -187,10 +187,10 @@do_error (_ ("couldn't malloc dir2 buffer list\n" ));exit (1 ); } -bcopy (dabuf->bps, bplist, nbuf *sizeof (*bplist)); +memmove (bplist, dabuf->bps, nbuf *sizeof (*bplist));for (i = off =0 ; i < nbuf; i++, off +=XFS_BUF_COUNT (bp)) { bp = bplist[i]; -bcopy ((char *)dabuf->data + off,XFS_BUF_PTR (bp), +memmove (XFS_BUF_PTR (bp), (char *)dabuf->data + off,XFS_BUF_COUNT (bp)); } }
@@ -223,7 +223,7 @@do_error (_ ("couldn't malloc dir2 buffer list\n" ));exit (1 ); } -bcopy (dabuf->bps, bplist, nbuf *sizeof (*bplist)); +memmove (bplist, dabuf->bps, nbuf *sizeof (*bplist)); }da_buf_done (dabuf);for (i =0 ; i < nbuf; i++)
@@ -1076,7 +1076,7 @@* happened. */ if (junkit) { -bcopy (sfep->name, name, namelen); +memmove (name, sfep->name, namelen); name[namelen] ='\0' ;if (!no_modify) {
@@ -1095,7 +1095,7 @@INT_MOD (sfp->hdr.count,ARCH_CONVERT ,-1 ); num_entries--; -bzero ((void *) ((__psint_t ) sfep + tmp_len), +memset ((void *) ((__psint_t ) sfep + tmp_len),0 , tmp_elen);/*
@@ -1921,7 +1921,7 @@* Then walk the leaf blocks left-to-right, calling a parent * verification routine each time we traverse a block. */ -bzero (&da_cursor,sizeof (da_cursor)); +memset (&da_cursor,0 ,sizeof (da_cursor)); da_cursor.ino = ino; da_cursor.dip = dip; da_cursor.blkmap = blkmap;
repair/globals.h +1 -1
@@ -66,7 +66,7 @@* the partial sb mask bit set, then you depend on the fields * in it up to and including sb_inoalignmt but the unused part of the * sector may have trash in it. If the sb has any bits set that are in -* the good mask, then the entire sb and sector are good (was bzero'ed +* the good mask, then the entire sb and sector are good (was zero'ed * by mkfs). The third mask is for filesystems made by pre-6.5 campus * alpha mkfs's. Those are rare so we'll check for those under * a special option.
repair/incore.c +1 -1
@@ -74,7 +74,7 @@ numblocks);return ; } -bzero (ba_bmap[i], size); +memset (ba_bmap[i],0 , size); }if (rtblocks ==0 ) {
repair/incore_bmc.c +1 -1
@@ -29,7 +29,7 @@ {int i; -bzero (cursor,sizeof (bmap_cursor_t)); +memset (cursor,0 ,sizeof (bmap_cursor_t)); cursor->ino =NULLFSINO ; cursor->num_levels = num_levels;
repair/incore_ino.c +5 -6
@@ -515,12 +515,11 @@if (!tmp)do_error (_ ("couldn't memalign pentries table\n" )); - (void )bcopy (irec->ino_un.plist->pentries, tmp, +memmove (tmp, irec->ino_un.plist->pentries, target *sizeof (parent_entry_t));if (cnt > target) - (void )bcopy (irec->ino_un.plist->pentries + target, - tmp + target +1 , +memmove (tmp + target +1 , irec->ino_un.plist->pentries + target, (cnt - target) *sizeof (parent_entry_t));free (irec->ino_un.plist->pentries);
@@ -674,7 +673,7 @@if (bptrs_index ==BPTR_ALLOC_NUM ) bptrs =NULL ; -bzero (bptr,sizeof (backptrs_t)); +memset (bptr,0 ,sizeof (backptrs_t));return (bptr); }
@@ -688,7 +687,7 @@if ((ptr =malloc (sizeof (backptrs_t))) ==NULL )do_error (_ ("could not malloc back pointer table\n" )); -bzero (ptr,sizeof (backptrs_t)); +memset (ptr,0 ,sizeof (backptrs_t));return (ptr); }
@@ -802,7 +801,7 @@if ((last_rec =malloc (sizeof (ino_tree_node_t *) * agcount)) ==NULL )do_error (_ ("couldn't malloc uncertain inode cache area\n" )); -bzero (last_rec,sizeof (ino_tree_node_t *) * agcount); +memset (last_rec,0 ,sizeof (ino_tree_node_t *) * agcount); full_backptrs =0 ;
repair/phase4.c +7 -7
@@ -68,7 +68,7 @@ namest =XFS_DIR_LEAF_NAMESTRUCT (leaf,INT_GET (entry->nameidx,ARCH_CONVERT ));XFS_DIR_SF_GET_DIRINO (&namest->inumber, &lino); -bcopy (namest->name, fname, entry->namelen); +memmove (fname, namest->name, entry->namelen); fname[entry->namelen] ='\0' ;if (fname[0 ] !='/' && !strcmp (fname,ORPHANAGE )) {
@@ -316,7 +316,7 @@ tmp_sfe =NULL ; sf_entry = next_sfe;XFS_DIR_SF_GET_DIRINO (&sf_entry->inumber, &lino); -bcopy (sf_entry->name, fname, sf_entry->namelen); +memmove (fname, sf_entry->name, sf_entry->namelen); fname[sf_entry->namelen] ='\0' ;if (!strcmp (ORPHANAGE , fname)) {
@@ -447,7 +447,7 @@INT_MOD (sf->hdr.count,ARCH_CONVERT ,-1 ); -bzero ((void *) ((__psint_t ) sf_entry + tmp_len), +memset ((void *) ((__psint_t ) sf_entry + tmp_len),0 , tmp_elen);/*
@@ -534,7 +534,7 @@ } dep = (xfs_dir2_data_entry_t *)ptr; lino =INT_GET (dep->inumber,ARCH_CONVERT ); -bcopy (dep->name, fname, dep->namelen); +memmove (fname, dep->name, dep->namelen); fname[dep->namelen] ='\0' ;if (fname[0 ] !='/' && !strcmp (fname,ORPHANAGE )) {
@@ -797,7 +797,7 @@ sf_entry = next_sfe; lino =XFS_DIR2_SF_GET_INUMBER (sf,XFS_DIR2_SF_INUMBERP (sf_entry)); -bcopy (sf_entry->name, fname, sf_entry->namelen); +memmove (fname, sf_entry->name, sf_entry->namelen); fname[sf_entry->namelen] ='\0' ;if (!strcmp (ORPHANAGE , fname)) {
@@ -931,7 +931,7 @@if (lino >XFS_DIR2_MAX_SHORT_INUM ) sf->hdr.i8count--; -bzero ((void *) ((__psint_t ) sf_entry + tmp_len), +memset ((void *) ((__psint_t ) sf_entry + tmp_len),0 , tmp_elen);/*
@@ -1292,7 +1292,7 @@/* * now reset the bitmap for all ags */ -bzero (ba_bmap[i],roundup (mp->m_sb.sb_agblocks/(NBBY /XR_BB ), +memset (ba_bmap[i],0 ,roundup (mp->m_sb.sb_agblocks/(NBBY /XR_BB ),sizeof (__uint64_t)));for (j =0 ; j < ag_hdr_block; j++)set_agbno_state (mp, i, j,XR_E_INUSE_FS );
repair/phase5.c +10 -10
@@ -93,7 +93,7 @@* extents of free blocks. At this point, we know * that blocks in the bitmap are either set to an * "in use" state or set to unknown (0) since the -* bmaps were bzero'ed in phase 4 and only blocks +* bmaps were zero'ed in phase 4 and only blocks * being used by inodes, inode bmaps, ag headers, * and the files themselves were put into the bitmap. *
@@ -664,7 +664,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_ALLOC_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT , magic);INT_SET (bt_hdr->bb_level,ARCH_CONVERT , level);
@@ -741,7 +741,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_ALLOC_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT , magic);INT_SET (bt_hdr->bb_level,ARCH_CONVERT , i);
@@ -772,7 +772,7 @@* block initialization, lay in block header */ bt_hdr =XFS_BUF_TO_ALLOC_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT , magic); bt_hdr->bb_level =0 ;
@@ -1021,7 +1021,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_INOBT_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC );INT_SET (bt_hdr->bb_level,ARCH_CONVERT , level);
@@ -1060,7 +1060,7 @@XFS_AG_DADDR (mp, agno,XFS_AGI_DADDR (mp)), mp->m_sb.sb_sectsize/BBSIZE); agi =XFS_BUF_TO_AGI (agi_buf); -bzero (agi, mp->m_sb.sb_sectsize); +memset (agi,0 , mp->m_sb.sb_sectsize);INT_SET (agi->agi_magicnum,ARCH_CONVERT ,XFS_AGI_MAGIC );INT_SET (agi->agi_versionnum,ARCH_CONVERT ,XFS_AGI_VERSION );
@@ -1124,7 +1124,7 @@* initialize block header */ bt_hdr =XFS_BUF_TO_INOBT_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC );INT_SET (bt_hdr->bb_level,ARCH_CONVERT , i);
@@ -1152,7 +1152,7 @@* block initialization, lay in block header */ bt_hdr =XFS_BUF_TO_INOBT_BLOCK (lptr->buf_p); -bzero (bt_hdr, mp->m_sb.sb_blocksize); +memset (bt_hdr,0 , mp->m_sb.sb_blocksize);INT_SET (bt_hdr->bb_magic,ARCH_CONVERT ,XFS_IBT_MAGIC ); bt_hdr->bb_level =0 ;
@@ -1239,7 +1239,7 @@XFS_AG_DADDR (mp, agno,XFS_AGF_DADDR (mp)), mp->m_sb.sb_sectsize/BBSIZE); agf =XFS_BUF_TO_AGF (agf_buf); -bzero (agf, mp->m_sb.sb_sectsize); +memset (agf,0 , mp->m_sb.sb_sectsize);#ifdef XR_BLD_FREE_TRACE fprintf(stderr, "agf = 0x%x, agf_buf->b_un.b_addr = 0x%x\n",
@@ -1287,7 +1287,7 @@XFS_AG_DADDR (mp, agno,XFS_AGFL_DADDR (mp)), mp->m_sb.sb_sectsize/BBSIZE); agfl =XFS_BUF_TO_AGFL (agfl_buf); -bzero (agfl, mp->m_sb.sb_sectsize); +memset (agfl,0 , mp->m_sb.sb_sectsize);/* * ok, now grab as many blocks as we can */
repair/phase6.c +23 -23
178 lines not on this page · raw message
repair/rt.c +1 -1
@@ -275,7 +275,7 @@continue ; } bytes = bp->b_un.b_addr; -bcopy (bytes, (char *)sumfile + sumbno * mp->m_sb.sb_blocksize, +memmove ((char *)sumfile + sumbno * mp->m_sb.sb_blocksize, bytes, mp->m_sb.sb_blocksize);libxfs_putbuf (bp); }
repair/sb.c +5 -5
@@ -77,7 +77,7 @@ dest->sb_fdblocks =0 ; dest->sb_frextents =0 ; -bzero (source->sb_fname,12 ); +memset (source->sb_fname,0 ,12 ); }/*
@@ -105,7 +105,7 @@exit (1 ); } -bzero (&bufsb,sizeof (xfs_sb_t)); +memset (&bufsb,0 ,sizeof (xfs_sb_t)); retval =0 ; dirty =0 ; bsize =0 ;
@@ -144,7 +144,7 @@* found one. now verify it by looking * for other secondaries. */ -bcopy (&bufsb, rsb,sizeof (xfs_sb_t)); +memmove (rsb, &bufsb,sizeof (xfs_sb_t)); rsb->sb_inprogress =0 ; clear_sunit =1 ;
@@ -576,7 +576,7 @@void get_sb_geometry (fs_geometry_t *geo,xfs_sb_t *sbp) { -bzero (geo,sizeof (fs_geometry_t)); +memset (geo,0 ,sizeof (fs_geometry_t));/* * blindly set fields that we know are always good
@@ -643,7 +643,7 @@* superblock fields located after sb_widthfields get set * into the geometry structure only if we can determine * from the features enabled in this superblock whether -* or not the sector was bzero'd at mkfs time. +* or not the sector was zero'd at mkfs time. */ if ((!pre_65_beta && (sbp->sb_versionnum &XR_GOOD_SECSB_VNMASK )) || (pre_65_beta && (sbp->sb_versionnum &XR_ALPHA_SECSB_VNMASK ))) {
rtcp/xfs_rtcp.c +2 -2
@@ -328,7 +328,7 @@ iosz = dioattr.d_miniosz; fbuf =memalign ( dioattr.d_mem, iosz); -bzero (fbuf, iosz); +memset (fbuf,0 , iosz);/* * read the entire source file
@@ -365,7 +365,7 @@return (-1 ); } -bzero ( fbuf, iosz); +memset ( fbuf,0 , iosz); }close (fromfd);