Re: EXPORT_SYMBOL(fat_get_block)

From: Greg KH
Date: Tue Aug 17 2010 - 11:05:41 EST


On Mon, Aug 16, 2010 at 06:57:54AM +0800, Nelson Zhang wrote:
> Hi David, Greg,
>
> What I have done so far is following:
>
> 1. Open a file
> 2. Seek to the end of file

That just created a "sparse file"

> What I have not done is:
>
> 3. mmap the whole file.
>
> Without #3, the file is not allocated until I write to the file.

That is by design.

> I think we can try to use mmap to allocate the file but we still need
> a function that can get file block info once the file is allocated.

No, why would you want the file block info?

Just treat it as a file, using mmap() and all the other userspace
goodness that we have to get data to a file very quickly. You don't
need to preallocate the file from userspace, or anything else like that.

I suggest looking at some documentation on how to use the Unix file apis
properly to implement this better.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/