[Ocfs2-tools-devel] [Ocfs2-test-devel] [PATCH 2/6] New set of inline-data testing tools:Add single-node testing binary for regular file
Tao Ma
tao.ma at oracle.com
Sun Aug 31 23:30:20 PDT 2008
tristan.ye wrote:
> On Mon, 2008-09-01 at 13:41 +0800, Tao Ma wrote:
>> Hi tristan,
>> Thanks for your patch.
>
>>> +static int mmap_write_at(int fd, const char *buf, size_t count, off_t
>>> offset)
>>> +{
>>> + unsigned int mmap_size = page_size;
>>> + unsigned int size = count + offset;
>>> + int i, j, ret;
>>> + char *region;
>>> +
>>> + while (mmap_size < size)
>>> + mmap_size += page_size;
>> what's this? you want to align mmap_size to page_size and larger than size?
>> how about mmap_size = (size + page_size - 1) & ~(page_size - 1)?
>
> That's exactly all what i've copied from original
> version(inline-data.c),which maybe written by mark, and i saw no hurts
> for us to extend the scope of mmap maped region to make it page_size
> aligned.
aha, so you remind me of the existence of inline-data.c. ;)
So could you please abstract all these functions( which you copied form
inline-data.c like mmap_write_at etc) to another file? We really should
not have the same function show up here and there. One is good and enough.
Regards,
Tao
More information about the Ocfs2-tools-devel
mailing list