mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
drivers/iovec: revert vector io implement from loop/null/zero driver
basic driver does not need such complex wrapper Signed-off-by: chao an <anchao.archer@bytedance.com>
This commit is contained in:
+15
-16
@@ -40,8 +40,10 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t loop_readv(FAR struct file *filep, FAR struct uio *uio);
|
||||
static ssize_t loop_writev(FAR struct file *filep, FAR struct uio *uio);
|
||||
static ssize_t loop_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t loop_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
static int loop_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
@@ -53,15 +55,15 @@ static const struct file_operations g_loop_fops =
|
||||
{
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
NULL, /* read */
|
||||
NULL, /* write */
|
||||
loop_read, /* read */
|
||||
loop_write, /* write */
|
||||
NULL, /* seek */
|
||||
loop_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
loop_readv, /* readv */
|
||||
loop_writev /* writev */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -69,26 +71,23 @@ static const struct file_operations g_loop_fops =
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: loop_readv
|
||||
* Name: loop_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t loop_readv(FAR struct file *filep, FAR struct uio *uio)
|
||||
static ssize_t loop_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
return 0; /* Return EOF */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: loop_writev
|
||||
* Name: loop_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t loop_writev(FAR struct file *filep, FAR struct uio *uio)
|
||||
static ssize_t loop_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
/* Say that everything was written */
|
||||
|
||||
size_t ret = uio->uio_resid;
|
||||
|
||||
uio_advance(uio, ret);
|
||||
return ret;
|
||||
return len; /* Say that everything was written */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user