Implement defaultuserquota/defaultgroupquota on FreeBSD

Signed-off-by: Todd Seidelmann <seidelma@wharton.upenn.edu>
This commit is contained in:
Todd Seidelmann 2024-08-09 09:25:05 -07:00
parent 91b5c4488e
commit 88891656c2
2 changed files with 18 additions and 0 deletions

View File

@ -113,6 +113,8 @@ struct zfsvfs {
uint64_t z_groupobjquota_obj; uint64_t z_groupobjquota_obj;
uint64_t z_projectquota_obj; uint64_t z_projectquota_obj;
uint64_t z_projectobjquota_obj; uint64_t z_projectobjquota_obj;
uint64_t z_defaultuserquota_obj;
uint64_t z_defaultgroupquota_obj;
uint64_t z_replay_eof; /* New end of file - replay only */ uint64_t z_replay_eof; /* New end of file - replay only */
sa_attr_type_t *z_attr_table; /* SA attr mapping->id */ sa_attr_type_t *z_attr_table; /* SA attr mapping->id */
#define ZFS_OBJ_MTX_SZ 64 #define ZFS_OBJ_MTX_SZ 64

View File

@ -924,6 +924,22 @@ zfsvfs_init(zfsvfs_t *zfsvfs, objset_t *os)
else if (error != 0) else if (error != 0)
return (error); return (error);
error = zap_lookup(os, MASTER_NODE_OBJ,
zfs_prop_to_name(ZFS_PROP_DEFAULTUSERQUOTA),
8, 1, &zfsvfs->z_defaultuserquota_obj);
if (error == ENOENT)
zfsvfs->z_defaultuserquota_obj = 0;
else if (error != 0)
return (error);
error = zap_lookup(os, MASTER_NODE_OBJ,
zfs_prop_to_name(ZFS_PROP_DEFAULTGROUPQUOTA),
8, 1, &zfsvfs->z_defaultgroupquota_obj);
if (error == ENOENT)
zfsvfs->z_defaultgroupquota_obj = 0;
else if (error != 0)
return (error);
error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, 8, 1, error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, 8, 1,
&zfsvfs->z_fuid_obj); &zfsvfs->z_fuid_obj);
if (error == ENOENT) if (error == ENOENT)