From: Goswin v. B. <gos...@we...> - 2011-11-19 22:57:52
|
Miklos Szeredi <mi...@sz...> writes: >>>> On Thu, Oct 27, 2011 at 11:03 PM, VenkataRao >>>> <ven...@gm...> wrote: >>>> > Hi, >>>> > >>>> > I'm kind of new to this fuse development and our file-system >>>> > implementation requires the buffer address & file offsets to all read >>>> > & write requests from lib-fuse to be aligned with 512 bytes. > > Following patch should fix the read buffer alignment. Fixing the write > buffer alignment properly would be more involved. For write buffers the buffer needs to be aligned to 512/4K - the size of the header. Unfortunately there is no posix_memalign() equivalent to allocate memory at an offset to alignment. But it isn't that hard (although a bit wastefull) to allocate a bigger buffer and ignore the first X bytes. Alternatively wouldn't it be possible to have 2 buffers, one for the header, one for payload data, and user readv() to fill them both atomically? > You could also try the zero copy interfaces introduced in the latest git > version. I'm not sure it will work with O_DIRECT files though, but that > would definitely be worth fixing. Should work. > Thanks, > Miklos MfG Goswin |