Remove bcopy(), bzero(), bcmp()

bcopy() has a confusing argument order and is actually a move, not a
copy; they're all deprecated since POSIX.1-2001 and removed in -2008,
and we shim them out to mem*() on Linux anyway

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12996
This commit is contained in:
наб
2022-02-25 14:26:54 +01:00
committed by Brian Behlendorf
parent 1d77d62f5a
commit 861166b027
129 changed files with 990 additions and 1051 deletions
+1 -1
View File
@@ -738,7 +738,7 @@ out:
static void
acevals_init(acevals_t *vals, uid_t key)
{
bzero(vals, sizeof (*vals));
memset(vals, 0, sizeof (*vals));
vals->allowed = ACE_MASK_UNDEFINED;
vals->denied = ACE_MASK_UNDEFINED;
vals->mask = ACE_MASK_UNDEFINED;
+2 -2
View File
@@ -301,7 +301,7 @@ SHA256_Final(unsigned char digest[static SHA256_DIGEST_LENGTH], SHA256_CTX *ctx)
be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH);
/* Clear the context state */
explicit_bzero(ctx, sizeof (*ctx));
memset(ctx, 0, sizeof (*ctx));
}
/* SHA-224: ******************************************************* */
@@ -351,7 +351,7 @@ SHA224_Final(unsigned char digest[static SHA224_DIGEST_LENGTH], SHA224_CTX *ctx)
be32enc_vect(digest, ctx->state, SHA224_DIGEST_LENGTH);
/* Clear the context state */
explicit_bzero(ctx, sizeof (*ctx));
memset(ctx, 0, sizeof (*ctx));
}
#ifdef WEAK_REFS
+4 -4
View File
@@ -333,7 +333,7 @@ SHA512_Final(unsigned char digest[static SHA512_DIGEST_LENGTH], SHA512_CTX *ctx)
be64enc_vect(digest, ctx->state, SHA512_DIGEST_LENGTH);
/* Clear the context state */
explicit_bzero(ctx, sizeof (*ctx));
memset(ctx, 0, sizeof (*ctx));
}
/* SHA-512t: ******************************************************** */
@@ -377,7 +377,7 @@ SHA512_224_Final(unsigned char digest[static SHA512_224_DIGEST_LENGTH],
be64enc_vect(digest, ctx->state, SHA512_224_DIGEST_LENGTH);
/* Clear the context state */
explicit_bzero(ctx, sizeof (*ctx));
memset(ctx, 0, sizeof (*ctx));
}
void
@@ -417,7 +417,7 @@ SHA512_256_Final(unsigned char digest[static SHA512_256_DIGEST_LENGTH],
be64enc_vect(digest, ctx->state, SHA512_256_DIGEST_LENGTH);
/* Clear the context state */
explicit_bzero(ctx, sizeof (*ctx));
memset(ctx, 0, sizeof (*ctx));
}
/* ** SHA-384: ******************************************************** */
@@ -467,7 +467,7 @@ SHA384_Final(unsigned char digest[static SHA384_DIGEST_LENGTH], SHA384_CTX *ctx)
be64enc_vect(digest, ctx->state, SHA384_DIGEST_LENGTH);
/* Clear the context state */
explicit_bzero(ctx, sizeof (*ctx));
memset(ctx, 0, sizeof (*ctx));
}
#if 0
+4 -4
View File
@@ -40,7 +40,7 @@ struct zfs2bsd {
int zb_bsd;
};
struct zfs2bsd perms[] = {{ACE_READ_DATA, ACL_READ_DATA},
static const struct zfs2bsd perms[] = {{ACE_READ_DATA, ACL_READ_DATA},
{ACE_WRITE_DATA, ACL_WRITE_DATA},
{ACE_EXECUTE, ACL_EXECUTE},
{ACE_APPEND_DATA, ACL_APPEND_DATA},
@@ -56,7 +56,7 @@ struct zfs2bsd perms[] = {{ACE_READ_DATA, ACL_READ_DATA},
{ACE_SYNCHRONIZE, ACL_SYNCHRONIZE},
{0, 0}};
struct zfs2bsd flags[] = {{ACE_FILE_INHERIT_ACE,
static const struct zfs2bsd flags[] = {{ACE_FILE_INHERIT_ACE,
ACL_ENTRY_FILE_INHERIT},
{ACE_DIRECTORY_INHERIT_ACE,
ACL_ENTRY_DIRECTORY_INHERIT},
@@ -122,7 +122,7 @@ acl_from_aces(struct acl *aclp, const ace_t *aces, int nentries)
return (EINVAL);
}
bzero(aclp, sizeof (*aclp));
memset(aclp, 0, sizeof (*aclp));
aclp->acl_maxcnt = ACL_MAX_ENTRIES;
aclp->acl_cnt = nentries;
@@ -177,7 +177,7 @@ aces_from_acl(ace_t *aces, int *nentries, const struct acl *aclp)
const struct acl_entry *entry;
ace_t *ace;
bzero(aces, sizeof (*aces) * aclp->acl_cnt);
memset(aces, 0, sizeof (*aces) * aclp->acl_cnt);
*nentries = aclp->acl_cnt;
+1 -1
View File
@@ -85,7 +85,7 @@ vfs_setmntopt(vfs_t *vfsp, const char *name, const char *arg,
} else {
opt->len = strlen(arg) + 1;
opt->value = malloc(opt->len, M_MOUNT, M_WAITOK);
bcopy(arg, opt->value, opt->len);
memcpy(opt->value, arg, opt->len);
}
MNT_ILOCK(vfsp);
+2 -5
View File
@@ -141,10 +141,9 @@ int
z_compress_level(void *dest, size_t *destLen, const void *source,
size_t sourceLen, int level)
{
z_stream stream;
z_stream stream = {0};
int err;
bzero(&stream, sizeof (stream));
stream.next_in = (Byte *)source;
stream.avail_in = (uInt)sourceLen;
stream.next_out = dest;
@@ -196,11 +195,9 @@ z_compress_level(void *dest, size_t *destLen, const void *source,
int
z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen)
{
z_stream stream;
z_stream stream = {0};
int err;
bzero(&stream, sizeof (stream));
stream.next_in = (Byte *)source;
stream.avail_in = (uInt)sourceLen;
stream.next_out = dest;
+2 -2
View File
@@ -184,7 +184,7 @@ zone_dataset_visible(const char *dataset, int *write)
LIST_FOREACH(zd, head, zd_next) {
len = strlen(zd->zd_dataset);
if (strlen(dataset) >= len &&
bcmp(dataset, zd->zd_dataset, len) == 0 &&
memcmp(dataset, zd->zd_dataset, len) == 0 &&
(dataset[len] == '\0' || dataset[len] == '/' ||
dataset[len] == '@')) {
if (write)
@@ -206,7 +206,7 @@ zone_dataset_visible(const char *dataset, int *write)
if (dataset[len - 1] == '/')
len--; /* Ignore trailing slash */
if (len < strlen(zd->zd_dataset) &&
bcmp(dataset, zd->zd_dataset, len) == 0 &&
memcmp(dataset, zd->zd_dataset, len) == 0 &&
zd->zd_dataset[len] == '/') {
if (write)
*write = 0;