]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/ptvar.h
xfs_scrub: thread-safe stats counter
[thirdparty/xfsprogs-dev.git] / include / ptvar.h
1 /*
2 * Copyright (C) 2018 Oracle. All Rights Reserved.
3 *
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it would be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 #ifndef LIBFROG_PERCPU_H_
21 #define LIBFROG_PERCPU_H_
22
23 struct ptvar;
24
25 typedef bool (*ptvar_iter_fn)(struct ptvar *ptv, void *data, void *foreach_arg);
26
27 struct ptvar *ptvar_init(size_t nr, size_t size);
28 void ptvar_free(struct ptvar *ptv);
29 void *ptvar_get(struct ptvar *ptv);
30 bool ptvar_foreach(struct ptvar *ptv, ptvar_iter_fn fn, void *foreach_arg);
31
32 #endif /* LIBFROG_PERCPU_H_ */