From 73b377432c5efb8451f09f6d25d8aa1b28c239c9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:10:15 +1000 Subject: s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc() Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett --- source3/modules/onefs_streams.c | 2 +- source3/modules/vfs_acl_xattr.c | 2 +- source3/modules/vfs_fileid.c | 2 +- source3/modules/vfs_preopen.c | 2 +- source3/modules/vfs_streams_depot.c | 2 +- source3/modules/vfs_streams_xattr.c | 6 +++--- source3/modules/vfs_xattr_tdb.c | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/onefs_streams.c b/source3/modules/onefs_streams.c index 2634ea77a1..78230bcad6 100644 --- a/source3/modules/onefs_streams.c +++ b/source3/modules/onefs_streams.c @@ -552,7 +552,7 @@ static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams, { struct stream_struct *tmp; - tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct, + tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct, (*num_streams)+1); if (tmp == NULL) { return false; diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index 2a83430fa9..70e979b71b 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -55,7 +55,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx, again: - tmp = TALLOC_REALLOC_ARRAY(ctx, val, uint8_t, size); + tmp = talloc_realloc(ctx, val, uint8_t, size); if (tmp == NULL) { TALLOC_FREE(val); return NT_STATUS_NO_MEMORY; diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c index 642628082a..1168d50cb2 100644 --- a/source3/modules/vfs_fileid.c +++ b/source3/modules/vfs_fileid.c @@ -66,7 +66,7 @@ static void fileid_load_mount_entries(struct fileid_handle_data *data) m->mnt_fsname += 5; } - data->mount_entries = TALLOC_REALLOC_ARRAY(data, + data->mount_entries = talloc_realloc(data, data->mount_entries, struct fileid_mount_entry, data->num_mount_entries+1); diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c index e0d1fd7ec0..b29a4c4351 100644 --- a/source3/modules/vfs_preopen.c +++ b/source3/modules/vfs_preopen.c @@ -166,7 +166,7 @@ static bool preopen_helper_open_one(int sock_fd, char **pnamebuf, nread += thistime; if (nread == talloc_get_size(namebuf)) { - namebuf = TALLOC_REALLOC_ARRAY( + namebuf = talloc_realloc( NULL, namebuf, char, talloc_get_size(namebuf) * 2); if (namebuf == NULL) { diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index f1c687e952..3569405da3 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -716,7 +716,7 @@ static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams, { struct stream_struct *tmp; - tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct, + tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct, (*num_streams)+1); if (tmp == NULL) { return false; diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 3a001e445c..2772c96c4d 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -731,7 +731,7 @@ static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams, { struct stream_struct *tmp; - tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct, + tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct, (*num_streams)+1); if (tmp == NULL) { return false; @@ -880,7 +880,7 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle, if ((offset + n) > ea.value.length-1) { uint8 *tmp; - tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), ea.value.data, uint8, + tmp = talloc_realloc(talloc_tos(), ea.value.data, uint8, offset + n + 1); if (tmp == NULL) { @@ -986,7 +986,7 @@ static int streams_xattr_ftruncate(struct vfs_handle_struct *handle, return -1; } - tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), ea.value.data, uint8, + tmp = talloc_realloc(talloc_tos(), ea.value.data, uint8, offset + 1); if (tmp == NULL) { diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c index 2cfea9cacd..23bb35041e 100644 --- a/source3/modules/vfs_xattr_tdb.c +++ b/source3/modules/vfs_xattr_tdb.c @@ -299,12 +299,12 @@ static int xattr_tdb_setattr(struct db_context *db_ctx, return -1; } - tmp = TALLOC_REALLOC_ARRAY( + tmp = talloc_realloc( attribs, attribs->eas, struct xattr_EA, attribs->num_eas+ 1); if (tmp == NULL) { - DEBUG(0, ("TALLOC_REALLOC_ARRAY failed\n")); + DEBUG(0, ("talloc_realloc failed\n")); TALLOC_FREE(rec); errno = ENOMEM; return -1; -- cgit