From dab9b8d6cb8bf71aa6ac221e549eabe6914a6b16 Mon Sep 17 00:00:00 2001 From: Barry Naujok Date: Tue, 15 Apr 2008 16:22:09 +0000 Subject: [PATCH] Remove sysv3 legacy functions Merge of master-melb:xfs-cmds:30883a by kenmcd. nRemove sysv3 legacy functions --- copy/xfs_copy.c | 2 +- growfs/xfs_growfs.c | 2 +- io/bmap.c | 2 +- libhandle/jdm.c | 2 +- logprint/log_misc.c | 80 ++++++++++++++++++++++---------------------- mkfs/proto.c | 12 +++---- mkfs/xfs_mkfs.c | 34 +++++++++---------- repair/agheader.c | 8 ++--- repair/attr_repair.c | 14 ++++---- repair/dinode.c | 8 ++--- repair/dir.c | 44 ++++++++++++------------ repair/dir2.c | 16 ++++----- repair/globals.h | 2 +- repair/incore.c | 2 +- repair/incore_bmc.c | 2 +- repair/incore_ino.c | 8 ++--- repair/phase4.c | 2 +- repair/phase5.c | 20 +++++------ repair/phase6.c | 34 +++++++++---------- repair/rt.c | 2 +- repair/sb.c | 10 +++--- rtcp/xfs_rtcp.c | 4 +-- 22 files changed, 154 insertions(+), 156 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 7795e8a8f..4e3f2aa8c 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -912,7 +912,7 @@ main(int argc, char **argv) /* 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; diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index 9266fecb8..e865b1f72 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -251,7 +251,7 @@ main(int argc, char **argv) * 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; diff --git a/io/bmap.c b/io/bmap.c index 37632e3cb..be833be17 100644 --- a/io/bmap.c +++ b/io/bmap.c @@ -179,7 +179,7 @@ bmap_f( 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; diff --git a/libhandle/jdm.c b/libhandle/jdm.c index a724b61d1..453e3f738 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -47,7 +47,7 @@ jdm_fill_filehandle( filehandle_t *handlep, { 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; } diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 5298f2284..025cd7cc4 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -120,10 +120,10 @@ xlog_print_op_header(xlog_op_header_t *op_head, xlog_op_header_t hbuf; /* - * bcopy because on 64/n32, partial reads can cause the op_head + * memmove because on 64/n32, partial reads can cause the op_head * pointer to come in pointing to an odd-numbered byte */ - bcopy(op_head, &hbuf, sizeof(xlog_op_header_t)); + memmove(&hbuf, op_head, sizeof(xlog_op_header_t)); op_head = &hbuf; *ptr += sizeof(xlog_op_header_t); printf("Oper (%d): tid: %x len: %d clientid: %s ", i, @@ -254,10 +254,10 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops) ushort flags; /* - * bcopy to ensure 8-byte alignment for the long longs in + * memmove to ensure 8-byte alignment for the long longs in * buf_log_format_t structure */ - bcopy(*ptr, &lbuf, MIN(sizeof(xfs_buf_log_format_t), len)); + memmove(&lbuf, *ptr, MIN(sizeof(xfs_buf_log_format_t), len)); f = &lbuf; *ptr += len; @@ -322,15 +322,15 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops) } else { printf("\n"); /* - * bcopy because *ptr may not be 8-byte aligned + * memmove because *ptr may not be 8-byte aligned */ - bcopy(*ptr, &x, sizeof(long long)); - bcopy(*ptr+8, &y, sizeof(long long)); + memmove(&x, *ptr, sizeof(long long)); + memmove(&y, *ptr+8, sizeof(long long)); printf("icount: %lld ifree: %lld ", INT_GET(x, ARCH_CONVERT), INT_GET(y, ARCH_CONVERT)); - bcopy(*ptr+16, &x, sizeof(long long)); - bcopy(*ptr+24, &y, sizeof(long long)); + memmove(&x, *ptr+16, sizeof(long long)); + memmove(&y, *ptr+24, sizeof(long long)); printf("fdblks: %lld frext: %lld\n", INT_GET(x, ARCH_CONVERT), INT_GET(y, ARCH_CONVERT)); @@ -478,10 +478,10 @@ xlog_print_trans_efd(xfs_caddr_t *ptr, uint len) uint core_size = sizeof(xfs_efd_log_format_t) - sizeof(xfs_extent_t); /* - * bcopy to ensure 8-byte alignment for the long longs in + * memmove to ensure 8-byte alignment for the long longs in * xfs_efd_log_format_t structure */ - bcopy(*ptr, &lbuf, MIN(core_size, len)); + memmove(&lbuf, *ptr, MIN(core_size, len)); f = &lbuf; *ptr += len; if (len >= core_size) { @@ -508,14 +508,14 @@ xlog_print_trans_efi(xfs_caddr_t *ptr, uint src_len) int error = 0; /* - * bcopy to ensure 8-byte alignment for the long longs in + * memmove to ensure 8-byte alignment for the long longs in * xfs_efi_log_format_t structure */ if ((src_f = (xfs_efi_log_format_t *)malloc(src_len)) == NULL) { fprintf(stderr, "%s: xlog_print_trans_efi: malloc failed\n", progname); exit(1); } - bcopy(*ptr, (char*)src_f, src_len); + memmove((char*)src_f, *ptr, src_len); *ptr += src_len; /* convert to native format */ @@ -552,7 +552,7 @@ xlog_print_trans_qoff(xfs_caddr_t *ptr, uint len) xfs_qoff_logformat_t *f; xfs_qoff_logformat_t lbuf; - bcopy(*ptr, &lbuf, MIN(sizeof(xfs_qoff_logformat_t), len)); + memmove(&lbuf, *ptr, MIN(sizeof(xfs_qoff_logformat_t), len)); f = &lbuf; *ptr += len; if (len >= sizeof(xfs_qoff_logformat_t)) { @@ -606,14 +606,14 @@ xlog_print_dir_sf(xfs_dir_shortform_t *sfp, int size) printf("SHORTFORM DIRECTORY size %d count %d\n", size, sfp->hdr.count); - bcopy(&(sfp->hdr.parent), &ino, sizeof(ino)); + memmove(&ino, &(sfp->hdr.parent), sizeof(ino)); printf(".. ino 0x%llx\n", (unsigned long long)INT_GET(ino, ARCH_CONVERT)); count = (uint)(sfp->hdr.count); sfep = &(sfp->list[0]); for (i = 0; i < count; i++) { - bcopy(&(sfep->inumber), &ino, sizeof(ino)); - bcopy((sfep->name), namebuf, sfep->namelen); + memmove(&ino, &(sfep->inumber), sizeof(ino)); + memmove(namebuf, (sfep->name), sfep->namelen); namebuf[sfep->namelen] = '\0'; printf("%s ino 0x%llx namelen %d\n", namebuf, (unsigned long long)ino, sfep->namelen); @@ -635,18 +635,18 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops) /* * print inode type header region * - * bcopy to ensure 8-byte alignment for the long longs in + * memmove to ensure 8-byte alignment for the long longs in * xfs_inode_log_format_t structure * - * len can be smaller than xfs_inode_log_format_32|64_t + * len can be smaller than xfs_inode_log_format_32|64_t * if format data is split over operations */ - bcopy(*ptr, &src_lbuf, MIN(sizeof(xfs_inode_log_format_64_t), len)); + memmove(&src_lbuf, *ptr, MIN(sizeof(xfs_inode_log_format_64_t), len)); (*i)++; /* bump index */ *ptr += len; if (len == sizeof(xfs_inode_log_format_32_t) || len == sizeof(xfs_inode_log_format_64_t)) { - f = xfs_inode_item_format_convert((char*)&src_lbuf, len, &dst_lbuf); + f = xfs_inode_item_format_convert((char*)&src_lbuf, len, &dst_lbuf); printf("INODE: "); printf("#regs: %d ino: 0x%llx flags: 0x%x dsize: %d\n", f->ilf_size, (unsigned long long)f->ilf_ino, @@ -672,7 +672,7 @@ xlog_print_trans_inode(xfs_caddr_t *ptr, int len, int *i, int num_ops) return f->ilf_size-1; } - bcopy(*ptr, &dino, sizeof(dino)); + memmove(&dino, *ptr, sizeof(dino)); mode = dino.di_mode & S_IFMT; size = (int)dino.di_size; xlog_print_trans_inode_core(&dino); @@ -791,10 +791,10 @@ xlog_print_trans_dquot(xfs_caddr_t *ptr, int len, int *i, int num_ops) /* * print dquot header region * - * bcopy to ensure 8-byte alignment for the long longs in + * memmove to ensure 8-byte alignment for the long longs in * xfs_dq_logformat_t structure */ - bcopy(*ptr, &lbuf, MIN(sizeof(xfs_dq_logformat_t), len)); + memmove(&lbuf, *ptr, MIN(sizeof(xfs_dq_logformat_t), len)); f = &lbuf; (*i)++; /* bump index */ *ptr += len; @@ -823,7 +823,7 @@ xlog_print_trans_dquot(xfs_caddr_t *ptr, int len, int *i, int num_ops) head = (xlog_op_header_t *)*ptr; xlog_print_op_header(head, *i, ptr); ASSERT(INT_GET(head->oh_len, ARCH_CONVERT) == sizeof(xfs_disk_dquot_t)); - bcopy(*ptr, &ddq, sizeof(xfs_disk_dquot_t)); + memmove(&ddq, *ptr, sizeof(xfs_disk_dquot_t)); printf("DQUOT: magic 0x%hx flags 0%ho\n", INT_GET(ddq.d_magic, ARCH_CONVERT), INT_GET(ddq.d_flags, ARCH_CONVERT)); @@ -967,11 +967,11 @@ xlog_print_record(int fd, ASSERT(xhdrs != NULL); /* from extra headers */ j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); - k = i % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); + k = i % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); INT_SET(*(uint *)ptr, ARCH_CONVERT, INT_GET(xhdrs[j-1].xh_cycle_data[k], ARCH_CONVERT)); } - + } ptr = buf; @@ -1135,7 +1135,7 @@ xlog_print_rec_head(xlog_rec_header_t *head, int *len) break; } printf("h_size: %d\n", INT_GET(head->h_size, ARCH_CONVERT)); - + *len = INT_GET(head->h_len, ARCH_CONVERT); return(INT_GET(head->h_num_logops, ARCH_CONVERT)); } /* xlog_print_rec_head */ @@ -1217,7 +1217,7 @@ xlog_reallocate_xhdrs(int num_hdrs, xlog_rec_ext_header_t **ret_xhdrs) } /* for V2 logs read each extra hdr and print it out */ -static int +static int xlog_print_extended_headers( int fd, int len, @@ -1233,7 +1233,7 @@ xlog_print_extended_headers( char xhbuf[XLOG_HEADER_SIZE]; xlog_rec_ext_header_t *x; - num_required = howmany(len, XLOG_HEADER_CYCLE_SIZE); + num_required = howmany(len, XLOG_HEADER_CYCLE_SIZE); num_hdrs = INT_GET(hdr->h_size, ARCH_CONVERT) / XLOG_HEADER_CYCLE_SIZE; if (num_required > num_hdrs) { @@ -1268,9 +1268,9 @@ xlog_print_extended_headers( } else { if (i == num_hdrs - 1) { - /* last header */ - coverage_bb = BTOBB(len) % - (XLOG_HEADER_CYCLE_SIZE / BBSIZE); + /* last header */ + coverage_bb = BTOBB(len) % + (XLOG_HEADER_CYCLE_SIZE / BBSIZE); } else { /* earliear header */ @@ -1286,8 +1286,8 @@ xlog_print_extended_headers( */ x->xh_cycle = ((xlog_rec_ext_header_t*)xhbuf)->xh_cycle; for (j = 0; j < XLOG_HEADER_CYCLE_SIZE / BBSIZE; j++) { - x->xh_cycle_data[j] = - ((xlog_rec_ext_header_t*)xhbuf)->xh_cycle_data[j]; + x->xh_cycle_data[j] = + ((xlog_rec_ext_header_t*)xhbuf)->xh_cycle_data[j]; } } return 0; @@ -1311,7 +1311,7 @@ void xfs_log_print(xlog_t *log, xfs_caddr_t partial_buf; int zeroed = 0; int cleared = 0; - + logBBsize = log->l_logBBsize; /* @@ -1355,7 +1355,7 @@ void xfs_log_print(xlog_t *log, zeroed = 0; } - if (num_ops == ZEROED_LOG || + if (num_ops == ZEROED_LOG || num_ops == CLEARED_BLKS || num_ops == BAD_HEADER) { if (num_ops == ZEROED_LOG) { @@ -1462,7 +1462,7 @@ loop: num_ops == CLEARED_BLKS || num_ops == BAD_HEADER) { /* we only expect zeroed log entries or cleared log - * entries at the end of the _physical_ log, + * entries at the end of the _physical_ log, * so treat them the same as bad blocks here */ print_xlog_bad_header(blkno-1, hbuf); @@ -1478,9 +1478,9 @@ loop: } partial_log_read: - error= xlog_print_record(fd, + error= xlog_print_record(fd, num_ops, - len, + len, &read_type, &partial_buf, (xlog_rec_header_t *)hbuf, diff --git a/mkfs/proto.c b/mkfs/proto.c index 9c9db439e..4dec1a673 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -234,7 +234,7 @@ newfile( 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 @@ newfile( 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 @@ parseproto( 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 @@ rtinit( 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) { diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 5e86295ba..c07ae1499 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -559,7 +559,7 @@ zero_old_xfs_structures( _("error reading existing superblock -- failed to memalign buffer\n")); return; } - bzero(buf, new_sb->sb_sectsize); + memset(buf, 0, new_sb->sb_sectsize); if (pread(xi->dfd, buf, new_sb->sb_sectsize, 0) != new_sb->sb_sectsize) { fprintf(stderr, _("existing superblock read failed: %s\n"), @@ -592,7 +592,7 @@ zero_old_xfs_structures( /* * block size and basic geometry seems alright, zero the secondaries. */ - bzero(buf, new_sb->sb_sectsize); + memset(buf, 0, new_sb->sb_sectsize); off = 0; for (i = 1; i < sb.sb_agcount; i++) { off += sb.sb_agblocks; @@ -732,9 +732,9 @@ main( force_overwrite = 0; worst_freelist = 0; lazy_sb_counters = 0; - bzero(&fsx, sizeof(fsx)); + memset(&fsx, 0, sizeof(fsx)); - bzero(&xi, sizeof(xi)); + memset(&xi, 0, sizeof(xi)); xi.isdirect = LIBXFS_DIRECT; xi.isreadonly = LIBXFS_EXCLUSIVELY; @@ -1965,7 +1965,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2121,13 +2121,13 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), * 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); libxfs_purgebuf(buf); /* 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); @@ -2150,7 +2150,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); libxfs_purgebuf(buf); } @@ -2179,7 +2179,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2190,7 +2190,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2225,7 +2225,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2247,7 +2247,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2297,7 +2297,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2334,7 +2334,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); @@ -2348,7 +2348,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), */ 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); /* @@ -2357,7 +2357,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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); } @@ -2368,7 +2368,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"), 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; diff --git a/repair/agheader.c b/repair/agheader.c index 3fff079f5..21d3c4601 100644 --- a/repair/agheader.c +++ b/repair/agheader.c @@ -184,7 +184,7 @@ verify_set_agi(xfs_mount_t *mp, xfs_agi_t *agi, xfs_agnumber_t i) * 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 @@ secondary_sb_wack(xfs_mount_t *mp, xfs_buf_t *sbuf, xfs_sb_t *sb, * (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 @@ secondary_sb_wack(xfs_mount_t *mp, xfs_buf_t *sbuf, xfs_sb_t *sb, 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 @@ secondary_sb_wack(xfs_mount_t *mp, xfs_buf_t *sbuf, xfs_sb_t *sb, /* * 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. * diff --git a/repair/attr_repair.c b/repair/attr_repair.c index 2c76d66e1..1e0da7171 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -84,7 +84,7 @@ static int xfs_mac_valid(xfs_mac_label_t *lp); 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; @@ -94,8 +94,8 @@ valuecheck(char *namevalue, char *value, int namelen, int valuelen) (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; @@ -108,8 +108,8 @@ valuecheck(char *namevalue, char *value, int namelen, int valuelen) } } 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; @@ -358,7 +358,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap, } 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++; @@ -805,7 +805,7 @@ process_node_attr( * 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; diff --git a/repair/dinode.c b/repair/dinode.c index e9e78c96d..6e6f294cc 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -297,7 +297,7 @@ clear_dinode(xfs_mount_t *mp, xfs_dinode_t *dino, xfs_ino_t ino_num) /* 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); } @@ -1596,8 +1596,8 @@ process_symlink(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino, * 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 @@ -1622,7 +1622,7 @@ process_symlink(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino, 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++; diff --git a/repair/dir.c b/repair/dir.c index 0ec51ee22..f7e62a51c 100644 --- a/repair/dir.c +++ b/repair/dir.c @@ -334,7 +334,7 @@ process_shortform_dir( * happened. */ if (junkit) { - bcopy(sf_entry->name, name, namelen); + memmove(name, sf_entry->name, namelen); name[namelen] = '\0'; if (!no_modify) { @@ -352,7 +352,7 @@ process_shortform_dir( INT_MOD(sf->hdr.count, ARCH_CONVERT, -1); num_entries--; - bzero((void *) ((__psint_t) sf_entry + tmp_len), + memset((void *) ((__psint_t) sf_entry + tmp_len), 0, tmp_elen); /* @@ -505,7 +505,7 @@ size_t ts_dir_freemap_size = sizeof(da_freemap_t) * DA_BMAP_SIZE; void init_da_freemap(da_freemap_t *dir_freemap) { - bzero(dir_freemap, sizeof(da_freemap_t) * DA_BMAP_SIZE); + memset(dir_freemap, 0, sizeof(da_freemap_t) * DA_BMAP_SIZE); } /* @@ -738,7 +738,7 @@ test(xfs_mount_t *mp) da_hole_map_t holemap; init_da_freemap(dir_freemap); - bzero(&holemap, sizeof(da_hole_map_t)); + memset(&holemap, 0, sizeof(da_hole_map_t)); set_da_freemap(mp, dir_freemap, 0, 50); set_da_freemap(mp, dir_freemap, 100, 126); @@ -1510,9 +1510,9 @@ junk_zerolen_dir_leaf_entries( memmove(entry, entry + 1, (INT_GET(hdr->count, ARCH_CONVERT) - i) * sizeof(xfs_dir_leaf_entry_t)); } - bzero((void *) ((__psint_t) entry + + memset((void *) ((__psint_t) entry + (INT_GET(leaf->hdr.count, ARCH_CONVERT) - i - 1) * - sizeof(xfs_dir_leaf_entry_t)), + sizeof(xfs_dir_leaf_entry_t)), 0, sizeof(xfs_dir_leaf_entry_t)); start = (__psint_t) &leaf->entries[INT_GET(hdr->count, ARCH_CONVERT)] - @@ -1609,9 +1609,9 @@ junk_zerolen_dir_leaf_entries( (INT_GET(leaf->hdr.count, ARCH_CONVERT) - i - 1) * sizeof(xfs_dir_leaf_entry_t)); } - bzero((void *) ((__psint_t) entry + + memset((void *) ((__psint_t) entry + (INT_GET(leaf->hdr.count, ARCH_CONVERT) - i - 1) * - sizeof(xfs_dir_leaf_entry_t)), + sizeof(xfs_dir_leaf_entry_t)), 0, sizeof(xfs_dir_leaf_entry_t)); /* @@ -1794,11 +1794,11 @@ _("nameidx %d for entry #%d, bno %d, ino %llu > fs blocksize, deleting entry\n") sizeof(xfs_dir_leaf_entry_t)) { memmove(entry, entry + 1, bytes); - bzero((void *) - ((__psint_t) entry + bytes), + memset((void *) + ((__psint_t) entry + bytes), 0, sizeof(xfs_dir_leaf_entry_t)); } else { - bzero(entry, + memset(entry, 0, sizeof(xfs_dir_leaf_entry_t)); } @@ -2030,11 +2030,11 @@ _("entry references free inode %llu in directory %llu, would clear entry\n"), */ if (bytes > sizeof(xfs_dir_leaf_entry_t)) { memmove(entry, entry + 1, bytes); - bzero((void *) - ((__psint_t) entry + bytes), + memset((void *) + ((__psint_t) entry + bytes), 0, sizeof(xfs_dir_leaf_entry_t)); } else { - bzero(entry, + memset(entry, 0, sizeof(xfs_dir_leaf_entry_t)); } @@ -2099,7 +2099,7 @@ _("dir entry slot %d in block %u conflicts with used space in dir inode %llu\n") * making it impossible for the stored length * value to be out of range. */ - bcopy(namest->name, fname, entry->namelen); + memmove(fname, namest->name, entry->namelen); fname[entry->namelen] = '\0'; hashval = libxfs_da_hashname((uchar_t *) fname, entry->namelen); @@ -2428,7 +2428,7 @@ _("- would reset namebytes cnt from %d to %d in block %u of dir inode %llu\n"), * (XFS_DIR_LEAF_MAPSIZE (3) * biggest regions) * and see if they match what's in the block */ - bzero(&holemap, sizeof(da_hole_map_t)); + memset(&holemap, 0, sizeof(da_hole_map_t)); process_da_freemap(mp, dir_freemap, &holemap); if (zero_len_entries) { @@ -2485,7 +2485,7 @@ _("- existing hole info for block %d, dir inode %llu (base, size) - \n"), /* * copy leaf block header */ - bcopy(&leaf->hdr, &new_leaf->hdr, + memmove(&new_leaf->hdr, &leaf->hdr, sizeof(xfs_dir_leaf_hdr_t)); /* @@ -2531,8 +2531,8 @@ _("- existing hole info for block %d, dir inode %llu (base, size) - \n"), d_entry->namelen = s_entry->namelen; d_entry->pad2 = 0; - bcopy((char *) leaf + INT_GET(s_entry->nameidx, ARCH_CONVERT), - first_byte, bytes); + memmove(first_byte, (char *) leaf + INT_GET(s_entry->nameidx, ARCH_CONVERT), + bytes); num_entries++; d_entry++; @@ -2544,7 +2544,7 @@ _("- existing hole info for block %d, dir inode %llu (base, size) - \n"), /* * zero space between end of table and top of heap */ - bzero(d_entry, (__psint_t) first_byte + memset(d_entry, 0, (__psint_t) first_byte - (__psint_t) d_entry); /* @@ -2580,7 +2580,7 @@ _("- existing hole info for block %d, dir inode %llu (base, size) - \n"), /* * final step, copy block back */ - bcopy(new_leaf, leaf, mp->m_sb.sb_blocksize); + memmove(leaf, new_leaf, mp->m_sb.sb_blocksize); *buf_dirty = 1; } else { @@ -2816,7 +2816,7 @@ process_node_dir( * 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; diff --git a/repair/dir2.c b/repair/dir2.c index 1c766691a..3aacc9a0d 100644 --- a/repair/dir2.c +++ b/repair/dir2.c @@ -143,7 +143,7 @@ da_read_buf( } 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)); } } @@ -170,7 +170,7 @@ da_buf_clean( 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)); } } @@ -208,10 +208,10 @@ da_bwrite( 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)); } } @@ -244,7 +244,7 @@ da_brelse( 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++) { @@ -1101,7 +1101,7 @@ process_sf_dir2( * happened. */ if (junkit) { - bcopy(sfep->name, name, namelen); + memmove(name, sfep->name, namelen); name[namelen] = '\0'; if (!no_modify) { @@ -1120,7 +1120,7 @@ process_sf_dir2( 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); /* @@ -1944,7 +1944,7 @@ process_node_dir2( * 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; diff --git a/repair/globals.h b/repair/globals.h index b3ca22a10..2d5bce65a 100644 --- a/repair/globals.h +++ b/repair/globals.h @@ -64,7 +64,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. diff --git a/repair/incore.c b/repair/incore.c index 4fe92d5e1..84626c912 100644 --- a/repair/incore.c +++ b/repair/incore.c @@ -77,7 +77,7 @@ setup_bmap(xfs_agnumber_t agno, xfs_agblock_t numblocks, xfs_drtbno_t rtblocks) numblocks); return; } - bzero(ba_bmap[i], size); + memset(ba_bmap[i], 0, size); pthread_mutex_init(&ag_locks[i], NULL); } diff --git a/repair/incore_bmc.c b/repair/incore_bmc.c index cb30e488f..3414b8d51 100644 --- a/repair/incore_bmc.c +++ b/repair/incore_bmc.c @@ -29,7 +29,7 @@ init_bm_cursor(bmap_cursor_t *cursor, int num_levels) { int i; - bzero(cursor, sizeof(bmap_cursor_t)); + memset(cursor, 0, sizeof(bmap_cursor_t)); cursor->ino = NULLFSINO; cursor->num_levels = num_levels; diff --git a/repair/incore_ino.c b/repair/incore_ino.c index b8bc93112..febe0c907 100644 --- a/repair/incore_ino.c +++ b/repair/incore_ino.c @@ -702,12 +702,10 @@ set_inode_parent( if (!tmp) do_error(_("couldn't memalign pentries table\n")); - (void) bcopy(ptbl->pentries, tmp, - target * sizeof(parent_entry_t)); + memmove(tmp, ptbl->pentries, target * sizeof(parent_entry_t)); if (cnt > target) - (void) bcopy(ptbl->pentries + target, - tmp + target + 1, + memmove(tmp + target + 1, ptbl->pentries + target, (cnt - target) * sizeof(parent_entry_t)); free(ptbl->pentries); @@ -840,7 +838,7 @@ incore_ino_init(xfs_mount_t *mp) 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_ino_ex_data = 0; } diff --git a/repair/phase4.c b/repair/phase4.c index 09353b75a..ebea37883 100644 --- a/repair/phase4.c +++ b/repair/phase4.c @@ -362,7 +362,7 @@ phase4(xfs_mount_t *mp) /* * now reset the bitmap for all ags */ - bzero(ba_bmap[i], + memset(ba_bmap[i], 0, roundup((mp->m_sb.sb_agblocks+(NBBY/XR_BB)-1)/(NBBY/XR_BB), sizeof(__uint64_t))); for (j = 0; j < ag_hdr_block; j++) diff --git a/repair/phase5.c b/repair/phase5.c index 18850c3ca..f54c4686c 100644 --- a/repair/phase5.c +++ b/repair/phase5.c @@ -98,7 +98,7 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_agnumber_t agno) * 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. * @@ -686,7 +686,7 @@ prop_freespace_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, * 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); @@ -763,7 +763,7 @@ build_freespace_tree(xfs_mount_t *mp, xfs_agnumber_t agno, * 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); @@ -794,7 +794,7 @@ build_freespace_tree(xfs_mount_t *mp, xfs_agnumber_t agno, * 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; @@ -1043,7 +1043,7 @@ prop_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs, * 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); @@ -1082,7 +1082,7 @@ build_agi(xfs_mount_t *mp, xfs_agnumber_t agno, 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); @@ -1146,7 +1146,7 @@ build_ino_tree(xfs_mount_t *mp, xfs_agnumber_t agno, * 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); @@ -1174,7 +1174,7 @@ build_ino_tree(xfs_mount_t *mp, xfs_agnumber_t agno, * 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; @@ -1261,7 +1261,7 @@ build_agf_agfl(xfs_mount_t *mp, 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", @@ -1327,7 +1327,7 @@ build_agf_agfl(xfs_mount_t *mp, 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 */ diff --git a/repair/phase6.c b/repair/phase6.c index 557601a48..36bb8eef7 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -430,7 +430,7 @@ mk_rbmino(xfs_mount_t *mp) error); } - bzero(&ip->i_d, sizeof(xfs_dinode_core_t)); + memset(&ip->i_d, 0, sizeof(xfs_dinode_core_t)); ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = S_IFREG; @@ -550,7 +550,7 @@ _("can't access block %llu (fsbno %llu) of realtime bitmap inode %llu\n"), return(1); } - bcopy(bmp, XFS_BUF_PTR(bp), mp->m_sb.sb_blocksize); + memmove(XFS_BUF_PTR(bp), bmp, mp->m_sb.sb_blocksize); libxfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1); @@ -619,7 +619,7 @@ _("can't access block %llu (fsbno %llu) of realtime summary inode %llu\n"), return(1); } - bcopy(smp, XFS_BUF_PTR(bp), mp->m_sb.sb_blocksize); + memmove(XFS_BUF_PTR(bp), smp, mp->m_sb.sb_blocksize); libxfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1); @@ -663,7 +663,7 @@ mk_rsumino(xfs_mount_t *mp) error); } - bzero(&ip->i_d, sizeof(xfs_dinode_core_t)); + memset(&ip->i_d, 0, sizeof(xfs_dinode_core_t)); ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = S_IFREG; @@ -762,7 +762,7 @@ mk_root_dir(xfs_mount_t *mp) /* * take care of the core -- initialization from xfs_ialloc() */ - bzero(&ip->i_d, sizeof(xfs_dinode_core_t)); + memset(&ip->i_d, 0, sizeof(xfs_dinode_core_t)); ip->i_d.di_magic = XFS_DINODE_MAGIC; ip->i_d.di_mode = (__uint16_t) mode|S_IFDIR; @@ -1361,7 +1361,7 @@ _("can't map block %d in directory %llu, xfs_bmapi returns %d, nmap = %d\n"), /* * snag the info we need out of the directory then release all buffers */ - bcopy(namest->name, fname, entry->namelen); + memmove(fname, namest->name, entry->namelen); fname[entry->namelen] = '\0'; *hashval = INT_GET(entry->hashval, ARCH_CONVERT); namelen = entry->namelen; @@ -1490,7 +1490,7 @@ lf_block_dir_entry_check(xfs_mount_t *mp, junkit = 0; XFS_DIR_SF_GET_DIRINO(&namest->inumber, &lino); - bcopy(namest->name, fname, entry->namelen); + memmove(fname, namest->name, entry->namelen); fname[entry->namelen] = '\0'; ASSERT(lino != NULLFSINO); @@ -1948,7 +1948,7 @@ dir2_kill_block( libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_ihold(tp, ip); libxfs_da_bjoin(tp, bp); - bzero(&args, sizeof(args)); + memset(&args, 0, sizeof(args)); XFS_BMAP_INIT(&flist, &firstblock); args.dp = ip; args.trans = tp; @@ -2199,7 +2199,7 @@ longform_dir2_entry_check_data( continue; } - bcopy(dep->name, fname, dep->namelen); + memmove(fname, dep->name, dep->namelen); fname[dep->namelen] = '\0'; ASSERT(inum != NULLFSINO); @@ -2822,7 +2822,7 @@ shortform_dir_entry_check(xfs_mount_t *mp, } } - bcopy(sf_entry->name, fname, sf_entry->namelen); + memmove(fname, sf_entry->name, sf_entry->namelen); fname[sf_entry->namelen] = '\0'; ASSERT(no_modify || lino != NULLFSINO); @@ -2937,7 +2937,7 @@ do_junkit: memmove(sf_entry, tmp_sfe, tmp_len); 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); /* @@ -3041,7 +3041,7 @@ prune_sf_dir_entry(xfs_mount_t *mp, xfs_ino_t ino, xfs_inode_t *ip) 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 (sf_entry->name[0] == '/') { @@ -3057,7 +3057,7 @@ prune_sf_dir_entry(xfs_mount_t *mp, xfs_ino_t ino, xfs_inode_t *ip) memmove(sf_entry, tmp_sfe, tmp_len); 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); /* @@ -3212,7 +3212,7 @@ shortform_dir2_entry_check(xfs_mount_t *mp, } } - bcopy(sfep->name, fname, sfep->namelen); + memmove(fname, sfep->name, sfep->namelen); fname[sfep->namelen] = '\0'; ASSERT(no_modify || (lino != NULLFSINO && lino != 0)); @@ -3339,7 +3339,7 @@ do_junkit: memmove(sfep, tmp_sfep, tmp_len); INT_MOD(sfp->hdr.count, ARCH_CONVERT, -1); - bzero((void *) ((__psint_t) sfep + tmp_len), + memset((void *) ((__psint_t) sfep + tmp_len), 0, tmp_elen); /* @@ -3887,8 +3887,8 @@ phase6(xfs_mount_t *mp) ino_tree_node_t *irec; int i; - bzero(&zerocr, sizeof(struct cred)); - bzero(&zerofsx, sizeof(struct fsxattr)); + memset(&zerocr, 0, sizeof(struct cred)); + memset(&zerofsx, 0, sizeof(struct fsxattr)); orphanage_ino = 0; do_log(_("Phase 6 - check inode connectivity...\n")); diff --git a/repair/rt.c b/repair/rt.c index bf309f9d8..587157507 100644 --- a/repair/rt.c +++ b/repair/rt.c @@ -275,7 +275,7 @@ process_rtsummary(xfs_mount_t *mp, 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); } diff --git a/repair/sb.c b/repair/sb.c index 702d1cdb8..589e32589 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -78,7 +78,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest) dest->sb_fdblocks = 0; dest->sb_frextents = 0; - bzero(source->sb_fname, 12); + memset(source->sb_fname, 0, 12); } /* @@ -106,7 +106,7 @@ find_secondary_sb(xfs_sb_t *rsb) exit(1); } - bzero(&bufsb, sizeof(xfs_sb_t)); + memset(&bufsb, 0, sizeof(xfs_sb_t)); retval = 0; dirty = 0; bsize = 0; @@ -145,7 +145,7 @@ find_secondary_sb(xfs_sb_t *rsb) * 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; @@ -579,7 +579,7 @@ free_geo(fs_geo_list_t *list) 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 @@ -646,7 +646,7 @@ get_sb_geometry(fs_geometry_t *geo, xfs_sb_t *sbp) * 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))) { diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c index 4c3d1b776..d91da3194 100644 --- a/rtcp/xfs_rtcp.c +++ b/rtcp/xfs_rtcp.c @@ -328,7 +328,7 @@ rtcp( char *source, char *target, int fextsize) 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 @@ rtcp( char *source, char *target, int fextsize) return( -1 ); } - bzero( fbuf, iosz); + memset( fbuf, 0, iosz); } close(fromfd); -- 2.47.2