Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-8424 osd-zfs: ZFS macro DN_MAX_BONUSLEN is deprecated
[fs/lustre-release.git]
/
lustre
/
osd-zfs
/
osd_oi.c
diff --git
a/lustre/osd-zfs/osd_oi.c
b/lustre/osd-zfs/osd_oi.c
index
ac2ad46
..
230d103
100644
(file)
--- a/
lustre/osd-zfs/osd_oi.c
+++ b/
lustre/osd-zfs/osd_oi.c
@@
-90,6
+90,7
@@
static const struct named_oid oids[] = {
{ .oid = OFD_HEALTH_CHECK_OID, .name = HEALTH_CHECK },
{ .oid = ACCT_USER_OID, .name = "acct_usr_inode" },
{ .oid = ACCT_GROUP_OID, .name = "acct_grp_inode" },
+ { .oid = ACCT_PROJECT_OID, .name = "acct_prj_inode" },
{ .oid = REPLY_DATA_OID, .name = REPLY_DATA },
{ .oid = 0 }
};
@@
-167,11
+168,11
@@
osd_oi_create(const struct lu_env *env, struct osd_device *o,
return rc;
}
- oid = zap_create_flags(o->od_os, 0, ZAP_FLAG_HASH64,
- DMU_OT_DIRECTORY_CONTENTS,
- 14, /* == ZFS fzap_default_block_shift */
- DN_MAX_INDBLKSHIFT, /* indirect block shift */
-
DMU_OT_SA, DN_MAX_BONUSLEN
, tx);
+ oid =
osd_
zap_create_flags(o->od_os, 0, ZAP_FLAG_HASH64,
+
DMU_OT_DIRECTORY_CONTENTS,
+
14, /* == ZFS fzap_default_block_shift */
+ DN_MAX_INDBLKSHIFT,
+
0
, tx);
rc = -sa_handle_get(o->od_os, oid, NULL, SA_HDL_PRIVATE, &sa_hdl);
if (rc)
@@
-481,6
+482,26
@@
static inline int fid_is_fs_root(const struct lu_fid *fid)
fid_oid(fid) == OSD_FS_ROOT_OID;
}
+static inline int osd_oid(struct osd_device *dev, __u32 local_oid,
+ uint64_t *oid)
+{
+ switch (local_oid) {
+ case ACCT_USER_OID:
+ *oid = dev->od_iusr_oid;
+ return 0;
+ case ACCT_GROUP_OID:
+ *oid = dev->od_igrp_oid;
+ return 0;
+ case ACCT_PROJECT_OID:
+ /* TODO: real oid */
+ CERROR("unsupported quota oid: %#x\n", local_oid);
+ return -ENOTSUPP;
+ }
+
+ LASSERTF(0, "invalid oid: %u for quota type", local_oid);
+ return -ENOTSUPP;
+}
+
int osd_fid_lookup(const struct lu_env *env, struct osd_device *dev,
const struct lu_fid *fid, uint64_t *oid)
{
@@
-494,10
+515,9
@@
int osd_fid_lookup(const struct lu_env *env, struct osd_device *dev,
RETURN(-ENOENT);
if (unlikely(fid_is_acct(fid))) {
- if (fid_oid(fid) == ACCT_USER_OID)
- *oid = dev->od_iusr_oid;
- else
- *oid = dev->od_igrp_oid;
+ rc = osd_oid(dev, fid_oid(fid), oid);
+ if (rc)
+ RETURN(rc);
} else if (unlikely(fid_is_fs_root(fid))) {
*oid = dev->od_root;
} else {