Project

General

Profile

Bug #6328 ยป zfs-related-updates.diff

Richard PALO, 2015-10-19 02:42 AM

View differences:

usr/src/cmd/zoneadm/zoneadm.c
3874 3874
	 * We shouldn't need these checks but lets be paranoid since we
3875 3875
	 * could blow away the whole system here if we got the wrong zonepath.
3876 3876
	 */
3877
	if (*zonepath == NULL || strcmp(zonepath, "/") == 0) {
3877
	if (*zonepath == '\0'|| strcmp(zonepath, "/") == 0) {
3878 3878
		(void) fprintf(stderr, "invalid zonepath '%s'\n", zonepath);
3879 3879
		return (Z_INVAL);
3880 3880
	}
usr/src/cmd/zpool/zpool_vdev.c
194 194
	 * because we already have an alias handle open for the device.
195 195
	 */
196 196
	if ((drive = dm_get_associated_descriptors(disk, DM_DRIVE,
197
	    &err)) == NULL || *drive == NULL) {
197
	    &err)) == NULL || *drive == 0) {
198 198
		if (err)
199 199
			libdiskmgt_error(err);
200 200
		return (0);
......
214 214
	 * It is possible that the user has specified a removable media drive,
215 215
	 * and the media is not present.
216 216
	 */
217
	if (*media == NULL) {
217
	if (*media == 0) {
218 218
		dm_free_descriptors(media);
219 219
		vdev_error(gettext("'%s' has no media in drive\n"), name);
220 220
		return (-1);
......
236 236
	 * Iterate over all slices and report any errors.  We don't care about
237 237
	 * overlapping slices because we are using the whole disk.
238 238
	 */
239
	for (i = 0; slice[i] != NULL; i++) {
239
	for (i = 0; slice[i] != (uintptr_t)NULL; i++) {
240 240
		char *name = dm_get_name(slice[i], &err);
241 241

  
242 242
		if (check_slice(name, force, B_TRUE, isspare) != 0)
......
265 265
	dev = strrchr(path, '/');
266 266
	assert(dev != NULL);
267 267
	dev++;
268
	if ((desc = dm_get_descriptor_by_name(DM_ALIAS, dev, &err)) != NULL) {
268
	if ((desc = dm_get_descriptor_by_name(DM_ALIAS, dev, &err))
269
	    != (uintptr_t)NULL) {
269 270
		err = check_disk(path, desc, force, isspare);
270 271
		dm_free_descriptor(desc);
271 272
		return (err);
usr/src/lib/libzfs/common/libzfs_sendrecv.c
3053 3053

  
3054 3054
	boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
3055 3055
	    DMU_BACKUP_FEATURE_RESUMING;
3056
	stream_wantsnewfs = (drrb->drr_fromguid == NULL ||
3056
	stream_wantsnewfs = (drrb->drr_fromguid == 0 ||
3057 3057
	    (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && !resuming;
3058 3058

  
3059 3059
	if (stream_wantsnewfs) {
usr/src/lib/libzfs/common/libzfs_util.c
773 773
	free((void *)(uintptr_t)zc->zc_nvlist_conf);
774 774
	free((void *)(uintptr_t)zc->zc_nvlist_src);
775 775
	free((void *)(uintptr_t)zc->zc_nvlist_dst);
776
	zc->zc_nvlist_conf = NULL;
777
	zc->zc_nvlist_src = NULL;
778
	zc->zc_nvlist_dst = NULL;
776
	zc->zc_nvlist_conf = (uintptr_t)NULL;
777
	zc->zc_nvlist_src = (uintptr_t)NULL;
778
	zc->zc_nvlist_dst = (uintptr_t)NULL;
779 779
}
780 780

  
781 781
static int
usr/src/lib/libzfs_core/common/libzfs_core.c
137 137
		zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024);
138 138
		zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
139 139
		    malloc(zc.zc_nvlist_dst_size);
140
		if (zc.zc_nvlist_dst == NULL) {
140
		if (zc.zc_nvlist_dst == 0) {
141 141
			error = ENOMEM;
142 142
			goto out;
143 143
		}
......
149 149
			zc.zc_nvlist_dst_size *= 2;
150 150
			zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
151 151
			    malloc(zc.zc_nvlist_dst_size);
152
			if (zc.zc_nvlist_dst == NULL) {
152
			if (zc.zc_nvlist_dst == 0) {
153 153
				error = ENOMEM;
154 154
				goto out;
155 155
			}
usr/src/lib/libzfs_jni/common/libzfs_jni_diskmgt.c
24 24
 * Use is subject to license terms.
25 25
 */
26 26

  
27
#pragma ident	"%Z%%M%	%I%	%E% SMI"
28

  
29 27
#include "libzfs_jni_diskmgt.h"
30 28
#include "libzfs_jni_util.h"
31 29
#include <strings.h>
......
120 118
				/* Get media */
121 119
				dm_descriptor_t *media =
122 120
				    dm_get_associated_descriptors(disk,
123
					DM_MEDIA, error);
121
				    DM_MEDIA, error);
124 122
				if (*error != 0 || media == NULL ||
125
				    *media == NULL) {
123
				    *media == 0) {
126 124
					handle_error(
127 125
					    "could not get media from disk %s",
128 126
					    dp->name);
......
136 134
						/* Get free slices */
137 135
						dp->slices =
138 136
						    get_disk_usable_slices(
139
							media[0], dp->name,
140
							dp->blocksize,
141
							&(dp->in_use), error);
137
						    media[0], dp->name,
138
						    dp->blocksize,
139
						    &(dp->in_use), error);
142 140
					}
143 141
					dm_free_descriptors(media);
144 142
				}
......
174 172

  
175 173
		int j;
176 174

  
177
		/* Count aliases */
178
		for (j = 0; aliases[j] != NULL; j++);
175
		/* Count aliases */ /* CSTYLED */
176
		for (j = 0; aliases[j] != 0; j++);
179 177

  
180 178
		names = (char **)calloc(j + 1, sizeof (char *));
181 179
		if (names == NULL) {
......
184 182
		} else {
185 183

  
186 184
			/* For each alias... */
187
			for (j = 0; *error == 0 && aliases[j] != NULL; j++) {
185
			for (j = 0; *error == 0 && aliases[j] != 0; j++) {
188 186

  
189 187
				dm_descriptor_t alias = aliases[j];
190 188
				char *aname = dm_get_name(alias, error);
......
268 266

  
269 267
		/* For each slice... */
270 268
		for (j = 0; *error == 0 &&
271
		    slices != NULL && slices[j] != NULL; j++) {
269
		    slices != NULL && slices[j] != 0; j++) {
272 270

  
273 271
			/* Get slice */
274 272
			dmgt_slice_t *slice =
......
368 366

  
369 367
	if (slices != NULL) {
370 368
		int i, nslices;
371

  
369
		/* CSTYLED */
372 370
		for (nslices = 0; slices[nslices] != NULL; nslices++);
373 371

  
374 372
		/* Prune slices based on use */
......
386 384

  
387 385
			s_in_use = slice_in_use(slice, error);
388 386
			if (*error) {
389
			    break;
387
				break;
390 388
			}
391 389

  
392 390
			if (s_in_use) {
......
627 625
	if (slice->size < SPA_MINDEVSIZE) {
628 626
#ifdef DEBUG
629 627
		(void) fprintf(stderr, "can't use %s: slice too small: %llu\n",
630
			slice->name, (unsigned long long)slice->size);
628
		    slice->name, (unsigned long long)slice->size);
631 629
#endif
632 630
		return (1);
633 631
	}
......
686 684
		int i;
687 685

  
688 686
		/* For each disk... */
689
		for (i = 0; disks != NULL && disks[i] != NULL; i++) {
687
		for (i = 0; disks != NULL && disks[i] != 0; i++) {
690 688
			dm_descriptor_t disk = (dm_descriptor_t)disks[i];
691 689
			int online;
692 690

  
usr/src/uts/common/fs/zfs/dsl_pool.c
950 950
dsl_pool_user_release(dsl_pool_t *dp, uint64_t dsobj, const char *tag,
951 951
    dmu_tx_t *tx)
952 952
{
953
	return (dsl_pool_user_hold_rele_impl(dp, dsobj, tag, NULL,
953
	return (dsl_pool_user_hold_rele_impl(dp, dsobj, tag, (uintptr_t)NULL,
954 954
	    tx, B_FALSE));
955 955
}
956 956

  
usr/src/uts/common/fs/zfs/metaslab.c
1606 1606
		 */
1607 1607
		mutex_exit(&mg->mg_lock);
1608 1608
		VERIFY(taskq_dispatch(mg->mg_taskq, metaslab_preload,
1609
		    msp, TQ_SLEEP) != NULL);
1609
		    msp, TQ_SLEEP) != (uintptr_t)NULL);
1610 1610
		mutex_enter(&mg->mg_lock);
1611 1611
		msp = msp_next;
1612 1612
	}
usr/src/uts/common/fs/zfs/sa.c
1573 1573

  
1574 1574
	mutex_enter(&sa->sa_lock);
1575 1575

  
1576
	if (!sa->sa_need_attr_registration || sa->sa_master_obj == NULL) {
1576
	if (!sa->sa_need_attr_registration ||
1577
	    sa->sa_master_obj == (uintptr_t)NULL) {
1577 1578
		mutex_exit(&sa->sa_lock);
1578 1579
		return;
1579 1580
	}
1580 1581

  
1581
	if (sa->sa_reg_attr_obj == NULL) {
1582
	if (sa->sa_reg_attr_obj == (uintptr_t)NULL) {
1582 1583
		sa->sa_reg_attr_obj = zap_create_link(hdl->sa_os,
1583 1584
		    DMU_OT_SA_ATTR_REGISTRATION,
1584 1585
		    sa->sa_master_obj, SA_REGISTRY, tx);
usr/src/uts/common/fs/zfs/vdev.c
1122 1122

  
1123 1123
	for (int c = 0; c < children; c++)
1124 1124
		VERIFY(taskq_dispatch(tq, vdev_open_child, vd->vdev_child[c],
1125
		    TQ_SLEEP) != NULL);
1125
		    TQ_SLEEP) != (uintptr_t)NULL);
1126 1126

  
1127 1127
	taskq_destroy(tq);
1128 1128
}
usr/src/uts/common/fs/zfs/zfs_ioctl.c
293 293
{
294 294
	char *buf;
295 295

  
296
	if (zc->zc_history == NULL)
296
	if (zc->zc_history == (uintptr_t)NULL)
297 297
		return (NULL);
298 298

  
299 299
	buf = kmem_alloc(HIS_MAX_RECORD_LEN, KM_SLEEP);
......
2169 2169
	 * which we aren't supposed to do with a DS_MODE_USER
2170 2170
	 * hold, because it could be inconsistent.
2171 2171
	 */
2172
	if (zc->zc_nvlist_dst != NULL &&
2172
	if (zc->zc_nvlist_dst != (uintptr_t)NULL &&
2173 2173
	    !zc->zc_objset_stats.dds_inconsistent &&
2174 2174
	    dmu_objset_type(os) == DMU_OST_ZFS) {
2175 2175
		nvlist_t *nv;
......
2724 2724
	if (error == 0)
2725 2725
		error = zfs_set_prop_nvlist(zc->zc_name, source, nvl, errors);
2726 2726

  
2727
	if (zc->zc_nvlist_dst != NULL && errors != NULL) {
2727
	if (zc->zc_nvlist_dst != (uintptr_t)NULL && errors != NULL) {
2728 2728
		(void) put_nvlist(zc, errors);
2729 2729
	}
2730 2730

  
......
2875 2875
		spa_close(spa, FTAG);
2876 2876
	}
2877 2877

  
2878
	if (error == 0 && zc->zc_nvlist_dst != NULL)
2878
	if (error == 0 && zc->zc_nvlist_dst != (uintptr_t)NULL)
2879 2879
		error = put_nvlist(zc, nvp);
2880 2880
	else
2881 2881
		error = SET_ERROR(EFAULT);
......
4140 4140
	tosnap = strchr(tofs, '@');
4141 4141
	*tosnap++ = '\0';
4142 4142

  
4143
	if (zc->zc_nvlist_src != NULL &&
4143
	if (zc->zc_nvlist_src != (uintptr_t)NULL &&
4144 4144
	    (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
4145 4145
	    zc->zc_iflags, &props)) != 0)
4146 4146
		return (error);
......
4536 4536
		nvlist_t *policy;
4537 4537
		nvlist_t *config = NULL;
4538 4538

  
4539
		if (zc->zc_nvlist_src == NULL)
4539
		if (zc->zc_nvlist_src == (uintptr_t)NULL)
4540 4540
			return (SET_ERROR(EINVAL));
4541 4541

  
4542 4542
		if ((error = get_nvlist(zc->zc_nvlist_src,
usr/src/uts/common/fs/zfs/zfs_vnops.c
3190 3190
		SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zfsvfs), NULL,
3191 3191
		    &new_mode, sizeof (new_mode));
3192 3192
		zp->z_mode = new_mode;
3193
		ASSERT3U((uintptr_t)aclp, !=, NULL);
3193
		ASSERT3U((uintptr_t)aclp, !=, (uintptr_t)NULL);
3194 3194
		err = zfs_aclset_common(zp, aclp, cr, tx);
3195 3195
		ASSERT0(err);
3196 3196
		if (zp->z_acl_cached)
usr/src/uts/common/fs/zfs/zil.c
1361 1361
	 * created a bad performance problem.
1362 1362
	 */
1363 1363
	if (taskq_dispatch(zilog->zl_clean_taskq,
1364
	    (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP) == NULL)
1364
	    (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP)
1365
	    == (uintptr_t)NULL)
1365 1366
		zil_itxg_clean(clean_me);
1366 1367
}
1367 1368

  
    (1-1/1)