36 lines
1.3 KiB
C
36 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef _NWFS_DIRQUOTA_H_
|
|
#define _NWFS_DIRQUOTA_H_ 1
|
|
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
|
|
#include <public/zXattr.h>
|
|
|
|
/*
|
|
* Directory-quota helpers for the NetWare 3.x-compatible NCP family:
|
|
* decimal 22/35, 22/36, 22/40; wire/code hex 0x23, 0x24, 0x28.
|
|
*
|
|
* This layer owns only the portable quota math and NSS/OES-compatible
|
|
* netware.metadata quota field conversion. The NCP parser remains in
|
|
* mars-nwe, and future namespace-aware 4.x variants stay separate.
|
|
*/
|
|
#define NWFS_DIRQUOTA_NCP_UNLIMITED_4K 0x7fffffffU
|
|
|
|
int nwfs_dirquota_ncp_to_metadata(uint32_t limit4k, SQUAD *quota_limit);
|
|
int nwfs_dirquota_metadata_to_ncp(SQUAD quota_limit, uint32_t *limit4k);
|
|
int nwfs_dirquota_metadata_is_limited(SQUAD quota_limit);
|
|
|
|
uint32_t nwfs_dirquota_used_4k_for_bytes(uint64_t bytes);
|
|
uint32_t nwfs_dirquota_available_4k(uint32_t limit4k, uint32_t used4k);
|
|
int nwfs_dirquota_would_exceed(uint32_t limit4k, uint32_t used4k,
|
|
uint32_t add4k);
|
|
uint32_t nwfs_dirquota_scan_used_4k(const char *path);
|
|
|
|
int nwfs_dirquota_metadata_set_limit(zNW_metadata_s *metadata,
|
|
uint32_t limit4k);
|
|
int nwfs_dirquota_metadata_get_limit(const zNW_metadata_s *metadata,
|
|
uint32_t *limit4k);
|
|
|
|
#endif
|