rmustacc commented on this pull request.
> @@ -198,6 +198,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 > sizeof (uintptr_t)) { It might be, but even that is a little questionable. The max we have in the code is 8 and we're not relating that to a type. So I'd probably actually use that and just make a `#define` with a comment that explains its the max size that the targets can write today. As it's really less specific to a type and more specific to what the target allows. -- 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#discussion_r167407506 ------------------------------------------ openzfs-developer Archives: https://openzfs.topicbox.com/groups/developer/discussions/Ta82fe96bb714cae3-M47dbcd7b02256b2841b9b854 Powered by Topicbox: https://topicbox.com