RE: EXPORT_SYMBOL(fat_get_block)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nelson Zhang
Date: Sunday, August 15, 2010 - 3:57 pm

Hi David, Greg,

What I have done so far is following:

1. Open a file 
2. Seek to the end of 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. 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.

Thanks,
Nelson


-----Original Message-----
From: Greg KH [mailto:gregkh@suse.de] 
Sent: Saturday, August 14, 2010 11:04 AM
To: David Cross
Cc: hirofumi@mail.parknet.co.jp; linux-kernel@vger.kernel.org;
nxz@cypress.com
Subject: Re: EXPORT_SYMBOL(fat_get_block)

On Fri, Aug 13, 2010 at 06:12:43PM -0700, David Cross wrote:
userspace,
the
the

It's ok, you don't have to do it right now, I'm just curious as to how
much speed difference you are seeing here.

As it will be a few weeks before I can even get this into the -next
tree, it's not of upmost importance at the moment.

stack
peripheral
this is
agree
away,
data

Well, if you zero out everything on a mmapped file and then close it, it
should.  But you might just be creating a "sparse" file, so you need to
be careful about that as well.

What I mean to do about mmap is just that is the way your userspace
program can write to the file, not as a stream.  That is much faster and
causes less I/O to the device (well, it should.)  Does that make more
sense?


Sorry, I don't mean this to come off that way at all, my appologies.

I'm just very curious as this is the first time something like this has
been proposed that I know of, so generally either the design is wrong,
or it is such a unique situation that no one has ever hit this before.

So far, I'm leaning toward the "design is a bit incorrect" :)

But again, let's take this one thing at a time.  Let's get the driver
into the tree, with that one ioctl commented out.  We can then work on
cleaning it all up and figuring out the logic of where it all goes in
the tree, and what it looks like in the end after the refactoring.
During that time, we will have plenty of time to discuss why the
previous attempts ended up with zeros in the file.

Sound good?

them
block
to.
removable

My cell phone hooks up to a USB powered hard drive at the moment :)
It can also drive a monitor through the usb connection, you would be
amazed what you can do with these things these days.

fast
out
block
userspace,

Possibly, if those memory copies take a lot of time.

How are all of the other platforms that use Linux as this type of
device, or even a usb-storage device (of which there are lots) able to
hit the very fast transfer rates that I have seen so far without needing
to do this type of preallocation?


Yes.


No, the driver never knows this type of information.  And for good
reason, you could have 4 different partitions on this block device, all
different filesystems.  The block driver should never care about the
filesystem underneath it.

thanks,

greg k-h


---------------------------------------------------------------
This message and any attachments may contain Cypress (or its
subsidiaries) confidential information. If it has been received
in error, please advise the sender and immediately delete this
message.
---------------------------------------------------------------

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 10:45 am)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 10:54 am)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 10:54 am)
Re: EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 11:43 am)
Re: EXPORT_SYMBOL(fat_get_block), Christoph Hellwig, (Fri Aug 13, 11:50 am)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 12:01 pm)
Re: EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 12:06 pm)
Re: EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 12:17 pm)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 12:28 pm)
Re: EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 1:32 pm)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 3:17 pm)
Re: EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 4:22 pm)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 5:25 pm)
Re: EXPORT_SYMBOL(fat_get_block), David Cross, (Fri Aug 13, 6:12 pm)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Fri Aug 13, 8:04 pm)
RE: EXPORT_SYMBOL(fat_get_block), Nelson Zhang, (Sun Aug 15, 3:57 pm)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Tue Aug 17, 7:54 am)
Re: EXPORT_SYMBOL(fat_get_block), Christoph Hellwig, (Tue Aug 17, 8:40 am)
Re: EXPORT_SYMBOL(fat_get_block), Greg KH, (Tue Aug 17, 8:54 am)