aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dnode.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2017-08-29 09:00:28 -0700
committerBrian Behlendorf <[email protected]>2017-08-29 09:00:28 -0700
commit1e0457e7f5384b0328ea499083120dd191d80c90 (patch)
treebfec0cf6d82ae4d14c670350c25989958f004d13 /module/zfs/dnode.c
parent2209e40981e887c773914ec0f3b73cedf45ddb7d (diff)
Enhance comments for large dnode project
Fix a few nits in the comments from large dnodes. Also import some of the commit message as a comment in the code, making it more accessible. Reviewed-by: @rottegift Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Matt Ahrens <[email protected]> Closes #6551
Diffstat (limited to 'module/zfs/dnode.c')
-rw-r--r--module/zfs/dnode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index 9942d6427..8b3ec3aab 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -1176,6 +1176,18 @@ dnode_rele_slots(dnode_children_t *children, int idx, int slots)
}
/*
+ * When the DNODE_MUST_BE_FREE flag is set, the "slots" parameter is used
+ * to ensure the hole at the specified object offset is large enough to
+ * hold the dnode being created. The slots parameter is also used to ensure
+ * a dnode does not span multiple dnode blocks. In both of these cases, if
+ * a failure occurs, ENOSPC is returned. Keep in mind, these failure cases
+ * are only possible when using DNODE_MUST_BE_FREE.
+ *
+ * If the DNODE_MUST_BE_ALLOCATED flag is set, "slots" must be 0.
+ * dnode_hold_impl() will check if the requested dnode is already consumed
+ * as an extra dnode slot by an large dnode, in which case it returns
+ * ENOENT.
+ *
* errors:
* EINVAL - invalid object number.
* ENOSPC - hole too small to fulfill "slots" request