lkml.org 
[lkml]   [2003]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectHow to use sendfile with a char device driver's file descriptor
Date

I have a device driver which has to sent a data through network. Currently
the driver's buffer is mmaped to the user mode program which uses the
standard socket sent() call.

To improve the performance and reduce CPU overhead, I tried using sendfile()
Call. But it failed with EINVAL.

Browsing thru the mm/filemap.c, I found the driver has to provide a readpage
functions in address_space_operations. So I added it.

Now the sendfile() does not fail, but it returns with 0 bytes sent. Also my
function readpage is never called.

How can I use sendfile() with my driver? Is there any documentation
available on how to add address_space_operations to a driver, so that
sendfile can be used.

Any help will be appreciated

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

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:1.287 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site