mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
move readv/writev to the kernel
currently, nuttx implements readv/writev on the top of read/write. while it might work for the simplest cases, it's broken by design. for example, it's impossible to make it work correctly for files which need to preserve data boundaries without allocating a single contiguous buffer. (udp socket, some character devices, etc) this change is a start of the migration to a better design. that is, implement read/write on the top of readv/writev. to avoid a single huge change, following things will NOT be done in this commit: * fix actual bugs caused by the original readv-based-on-read design. (cf. https://github.com/apache/nuttx/pull/12674) * adapt filesystems/drivers to actually benefit from the new interface. (except a few trivial examples) * eventually retire the old interface. * retire read/write syscalls. implement them in libc instead. * pread/pwrite/preadv/pwritev (except the introduction of struct uio, which is a preparation to back these variations with the new interface.)
This commit is contained in:
committed by
Xiang Xiao
parent
e3d7d23618
commit
761ee81956
@@ -147,7 +147,9 @@ static const struct file_operations g_hif_fops =
|
||||
hif_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
hif_poll /* poll */
|
||||
hif_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, hif_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -80,7 +80,9 @@ const struct file_operations g_bch_fops =
|
||||
bch_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
bch_poll /* poll */
|
||||
bch_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, bch_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -99,7 +99,9 @@ static const struct file_operations g_i2cdrvr_fops =
|
||||
i2cdrvr_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, i2cdrvr_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -134,7 +134,9 @@ static const struct file_operations g_i2cslavefops =
|
||||
NULL, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
i2c_slave_poll /* poll */
|
||||
i2c_slave_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, i2c_slave_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -96,7 +96,9 @@ static const struct file_operations g_i3cdrvr_fops =
|
||||
i3cdrvr_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, i3cdrvr_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -124,7 +124,9 @@ static const struct file_operations g_gt9xx_fileops =
|
||||
NULL, /* ioctl */
|
||||
NULL, /* truncate */
|
||||
NULL, /* mmap */
|
||||
gt9xx_poll /* poll */
|
||||
gt9xx_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, NULL /* unlink */
|
||||
#endif
|
||||
|
||||
+3
-1
@@ -136,7 +136,9 @@ static const struct file_operations g_ft80x_fops =
|
||||
ft80x_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, ft80x_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -119,7 +119,9 @@ static const struct file_operations g_pcf8574_lcd_fops =
|
||||
pcf8574_lcd_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
pcf8574_lcd_poll /* poll */
|
||||
pcf8574_lcd_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, pcf8574_lcd_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -173,7 +173,9 @@ static const struct file_operations g_tda19988_fops =
|
||||
tda19988_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
tda19988_poll /* poll */
|
||||
tda19988_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, tda19988_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
+16
-11
@@ -38,10 +38,10 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
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 ssize_t loop_readv(FAR struct file *filep,
|
||||
FAR const struct uio *uio);
|
||||
static ssize_t loop_writev(FAR struct file *filep,
|
||||
FAR const struct uio *uio);
|
||||
static int loop_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
@@ -53,10 +53,15 @@ static const struct file_operations g_loop_fops =
|
||||
{
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
loop_read, /* read */
|
||||
loop_write, /* write */
|
||||
NULL, /* read */
|
||||
NULL, /* write */
|
||||
NULL, /* seek */
|
||||
loop_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
loop_readv, /* readv */
|
||||
loop_writev /* writev */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -67,8 +72,8 @@ static const struct file_operations g_loop_fops =
|
||||
* Name: loop_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t loop_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
static ssize_t loop_readv(FAR struct file *filep,
|
||||
FAR const struct uio *uio)
|
||||
{
|
||||
return 0; /* Return EOF */
|
||||
}
|
||||
@@ -77,10 +82,10 @@ static ssize_t loop_read(FAR struct file *filep, FAR char *buffer,
|
||||
* Name: loop_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t loop_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len)
|
||||
static ssize_t loop_writev(FAR struct file *filep,
|
||||
FAR const struct uio *uio)
|
||||
{
|
||||
return len; /* Say that everything was written */
|
||||
return uio_total_len(uio); /* Say that everything was written */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+21
-21
@@ -38,10 +38,10 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t devnull_readv(FAR struct file *filep,
|
||||
FAR const struct uio *uio);
|
||||
static ssize_t devnull_writev(FAR struct file *filep,
|
||||
FAR const struct uio *uio);
|
||||
static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
bool setup);
|
||||
|
||||
@@ -51,15 +51,17 @@ static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
|
||||
static const struct file_operations g_devnull_fops =
|
||||
{
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
devnull_read, /* read */
|
||||
devnull_write, /* write */
|
||||
NULL, /* seek */
|
||||
NULL, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
devnull_poll /* poll */
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
NULL, /* read */
|
||||
NULL, /* writev */
|
||||
NULL, /* seek */
|
||||
NULL, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
devnull_poll, /* poll */
|
||||
devnull_readv, /* readv */
|
||||
devnull_writev /* writev */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -70,12 +72,11 @@ static const struct file_operations g_devnull_fops =
|
||||
* Name: devnull_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
static ssize_t devnull_readv(FAR struct file *filep,
|
||||
FAR const struct uio *uio)
|
||||
{
|
||||
UNUSED(filep);
|
||||
UNUSED(buffer);
|
||||
UNUSED(len);
|
||||
UNUSED(uio);
|
||||
|
||||
return 0; /* Return EOF */
|
||||
}
|
||||
@@ -84,13 +85,12 @@ static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
|
||||
* Name: devnull_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len)
|
||||
static ssize_t devnull_writev(FAR struct file *filep,
|
||||
FAR const struct uio *uio)
|
||||
{
|
||||
UNUSED(filep);
|
||||
UNUSED(buffer);
|
||||
|
||||
return len; /* Say that everything was written */
|
||||
return uio_total_len(uio); /* Say that everything was written */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+36
-21
@@ -38,10 +38,10 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devzero_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t devzero_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t devzero_readv(FAR struct file *filep,
|
||||
FAR const struct uio *uio);
|
||||
static ssize_t devzero_writev(FAR struct file *filep,
|
||||
FAR const struct uio *uio);
|
||||
static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
bool setup);
|
||||
|
||||
@@ -51,15 +51,17 @@ static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
|
||||
static const struct file_operations g_devzero_fops =
|
||||
{
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
devzero_read, /* read */
|
||||
devzero_write, /* write */
|
||||
NULL, /* seek */
|
||||
NULL, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
devzero_poll /* poll */
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
NULL, /* read */
|
||||
NULL, /* write */
|
||||
NULL, /* seek */
|
||||
NULL, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
devzero_poll, /* poll */
|
||||
devzero_readv, /* readv */
|
||||
devzero_writev /* writev */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -70,26 +72,39 @@ static const struct file_operations g_devzero_fops =
|
||||
* Name: devzero_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devzero_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
static ssize_t devzero_readv(FAR struct file *filep,
|
||||
FAR const struct uio *uio)
|
||||
{
|
||||
ssize_t total = uio_total_len(uio);
|
||||
FAR const struct iovec *iov = uio->uio_iov;
|
||||
int iovcnt = uio->uio_iovcnt;
|
||||
int i;
|
||||
|
||||
UNUSED(filep);
|
||||
|
||||
memset(buffer, 0, len);
|
||||
return len;
|
||||
if (total < 0)
|
||||
{
|
||||
return total;
|
||||
}
|
||||
|
||||
for (i = 0; i < iovcnt; i++)
|
||||
{
|
||||
memset(iov[i].iov_base, 0, iov[i].iov_len);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: devzero_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devzero_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len)
|
||||
static ssize_t devzero_writev(FAR struct file *filep,
|
||||
FAR const struct uio *uio)
|
||||
{
|
||||
UNUSED(filep);
|
||||
UNUSED(buffer);
|
||||
|
||||
return len;
|
||||
return uio_total_len(uio);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -120,7 +120,9 @@ static const struct file_operations g_uio_ivshmem_fops =
|
||||
NULL, /* ioctl */
|
||||
uio_ivshmem_mmap, /* mmap */
|
||||
NULL, /* truncate */
|
||||
uio_ivshmem_poll /* poll */
|
||||
uio_ivshmem_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, NULL /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -49,7 +49,9 @@ static const struct file_operations g_fifo_fops =
|
||||
pipecommon_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
pipecommon_poll /* poll */
|
||||
pipecommon_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, pipecommon_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -118,7 +118,9 @@ static const struct file_operations g_aht10fops =
|
||||
aht10_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, aht10_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -163,7 +163,9 @@ static const struct file_operations g_hdc1008fops =
|
||||
hdc1008_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, hdc1008_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -184,7 +184,9 @@ static const struct file_operations g_scd30fops =
|
||||
scd30_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, scd30_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -192,7 +192,9 @@ static const struct file_operations g_scd41fops =
|
||||
scd41_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, scd41_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -161,7 +161,9 @@ static const struct file_operations g_sgp30fops =
|
||||
sgp30_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, sgp30_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -133,7 +133,9 @@ static const struct file_operations g_sht21fops =
|
||||
sht21_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, sht21_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -172,7 +172,9 @@ static const struct file_operations g_sht3xfops =
|
||||
sht3x_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, sht3x_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -177,7 +177,9 @@ static const struct file_operations g_sps30fops =
|
||||
sps30_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, sps30_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -136,7 +136,9 @@ static const struct file_operations g_pty_fops =
|
||||
pty_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
pty_poll /* poll */
|
||||
pty_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, pty_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -145,7 +145,9 @@ static const struct file_operations g_serialops =
|
||||
uart_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
uart_poll /* poll */
|
||||
uart_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, uart_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -99,7 +99,9 @@ static const struct file_operations g_spidrvr_fops =
|
||||
spidrvr_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, spidrvr_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -138,7 +138,9 @@ static const struct file_operations g_spislavefops =
|
||||
NULL, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
spi_slave_poll /* poll */
|
||||
spi_slave_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, spi_slave_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -131,7 +131,9 @@ static const struct file_operations g_rtc_fops =
|
||||
rtc_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL /* poll */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
, rtc_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -351,6 +351,8 @@ static const struct file_operations g_capture_fops =
|
||||
capture_mmap, /* mmap */
|
||||
NULL, /* truncate */
|
||||
capture_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
capture_unlink, /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -65,6 +65,8 @@ static const struct file_operations g_v4l2_fops =
|
||||
v4l2_mmap, /* mmap */
|
||||
NULL, /* truncate */
|
||||
v4l2_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
v4l2_unlink, /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -91,6 +91,8 @@ static const struct file_operations g_virtio_rng_ops =
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
NULL, /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -90,6 +90,8 @@ static const struct file_operations g_virtio_rpmb_ops =
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
NULL, /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -112,6 +112,8 @@ const struct mountpt_operations g_binfs_operations =
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
NULL, /* sync */
|
||||
binfs_dup, /* dup */
|
||||
|
||||
@@ -192,6 +192,8 @@ const struct mountpt_operations g_cromfs_operations =
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
NULL, /* sync */
|
||||
cromfs_dup, /* dup */
|
||||
|
||||
@@ -132,6 +132,9 @@ const struct mountpt_operations g_fat_operations =
|
||||
NULL, /* mmap */
|
||||
fat_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
fat_sync, /* sync */
|
||||
fat_dup, /* dup */
|
||||
fat_fstat, /* fstat */
|
||||
|
||||
@@ -148,6 +148,8 @@ const struct mountpt_operations g_hostfs_operations =
|
||||
NULL, /* mmap */
|
||||
hostfs_ftruncate, /* ftruncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
hostfs_sync, /* sync */
|
||||
hostfs_dup, /* dup */
|
||||
|
||||
@@ -170,6 +170,8 @@ const struct mountpt_operations g_littlefs_operations =
|
||||
NULL, /* mmap */
|
||||
littlefs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
littlefs_sync, /* sync */
|
||||
littlefs_dup, /* dup */
|
||||
|
||||
@@ -188,6 +188,8 @@ const struct mountpt_operations g_mnemofs_operations =
|
||||
NULL, /* mmap */
|
||||
mnemofs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
mnemofs_sync, /* sync */
|
||||
mnemofs_dup, /* dup */
|
||||
|
||||
@@ -203,6 +203,8 @@ const struct mountpt_operations g_nfs_operations =
|
||||
NULL, /* mmap */
|
||||
nfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
nfs_sync, /* sync */
|
||||
nfs_dup, /* dup */
|
||||
|
||||
@@ -62,6 +62,8 @@ const struct mountpt_operations g_nxffs_operations =
|
||||
NULL, /* truncate */
|
||||
#endif
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
NULL, /* sync -- No buffered data */
|
||||
nxffs_dup, /* dup */
|
||||
|
||||
@@ -287,6 +287,8 @@ const struct mountpt_operations g_procfs_operations =
|
||||
NULL, /* mmap */
|
||||
NULL, /* truncate */
|
||||
procfs_poll, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
NULL, /* sync */
|
||||
procfs_dup, /* dup */
|
||||
|
||||
@@ -125,6 +125,8 @@ const struct mountpt_operations g_romfs_operations =
|
||||
romfs_mmap, /* mmap */
|
||||
NULL, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
NULL, /* sync */
|
||||
romfs_dup, /* dup */
|
||||
|
||||
@@ -165,6 +165,8 @@ const struct mountpt_operations g_rpmsgfs_operations =
|
||||
NULL, /* mmap */
|
||||
rpmsgfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
rpmsgfs_sync, /* sync */
|
||||
rpmsgfs_dup, /* dup */
|
||||
|
||||
@@ -74,6 +74,8 @@ const struct file_operations g_shmfs_operations =
|
||||
shmfs_mmap, /* mmap */
|
||||
shmfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
shmfs_unlink /* unlink */
|
||||
#endif
|
||||
|
||||
@@ -145,6 +145,8 @@ const struct mountpt_operations g_smartfs_operations =
|
||||
NULL, /* mmap */
|
||||
smartfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
smartfs_sync, /* sync */
|
||||
smartfs_dup, /* dup */
|
||||
|
||||
@@ -145,6 +145,8 @@ const struct mountpt_operations g_spiffs_operations =
|
||||
NULL, /* mmap */
|
||||
spiffs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
spiffs_sync, /* sync */
|
||||
spiffs_dup, /* dup */
|
||||
|
||||
@@ -187,6 +187,8 @@ const struct mountpt_operations g_tmpfs_operations =
|
||||
tmpfs_mmap, /* mmap */
|
||||
tmpfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
tmpfs_sync, /* sync */
|
||||
tmpfs_dup, /* dup */
|
||||
|
||||
@@ -230,7 +230,9 @@ const struct mountpt_operations g_unionfs_operations =
|
||||
unionfs_ioctl, /* ioctl */
|
||||
NULL, /* mmap */
|
||||
unionfs_truncate, /* truncate */
|
||||
NULL, /* pool */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
unionfs_sync, /* sync */
|
||||
unionfs_dup, /* dup */
|
||||
|
||||
@@ -165,6 +165,8 @@ const struct mountpt_operations g_userfs_operations =
|
||||
NULL, /* mmap */
|
||||
userfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
userfs_sync, /* sync */
|
||||
userfs_dup, /* dup */
|
||||
|
||||
@@ -126,6 +126,8 @@ const struct mountpt_operations g_v9fs_operations =
|
||||
NULL, /* mmap */
|
||||
v9fs_vfs_truncate, /* truncate */
|
||||
NULL, /* poll */
|
||||
NULL, /* readv */
|
||||
NULL, /* writev */
|
||||
|
||||
v9fs_vfs_sync, /* sync */
|
||||
v9fs_vfs_dup, /* dup */
|
||||
|
||||
@@ -42,6 +42,7 @@ set(SRCS
|
||||
fs_stat.c
|
||||
fs_sendfile.c
|
||||
fs_statfs.c
|
||||
fs_uio.c
|
||||
fs_unlink.c
|
||||
fs_write.c
|
||||
fs_dir.c
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user