mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user