Replace *CTASSERT() with _Static_assert()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12993
This commit is contained in:
наб
2022-01-21 18:01:55 +01:00
committed by Brian Behlendorf
parent 7ada752a93
commit c70bb2f610
11 changed files with 72 additions and 66 deletions
+2 -1
View File
@@ -685,7 +685,8 @@ zfsctl_root_readdir(struct vop_readdir_args *ap)
if (zfs_uio_offset(&uio) != dots_offset)
return (SET_ERROR(EINVAL));
CTASSERT(sizeof (node->snapdir->sn_name) <= sizeof (entry.d_name));
_Static_assert(sizeof (node->snapdir->sn_name) <= sizeof (entry.d_name),
"node->snapdir->sn_name too big for entry.d_name");
entry.d_fileno = node->snapdir->sn_id;
entry.d_type = DT_DIR;
strcpy(entry.d_name, node->snapdir->sn_name);
+4 -2
View File
@@ -1777,8 +1777,10 @@ zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp,
credanonp, numsecflavors, secflavors));
}
CTASSERT(SHORT_FID_LEN <= sizeof (struct fid));
CTASSERT(LONG_FID_LEN <= sizeof (struct fid));
_Static_assert(sizeof (struct fid) >= SHORT_FID_LEN,
"struct fid bigger than SHORT_FID_LEN");
_Static_assert(sizeof (struct fid) >= LONG_FID_LEN,
"struct fid bigger than LONG_FID_LEN");
static int
zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp)
+4 -2
View File
@@ -3937,8 +3937,10 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct)
}
CTASSERT(sizeof (struct zfid_short) <= sizeof (struct fid));
CTASSERT(sizeof (struct zfid_long) <= sizeof (struct fid));
_Static_assert(sizeof (struct zfid_short) <= sizeof (struct fid),
"struct zfid_short bigger than struct fid");
_Static_assert(sizeof (struct zfid_long) <= sizeof (struct fid),
"struct zfid_long bigger than struct fid");
/*ARGSUSED*/
static int