mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
cstyle: Resolve C style issues
The vast majority of these changes are in Linux specific code. They are the result of not having an automated style checker to validate the code when it was originally written. Others were caused when the common code was slightly adjusted for Linux. This patch contains no functional changes. It only refreshes the code to conform to style guide. Everyone submitting patches for inclusion upstream should now run 'make checkstyle' and resolve any warning prior to opening a pull request. The automated builders have been updated to fail a build if when 'make checkstyle' detects an issue. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1821
This commit is contained in:
committed by
Brian Behlendorf
parent
8ffef572ed
commit
d1d7e2689d
+35
-33
@@ -3574,7 +3574,7 @@ out:
|
||||
}
|
||||
|
||||
#undef OD_ARRAY_SIZE
|
||||
#define OD_ARRAY_SIZE 4
|
||||
#define OD_ARRAY_SIZE 4
|
||||
|
||||
/*
|
||||
* Verify that dmu_object_{alloc,free} work as expected.
|
||||
@@ -3587,7 +3587,7 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t id)
|
||||
int size;
|
||||
int b;
|
||||
|
||||
size = sizeof(ztest_od_t) * OD_ARRAY_SIZE;
|
||||
size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
|
||||
od = umem_alloc(size, UMEM_NOFAIL);
|
||||
batchsize = OD_ARRAY_SIZE;
|
||||
|
||||
@@ -3609,7 +3609,7 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t id)
|
||||
}
|
||||
|
||||
#undef OD_ARRAY_SIZE
|
||||
#define OD_ARRAY_SIZE 2
|
||||
#define OD_ARRAY_SIZE 2
|
||||
|
||||
/*
|
||||
* Verify that dmu_{read,write} work as expected.
|
||||
@@ -3621,7 +3621,7 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
||||
ztest_od_t *od;
|
||||
|
||||
objset_t *os = zd->zd_os;
|
||||
size = sizeof(ztest_od_t) * OD_ARRAY_SIZE;
|
||||
size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
|
||||
od = umem_alloc(size, UMEM_NOFAIL);
|
||||
dmu_tx_t *tx;
|
||||
int i, freeit, error;
|
||||
@@ -3888,7 +3888,7 @@ compare_and_update_pbbufs(uint64_t s, bufwad_t *packbuf, bufwad_t *bigbuf,
|
||||
}
|
||||
|
||||
#undef OD_ARRAY_SIZE
|
||||
#define OD_ARRAY_SIZE 2
|
||||
#define OD_ARRAY_SIZE 2
|
||||
|
||||
void
|
||||
ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
||||
@@ -3911,7 +3911,7 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
||||
arc_buf_t **bigbuf_arcbufs;
|
||||
dmu_object_info_t doi;
|
||||
|
||||
size = sizeof(ztest_od_t) * OD_ARRAY_SIZE;
|
||||
size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
|
||||
od = umem_alloc(size, UMEM_NOFAIL);
|
||||
|
||||
/*
|
||||
@@ -4132,7 +4132,7 @@ ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id)
|
||||
{
|
||||
ztest_od_t *od;
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
uint64_t offset = (1ULL << (ztest_random(20) + 43)) +
|
||||
(ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
|
||||
|
||||
@@ -4149,7 +4149,7 @@ ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id)
|
||||
while (ztest_random(10) != 0)
|
||||
ztest_io(zd, od->od_object, offset);
|
||||
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -4162,17 +4162,18 @@ ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id)
|
||||
uint64_t blocksize = ztest_random_blocksize();
|
||||
void *data;
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
|
||||
ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0);
|
||||
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t), !ztest_random(2)) != 0) {
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t),
|
||||
!ztest_random(2)) != 0) {
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ztest_truncate(zd, od->od_object, offset, count * blocksize) != 0) {
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4190,7 +4191,7 @@ ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id)
|
||||
}
|
||||
|
||||
umem_free(data, blocksize);
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4215,7 +4216,7 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
|
||||
int error;
|
||||
char *hc[2] = { "s.acl.h", ".s.open.h.hyLZlg" };
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
ztest_od_init(od, id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0);
|
||||
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t),
|
||||
@@ -4338,7 +4339,7 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
|
||||
VERIFY3U(0, ==, zap_remove(os, object, propname, tx));
|
||||
dmu_tx_commit(tx);
|
||||
out:
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4352,7 +4353,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id)
|
||||
uint64_t object, txg;
|
||||
int i;
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
ztest_od_init(od, id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0);
|
||||
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t),
|
||||
@@ -4385,7 +4386,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id)
|
||||
dmu_tx_commit(tx);
|
||||
}
|
||||
out:
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
@@ -4401,11 +4402,11 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id)
|
||||
char name[20], string_value[20];
|
||||
void *data;
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
ztest_od_init(od, ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0);
|
||||
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) {
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4499,7 +4500,7 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id)
|
||||
if (tx != NULL)
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4590,11 +4591,11 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
|
||||
uint64_t old_txg, txg;
|
||||
int i, error = 0;
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0);
|
||||
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) {
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4637,7 +4638,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
|
||||
umem_free(cb_data[i], sizeof (ztest_cb_data_t));
|
||||
}
|
||||
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4709,7 +4710,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
|
||||
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
@@ -4790,11 +4791,12 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
|
||||
|
||||
dmu_objset_name(os, osname);
|
||||
|
||||
(void) snprintf(snapname, sizeof (snapname), "sh1_%llu", (long long unsigned int)id);
|
||||
(void) snprintf(snapname, sizeof (snapname), "sh1_%llu",
|
||||
(u_longlong_t)id);
|
||||
(void) snprintf(fullname, sizeof (fullname), "%s@%s", osname, snapname);
|
||||
(void) snprintf(clonename, sizeof (clonename),
|
||||
"%s/ch1_%llu", osname, (long long unsigned int)id);
|
||||
(void) snprintf(tag, sizeof (tag), "tag_%llu", (long long unsigned int)id);
|
||||
"%s/ch1_%llu", osname, (u_longlong_t)id);
|
||||
(void) snprintf(tag, sizeof (tag), "tag_%llu", (u_longlong_t)id);
|
||||
|
||||
/*
|
||||
* Clean up from any previous run.
|
||||
@@ -5124,11 +5126,11 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
blocksize = ztest_random_blocksize();
|
||||
blocksize = MIN(blocksize, 2048); /* because we write so many */
|
||||
|
||||
od = umem_alloc(sizeof(ztest_od_t), UMEM_NOFAIL);
|
||||
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
|
||||
ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0);
|
||||
|
||||
if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) {
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5143,7 +5145,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_COPIES, 1,
|
||||
B_FALSE) != 0) {
|
||||
(void) rw_exit(&ztest_name_lock);
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5158,7 +5160,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
|
||||
if (txg == 0) {
|
||||
(void) rw_exit(&ztest_name_lock);
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5207,7 +5209,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
|
||||
zio_buf_free(buf, psize);
|
||||
|
||||
(void) rw_exit(&ztest_name_lock);
|
||||
umem_free(od, sizeof(ztest_od_t));
|
||||
umem_free(od, sizeof (ztest_od_t));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5493,7 +5495,7 @@ ztest_resume_thread(void *arg)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
#define GRACE 300
|
||||
#define GRACE 300
|
||||
|
||||
#if 0
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user