Lines Matching +full:close +full:- +full:range

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
36 #include <atf-c.h>
52 if (fstat(fd, &statbuf) == -1) in fill()
67 len -= blen; in fill()
80 if (statfs(".", &statfsbuf) == -1) in fd_get_blksize()
81 return (-1); in fd_get_blksize()
96 if (blocksize == -1) in check_content_dealloc()
107 hole_len = file_sz - hole_start; in check_content_dealloc()
124 resid -= blen; in check_content_dealloc()
145 resid -= blen; in check_content_dealloc()
153 resid = file_sz - offset; in check_content_dealloc()
164 resid -= blen; in check_content_dealloc()
171 if (fstat(fd, &statbuf) == -1) in check_content_dealloc()
172 error = -1; in check_content_dealloc()
174 error = -1; in check_content_dealloc()
186 struct spacectl_range range; in ATF_TC_BODY() local
191 ATF_REQUIRE((blocksize = fd_get_blksize()) != -1); in ATF_TC_BODY()
192 range.r_offset = offset = blocksize; in ATF_TC_BODY()
193 range.r_len = length = (file_max_blocks - 1) * blocksize - in ATF_TC_BODY()
194 range.r_offset; in ATF_TC_BODY()
197 O_CREAT | O_RDWR | O_TRUNC, 0600)) != -1); in ATF_TC_BODY()
199 ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0); in ATF_TC_BODY()
202 ATF_REQUIRE(close(fd) == 0); in ATF_TC_BODY()
211 struct spacectl_range range; in ATF_TC_BODY() local
216 ATF_REQUIRE((blocksize = fd_get_blksize()) != -1); in ATF_TC_BODY()
217 range.r_offset = offset = blocksize / 2; in ATF_TC_BODY()
218 range.r_len = length = (file_max_blocks - 1) * blocksize + in ATF_TC_BODY()
219 blocksize / 2 - offset; in ATF_TC_BODY()
222 O_CREAT | O_RDWR | O_TRUNC, 0600)) != -1); in ATF_TC_BODY()
224 ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0); in ATF_TC_BODY()
227 ATF_REQUIRE(close(fd) == 0); in ATF_TC_BODY()
236 struct spacectl_range range; in ATF_TC_BODY() local
241 ATF_REQUIRE((blocksize = fd_get_blksize()) != -1); in ATF_TC_BODY()
242 range.r_offset = offset = blocksize; in ATF_TC_BODY()
243 range.r_len = length = OFF_MAX - offset; in ATF_TC_BODY()
246 O_CREAT | O_RDWR | O_TRUNC, 0600)) != -1); in ATF_TC_BODY()
248 ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0); in ATF_TC_BODY()
251 ATF_REQUIRE(close(fd) == 0); in ATF_TC_BODY()
260 struct spacectl_range range; in ATF_TC_BODY() local
265 ATF_REQUIRE((blocksize = fd_get_blksize()) != -1); in ATF_TC_BODY()
266 range.r_offset = offset = blocksize / 2; in ATF_TC_BODY()
267 range.r_len = length = OFF_MAX - offset; in ATF_TC_BODY()
270 O_CREAT | O_RDWR | O_TRUNC, 0600)) != -1); in ATF_TC_BODY()
272 ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0); in ATF_TC_BODY()
275 ATF_REQUIRE(close(fd) == 0); in ATF_TC_BODY()
284 struct spacectl_range range; in ATF_TC_BODY() local
289 ATF_REQUIRE((blocksize = fd_get_blksize()) != -1); in ATF_TC_BODY()
290 range.r_offset = offset = blocksize; in ATF_TC_BODY()
291 range.r_len = length = (file_max_blocks + 1) * blocksize - in ATF_TC_BODY()
292 range.r_offset; in ATF_TC_BODY()
295 O_CREAT | O_RDWR | O_TRUNC, 0600)) != -1); in ATF_TC_BODY()
297 ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0); in ATF_TC_BODY()
300 ATF_REQUIRE(close(fd) == 0); in ATF_TC_BODY()
309 struct spacectl_range range; in ATF_TC_BODY() local
314 ATF_REQUIRE((blocksize = fd_get_blksize()) != -1); in ATF_TC_BODY()
315 range.r_offset = offset = blocksize / 2; in ATF_TC_BODY()
316 range.r_len = length = file_max_blocks * blocksize + blocksize / 2 - in ATF_TC_BODY()
317 range.r_offset; in ATF_TC_BODY()
320 O_CREAT | O_RDWR | O_TRUNC, 0600)) != -1); in ATF_TC_BODY()
322 ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0); in ATF_TC_BODY()
325 ATF_REQUIRE(close(fd) == 0); in ATF_TC_BODY()