fs/hostfs: Change all priv_ to priv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
2581c7acef
commit
7f60376d3a
|
@ -58,46 +58,46 @@ struct hostfs_rpmsg_server_s
|
|||
|
||||
static int hostfs_rpmsg_open_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_close_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_read_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_write_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_lseek_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_ioctl_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_sync_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_dup_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_fstat_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_ftruncate_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_opendir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_readdir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_rewinddir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_closedir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_);
|
||||
uint32_t src, FAR void *priv);
|
||||
static int hostfs_rpmsg_statfs_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv);
|
||||
|
@ -316,7 +316,7 @@ static FAR void *hostfs_rpmsg_get_dir(
|
|||
|
||||
static int hostfs_rpmsg_open_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_open_s *msg = data;
|
||||
struct file file;
|
||||
|
@ -325,7 +325,7 @@ static int hostfs_rpmsg_open_handler(FAR struct rpmsg_endpoint *ept,
|
|||
ret = file_open(&file, msg->pathname, msg->flags, msg->mode);
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = hostfs_rpmsg_attach_file(priv_, &file);
|
||||
ret = hostfs_rpmsg_attach_file(priv, &file);
|
||||
if (ret < 0)
|
||||
{
|
||||
file_close(&file);
|
||||
|
@ -338,13 +338,13 @@ static int hostfs_rpmsg_open_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_close_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_close_s *msg = data;
|
||||
struct file file;
|
||||
int ret;
|
||||
|
||||
ret = hostfs_rpmsg_detach_file(priv_, msg->fd, &file);
|
||||
ret = hostfs_rpmsg_detach_file(priv, msg->fd, &file);
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = file_close(&file);
|
||||
|
@ -356,7 +356,7 @@ static int hostfs_rpmsg_close_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_read_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_read_s *msg = data;
|
||||
FAR struct hostfs_rpmsg_read_s *rsp;
|
||||
|
@ -378,7 +378,7 @@ static int hostfs_rpmsg_read_handler(FAR struct rpmsg_endpoint *ept,
|
|||
space = msg->count;
|
||||
}
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_read(filep, rsp->buf, space);
|
||||
|
@ -390,13 +390,13 @@ static int hostfs_rpmsg_read_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_write_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_write_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
int ret = -ENOENT;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_write(filep, msg->buf, msg->count);
|
||||
|
@ -408,13 +408,13 @@ static int hostfs_rpmsg_write_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_lseek_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_lseek_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
int ret = -ENOENT;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_seek(filep, msg->offset, msg->whence);
|
||||
|
@ -426,13 +426,13 @@ static int hostfs_rpmsg_lseek_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_ioctl_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_ioctl_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
int ret = -ENOENT;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_ioctl(filep, msg->request, msg->arg);
|
||||
|
@ -444,13 +444,13 @@ static int hostfs_rpmsg_ioctl_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_sync_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_sync_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
int ret = -ENOENT;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_fsync(filep);
|
||||
|
@ -462,20 +462,20 @@ static int hostfs_rpmsg_sync_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_dup_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_dup_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
struct file newfile;
|
||||
int ret = -ENOENT;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_dup2(filep, &newfile);
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = hostfs_rpmsg_attach_file(priv_, &newfile);
|
||||
ret = hostfs_rpmsg_attach_file(priv, &newfile);
|
||||
if (ret < 0)
|
||||
{
|
||||
file_close(&newfile);
|
||||
|
@ -489,14 +489,14 @@ static int hostfs_rpmsg_dup_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_fstat_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_fstat_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
int ret = -ENOENT;
|
||||
struct stat buf;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_fstat(filep, &buf);
|
||||
|
@ -512,13 +512,13 @@ static int hostfs_rpmsg_fstat_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_ftruncate_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_ftruncate_s *msg = data;
|
||||
FAR struct file *filep;
|
||||
int ret = -ENOENT;
|
||||
|
||||
filep = hostfs_rpmsg_get_file(priv_, msg->fd);
|
||||
filep = hostfs_rpmsg_get_file(priv, msg->fd);
|
||||
if (filep != NULL)
|
||||
{
|
||||
ret = file_truncate(filep, msg->length);
|
||||
|
@ -530,7 +530,7 @@ static int hostfs_rpmsg_ftruncate_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_opendir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_opendir_s *msg = data;
|
||||
FAR void *dir;
|
||||
|
@ -539,7 +539,7 @@ static int hostfs_rpmsg_opendir_handler(FAR struct rpmsg_endpoint *ept,
|
|||
dir = opendir(msg->pathname);
|
||||
if (dir)
|
||||
{
|
||||
ret = hostfs_rpmsg_attach_dir(priv_, dir);
|
||||
ret = hostfs_rpmsg_attach_dir(priv, dir);
|
||||
if (ret < 0)
|
||||
{
|
||||
closedir(dir);
|
||||
|
@ -552,14 +552,14 @@ static int hostfs_rpmsg_opendir_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_readdir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_readdir_s *msg = data;
|
||||
FAR struct dirent *entry;
|
||||
int ret = -ENOENT;
|
||||
FAR void *dir;
|
||||
|
||||
dir = hostfs_rpmsg_get_dir(priv_, msg->fd);
|
||||
dir = hostfs_rpmsg_get_dir(priv, msg->fd);
|
||||
if (dir)
|
||||
{
|
||||
entry = readdir(dir);
|
||||
|
@ -578,13 +578,13 @@ static int hostfs_rpmsg_readdir_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_rewinddir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_rewinddir_s *msg = data;
|
||||
int ret = -ENOENT;
|
||||
FAR void *dir;
|
||||
|
||||
dir = hostfs_rpmsg_get_dir(priv_, msg->fd);
|
||||
dir = hostfs_rpmsg_get_dir(priv, msg->fd);
|
||||
if (dir)
|
||||
{
|
||||
rewinddir(dir);
|
||||
|
@ -597,13 +597,13 @@ static int hostfs_rpmsg_rewinddir_handler(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
static int hostfs_rpmsg_closedir_handler(FAR struct rpmsg_endpoint *ept,
|
||||
FAR void *data, size_t len,
|
||||
uint32_t src, FAR void *priv_)
|
||||
uint32_t src, FAR void *priv)
|
||||
{
|
||||
FAR struct hostfs_rpmsg_closedir_s *msg = data;
|
||||
int ret = -ENOENT;
|
||||
FAR void *dir;
|
||||
|
||||
dir = hostfs_rpmsg_detach_dir(priv_, msg->fd);
|
||||
dir = hostfs_rpmsg_detach_dir(priv, msg->fd);
|
||||
if (dir)
|
||||
{
|
||||
ret = closedir(dir) ? -get_errno() : 0;
|
||||
|
|
Loading…
Reference in New Issue