xref: /freebsd/sys/contrib/openzfs/include/sys/zfs_quota.h (revision 071ab5a1f3cbfd29c8fbec27f7e619418adaf074)
1 // SPDX-License-Identifier: CDDL-1.0
2 /*
3  * CDDL HEADER START
4  *
5  * The contents of this file are subject to the terms of the
6  * Common Development and Distribution License (the "License").
7  * You may not use this file except in compliance with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or https://opensource.org/licenses/CDDL-1.0.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 
23 #ifndef _SYS_ZFS_QUOTA_H
24 #define	_SYS_ZFS_QUOTA_H
25 
26 #include <sys/dmu.h>
27 #include <sys/fs/zfs.h>
28 
29 struct zfsvfs;
30 struct zfs_file_info_t;
31 
32 extern int zpl_get_file_info(dmu_object_type_t,
33     const void *, struct zfs_file_info *);
34 
35 extern int zfs_userspace_one(struct zfsvfs *, zfs_userquota_prop_t,
36     const char *, uint64_t, uint64_t *);
37 extern int zfs_userspace_many(struct zfsvfs *, zfs_userquota_prop_t,
38     uint64_t *, void *, uint64_t *, uint64_t *);
39 extern int zfs_set_userquota(struct zfsvfs *, zfs_userquota_prop_t,
40     const char *, uint64_t, uint64_t);
41 
42 extern boolean_t zfs_id_overobjquota(struct zfsvfs *, uint64_t, uint64_t);
43 extern boolean_t zfs_id_overblockquota(struct zfsvfs *, uint64_t, uint64_t);
44 extern boolean_t zfs_id_overquota(struct zfsvfs *, uint64_t, uint64_t);
45 
46 #endif
47