mkuzip.c (5cbe126a6d5ae0019a518bea2f60c61f0ff546f8) mkuzip.c (0ce59aa848470e6e5060b9c2b47fce7888546547)
1/*
2 * Copyright (c) 2004-2016 Maxim Sobolev <sobomax@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 94 unchanged lines hidden (view full) ---

103 } summary;
104 struct iovec iov[2];
105 struct stat sb;
106 uint64_t offset, last_offset;
107 struct cloop_header hdr;
108 struct mkuz_conveyor *cvp;
109 void *c_ctx;
110 struct mkuz_blk_info *chit;
1/*
2 * Copyright (c) 2004-2016 Maxim Sobolev <sobomax@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 94 unchanged lines hidden (view full) ---

103 } summary;
104 struct iovec iov[2];
105 struct stat sb;
106 uint64_t offset, last_offset;
107 struct cloop_header hdr;
108 struct mkuz_conveyor *cvp;
109 void *c_ctx;
110 struct mkuz_blk_info *chit;
111 size_t ncpusz, ncpu;
111 size_t ncpusz, ncpu, magiclen;
112 double st, et;
113
114 st = getdtime();
115
116 ncpusz = sizeof(size_t);
117 if (sysctlbyname("hw.ncpu", &ncpu, &ncpusz, NULL, 0) < 0) {
118 ncpu = 1;
119 } else if (ncpu > MAX_WORKERS_AUTO) {

--- 67 unchanged lines hidden (view full) ---

187 argc -= optind;
188 argv += optind;
189
190 if (argc != 1) {
191 usage();
192 /* Not reached */
193 }
194
112 double st, et;
113
114 st = getdtime();
115
116 ncpusz = sizeof(size_t);
117 if (sysctlbyname("hw.ncpu", &ncpu, &ncpusz, NULL, 0) < 0) {
118 ncpu = 1;
119 } else if (ncpu > MAX_WORKERS_AUTO) {

--- 67 unchanged lines hidden (view full) ---

187 argc -= optind;
188 argv += optind;
189
190 if (argc != 1) {
191 usage();
192 /* Not reached */
193 }
194
195 assert(strlcpy(hdr.magic, cfs.handler->magic, sizeof(hdr.magic))
196 < sizeof(hdr.magic));
195 magiclen = strlcpy(hdr.magic, cfs.handler->magic, sizeof(hdr.magic));
196 assert(magiclen < sizeof(hdr.magic));
197
198 if (cfs.en_dedup != 0) {
199 hdr.magic[CLOOP_OFS_VERSN] = CLOOP_MAJVER_3;
200 hdr.magic[CLOOP_OFS_COMPR] =
201 tolower(hdr.magic[CLOOP_OFS_COMPR]);
202 }
203
204 c_ctx = cfs.handler->f_init(cfs.blksz);

--- 251 unchanged lines hidden ---
197
198 if (cfs.en_dedup != 0) {
199 hdr.magic[CLOOP_OFS_VERSN] = CLOOP_MAJVER_3;
200 hdr.magic[CLOOP_OFS_COMPR] =
201 tolower(hdr.magic[CLOOP_OFS_COMPR]);
202 }
203
204 c_ctx = cfs.handler->f_init(cfs.blksz);

--- 251 unchanged lines hidden ---