lnet_kiov_t *src, *dest;
struct timespec begin, end, diff;
int niov;
+ int rc = 0;
int i = 0, j = 0, n;
__u16 cksum, cksum2;
__u64 mbytes;
if (src == NULL || dest == NULL) {
CERROR("couldn't allocate iovs\n");
- GOTO(unwind, -ENOMEM);
+ GOTO(unwind, rc = -ENOMEM);
}
for (i = 0; i < LNET_MAX_IOV; i++) {
if (src[i].kiov_page == NULL) {
CERROR("couldn't allocate page %d\n", i);
- GOTO(unwind, -ENOMEM);
+ GOTO(unwind, rc = -ENOMEM);
}
dest[i].kiov_offset = 0;
if (dest[i].kiov_page == NULL) {
CERROR("couldn't allocate page %d\n", i);
- GOTO(unwind, -ENOMEM);
+ GOTO(unwind, rc = -ENOMEM);
}
}
if (niov > LNET_MAX_IOV) {
CERROR("bytes %d too large, requires niov %d > %d\n",
nob, niov, LNET_MAX_IOV);
- GOTO(unwind, -E2BIG);
+ GOTO(unwind, rc = -E2BIG);
}
/* setup real data */
if (cksum != cksum2) {
CERROR("case %d loop %d different checksums %x expected %x\n",
j, n, cksum2, cksum);
- GOTO(unwind, -ENOKEY);
+ GOTO(unwind, rc = -ENOKEY);
}
}
LIBCFS_FREE(src, LNET_MAX_IOV * sizeof(lnet_kiov_t));
if (dest != NULL)
LIBCFS_FREE(dest, LNET_MAX_IOV * sizeof(lnet_kiov_t));
- return 0;
+ return rc;
}
static int
char dummy[256 + 1] = { '\0' };
int testno, nloops, nbytes;
int rc;
+ ENTRY;
if (kgnilnd_data.kgn_init < GNILND_INIT_ALL) {
CERROR("can't run cksum test, kgnilnd is not initialized yet\n");
- return -ENOSYS;
+ RETURN(-ENOSYS);
}
if (count >= sizeof(dummy) || count == 0)
- return -EINVAL;
+ RETURN(-EINVAL);
if (copy_from_user(dummy, ubuffer, count))
- return -EFAULT;
+ RETURN(-EFAULT);
if (sscanf(dummy, "%d:%d:%d", &testno, &nloops, &nbytes) == 3) {
rc = _kgnilnd_proc_run_cksum_test(testno, nloops, nbytes);
pde = create_proc_entry(GNILND_PROC_CKSUM_TEST, 0200, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_CKSUM_TEST);
- rc = -ENOENT;
- GOTO(remove_dir, rc);
+ GOTO(remove_dir, rc = -ENOENT);
}
pde->data = NULL;
pde = create_proc_entry(GNILND_PROC_STATS, 0644, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_STATS);
- rc = -ENOENT;
- GOTO(remove_test, rc);
+ GOTO(remove_test, rc = -ENOENT);
}
pde->data = NULL;
pde = create_proc_entry(GNILND_PROC_MDD, 0444, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_MDD);
- rc = -ENOENT;
- GOTO(remove_stats, rc);
+ GOTO(remove_stats, rc = -ENOENT);
}
pde->data = NULL;
pde = create_proc_entry(GNILND_PROC_SMSG, 0444, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_SMSG);
- rc = -ENOENT;
- GOTO(remove_mdd, rc);
+ GOTO(remove_mdd, rc = -ENOENT);
}
pde->data = NULL;
pde = create_proc_entry(GNILND_PROC_CONN, 0444, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_CONN);
- rc = -ENOENT;
- GOTO(remove_smsg, rc);
+ GOTO(remove_smsg, rc = -ENOENT);
}
pde->data = NULL;
pde = create_proc_entry(GNILND_PROC_PEER_CONNS, 0644, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_PEER_CONNS);
- rc = -ENOENT;
- GOTO(remove_conn, rc);
+ GOTO(remove_conn, rc = -ENOENT);
}
pde->data = NULL;
pde = create_proc_entry(GNILND_PROC_PEER, 0444, kgn_proc_root);
if (pde == NULL) {
CERROR("couldn't create proc entry %s\n", GNILND_PROC_PEER);
- rc = -ENOENT;
- GOTO(remove_pc, rc);
+ GOTO(remove_pc, rc = -ENOENT);
}
pde->data = NULL;