mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Relocate common quota functions to shared code
The quota functions are common to all implementations and can be moved to common code. As a simplification they were moved to the Linux platform code in the initial refactoring. Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9710
This commit is contained in:
committed by
Brian Behlendorf
parent
4bc721965f
commit
957c7aa23c
@@ -772,4 +772,24 @@ zfs_fuid_txhold(zfsvfs_t *zfsvfs, dmu_tx_t *tx)
|
||||
FUID_SIZE_ESTIMATE(zfsvfs));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* buf must be big enough (eg, 32 bytes)
|
||||
*/
|
||||
int
|
||||
zfs_id_to_fuidstr(zfsvfs_t *zfsvfs, const char *domain, uid_t rid,
|
||||
char *buf, boolean_t addok)
|
||||
{
|
||||
uint64_t fuid;
|
||||
int domainid = 0;
|
||||
|
||||
if (domain && domain[0]) {
|
||||
domainid = zfs_fuid_find_by_domain(zfsvfs, domain, NULL, addok);
|
||||
if (domainid == -1)
|
||||
return (SET_ERROR(ENOENT));
|
||||
}
|
||||
fuid = FUID_ENCODE(domainid, rid);
|
||||
(void) sprintf(buf, "%llx", (longlong_t)fuid);
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user