←back to thread

129 points ozgrakkurt | 1 comments | | HN request time: 0s | source
Show context
database64128 ◴[] No.45155611[source]
I see you use a hard-coded constant ALIGN = 512. Many NVMe drives actually allow you to raise the logical block size to 4096 by re-formatting (nvme-format(1)) the drive.
replies(2): >>45155982 #>>45163274 #
1. ozgrakkurt ◴[] No.45163274[source]
I realise this and also implemented it properly here before: https://github.com/steelcake/io2/blob/fd8b3d13621256a25637e3...

Just opted to use fixed 512 byte alignment in this library since all decent SSDs I have encountered so far are ok with 512 byte file alignment and 64 byte memory alignment.

This makes the code a bit simpler both in terms of the allocator and the file operations.