rmustacc commented on this pull request.
> @@ -198,6 +204,100 @@ write_uint64(mdb_tgt_as_t as, mdb_tgt_addr_t addr, > uint64_t n, uint_t rdback) return (addr + sizeof (n)); } +/* + * Writes to objects of size 1, 2, 4, or 8 bytes. The function + * doesn't care if the object is a number or not (e.g. it could + * be a byte array, or a struct) as long as the size of the write + * is one of the aforementioned ones. + */ +static mdb_tgt_addr_t +write_var_uint(mdb_tgt_as_t as, mdb_tgt_addr_t addr, uint64_t val, size_t size, + uint_t rdback) +{ + if (size > MDB_UINT_WRITE_MAXBYTES) { Looking at this again, given that we are checking the size down below and adjusting it based on a uint64_t do we actually need this block here? I just realized given that we'll check the size in the switch statement, it may end up being redundant. But, honestly, it doesn't matter either way. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/openzfs/openzfs/pull/544#pullrequestreview-96594391 ------------------------------------------ openzfs-developer Archives: https://openzfs.topicbox.com/groups/developer/discussions/Ta82fe96bb714cae3-M3440619a9871a4154a7bca7e Powered by Topicbox: https://topicbox.com