From: Volker Lendecke Date: Fri, 17 Oct 2025 12:28:40 +0000 (+0200) Subject: s3: Replace TALLOC_SIZE() with talloc_size() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7c533bdc9f916e3559d487a4a06d033728c57f4;p=thirdparty%2Fsamba.git s3: Replace TALLOC_SIZE() with talloc_size() Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index da2e5d591c6..b29e8e4201a 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -211,7 +211,6 @@ copy an IP address from one buffer to another #define SMB_XMALLOC_P(type) (type *)smb_xmalloc_array(sizeof(type),1) #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count)) -#define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) #define talloc_destroy(ctx) talloc_free(ctx) #ifndef TALLOC_FREE diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c index 35c73128871..7343e284bb5 100644 --- a/source3/modules/vfs_aixacl2.c +++ b/source3/modules/vfs_aixacl2.c @@ -62,7 +62,7 @@ static AIXJFS2_ACL_T *aixjfs2_getacl_alloc(const char *fname, acl_type_t *type) TALLOC_CTX *mem_ctx; mem_ctx = talloc_tos(); - acl = (AIXJFS2_ACL_T *)TALLOC_SIZE(mem_ctx, len); + acl = (AIXJFS2_ACL_T *)talloc_size(mem_ctx, len); if (acl == NULL) { errno = ENOMEM; return NULL; @@ -77,7 +77,7 @@ static AIXJFS2_ACL_T *aixjfs2_getacl_alloc(const char *fname, acl_type_t *type) len = aixacl2_getlen(acl, type) + sizeof(AIXJFS2_ACL_T); DEBUG(10,("aixjfs2_getacl_alloc - acl_len:%d\n",len)); - acl = (AIXJFS2_ACL_T *)TALLOC_SIZE(mem_ctx, len); + acl = (AIXJFS2_ACL_T *)talloc_size(mem_ctx, len); if (acl == NULL) { errno = ENOMEM; return NULL; @@ -316,7 +316,7 @@ static bool aixjfs2_process_smbacl(vfs_handle_struct *handle, naces = smb_get_naces(smbacl); aclLen = ACL_V4_SIZ + naces * entryLen; - jfs2acl = (nfs4_acl_int_t *)TALLOC_SIZE(mem_ctx, aclLen); + jfs2acl = (nfs4_acl_int_t *)talloc_size(mem_ctx, aclLen); if (jfs2acl==NULL) { DEBUG(0, ("TALLOC_SIZE failed\n")); errno = ENOMEM; diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 130aa5110a8..9c88641577e 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -748,7 +748,7 @@ static struct gpfs_acl *vfs_gpfs_smbacl2gpfsacl(TALLOC_CTX *mem_ctx, gacl_len = offsetof(gpfs_acl_t, ace_v4) + sizeof(unsigned int) + smb_get_naces(smbacl) * sizeof(gpfs_ace_v4_t); - gacl = (struct gpfs_acl *)TALLOC_SIZE(mem_ctx, gacl_len); + gacl = (struct gpfs_acl *)talloc_size(mem_ctx, gacl_len); if (gacl == NULL) { DEBUG(0, ("talloc failed\n")); errno = ENOMEM;