Lines Matching +full:cs +full:- +full:number
1 // SPDX-License-Identifier: GPL-2.0
28 void print_cachestat(struct cachestat *cs) in print_cachestat() argument
32 cs->nr_cache, cs->nr_dirty, cs->nr_writeback, in print_cachestat()
33 cs->nr_evicted, cs->nr_recently_evicted); in print_cachestat()
68 remained -= read_len; in write_exactly()
84 remained -= write_len; in write_exactly()
115 * If test_fsync == true, fsync the file, then check the number of dirty
126 struct cachestat cs; in test_cachestat() local
131 if (fd == -1) { in test_cachestat()
147 syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); in test_cachestat()
152 ksft_print_msg("Cachestat returned non-zero.\n"); in test_cachestat()
157 print_cachestat(&cs); in test_cachestat()
160 if (cs.nr_cache + cs.nr_evicted != num_pages) { in test_cachestat()
162 "Total number of cached and evicted pages is off.\n"); in test_cachestat()
175 syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); in test_cachestat()
181 print_cachestat(&cs); in test_cachestat()
183 if (cs.nr_dirty) { in test_cachestat()
186 "Number of dirty should be zero after fsync.\n"); in test_cachestat()
189 ksft_print_msg("Cachestat (after fsync) returned non-zero.\n"); in test_cachestat()
213 struct cachestat cs; in test_cachestat_shmem() local
236 syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); in test_cachestat_shmem()
239 ksft_print_msg("Cachestat returned non-zero.\n"); in test_cachestat_shmem()
243 print_cachestat(&cs); in test_cachestat_shmem()
244 if (cs.nr_cache + cs.nr_evicted != num_pages) { in test_cachestat_shmem()
246 "Total number of cached and evicted pages is off.\n"); in test_cachestat_shmem()
263 ret = syscall(__NR_cachestat, -1, NULL, NULL, 0); in main()
264 if (ret == -1 && errno == ENOSYS) in main()
269 if (ret == -1 && errno == EBADF) { in main()