fs: Remove the unused nx_[v]ioctl to prefer file_[v]ioctl for kernel

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-10-26 13:40:18 +08:00 committed by Petro Karashchenko
parent 06d0dbc927
commit aa31648c9f
2 changed files with 16 additions and 78 deletions

View file

@ -128,28 +128,6 @@ int file_vioctl(FAR struct file *filep, int req, va_list ap)
return ret;
}
/****************************************************************************
* Name: nx_vioctl
****************************************************************************/
static int nx_vioctl(int fd, int req, va_list ap)
{
FAR struct file *filep;
int ret;
/* Get the file structure corresponding to the file descriptor. */
ret = fs_getfilep(fd, &filep);
if (ret < 0)
{
return ret;
}
/* Let file_vioctl() do the real work. */
return file_vioctl(filep, req, ap);
}
/****************************************************************************
* Public Functions
****************************************************************************/
@ -186,37 +164,6 @@ int file_ioctl(FAR struct file *filep, int req, ...)
return ret;
}
/****************************************************************************
* Name: nx_ioctl
*
* Description:
* nx_ioctl() is similar to the standard 'ioctl' interface except that is
* not a cancellation point and it does not modify the errno variable.
*
* nx_ioctl() is an internal NuttX interface and should not be called from
* applications.
*
* Returned Value:
* Returns a non-negative number on success; A negated errno value is
* returned on any failure (see comments ioctl() for a list of appropriate
* errno values).
*
****************************************************************************/
int nx_ioctl(int fd, int req, ...)
{
va_list ap;
int ret;
/* Let nx_vioctl() do the real work. */
va_start(ap, req);
ret = nx_vioctl(fd, req, ap);
va_end(ap);
return ret;
}
/****************************************************************************
* Name: ioctl
*
@ -247,20 +194,32 @@ int nx_ioctl(int fd, int req, ...)
int ioctl(int fd, int req, ...)
{
FAR struct file *filep;
va_list ap;
int ret;
/* Let nx_vioctl() do the real work. */
/* Get the file structure corresponding to the file descriptor. */
ret = fs_getfilep(fd, &filep);
if (ret < 0)
{
goto err;
}
/* Let file_vioctl() do the real work. */
va_start(ap, req);
ret = nx_vioctl(fd, req, ap);
ret = file_vioctl(filep, req, ap);
va_end(ap);
if (ret < 0)
{
set_errno(-ret);
ret = ERROR;
goto err;
}
return ret;
err:
set_errno(-ret);
return ERROR;
}

View file

@ -73,7 +73,6 @@
# define _NX_READ(f,b,s) nx_read(f,b,s)
# define _NX_WRITE(f,b,s) nx_write(f,b,s)
# define _NX_SEEK(f,o,w) nx_seek(f,o,w)
# define _NX_IOCTL(f,r,a) nx_ioctl(f,r,a)
# define _NX_STAT(p,s) nx_stat(p,s,1)
# define _NX_GETERRNO(r) (-(r))
# define _NX_SETERRNO(r) set_errno(-(r))
@ -84,7 +83,6 @@
# define _NX_READ(f,b,s) read(f,b,s)
# define _NX_WRITE(f,b,s) write(f,b,s)
# define _NX_SEEK(f,o,w) lseek(f,o,w)
# define _NX_IOCTL(f,r,a) ioctl(f,r,a)
# define _NX_STAT(p,s) stat(p,s)
# define _NX_GETERRNO(r) errno
# define _NX_SETERRNO(r) ((void)(r))
@ -1295,25 +1293,6 @@ int file_munmap(FAR void *start, size_t length);
int file_ioctl(FAR struct file *filep, int req, ...);
/****************************************************************************
* Name: nx_ioctl
*
* Description:
* nx_ioctl() is similar to the standard 'ioctl' interface except that is
* not a cancellation point and it does not modify the errno variable.
*
* nx_ioctl() is an internal NuttX interface and should not be called from
* applications.
*
* Returned Value:
* Returns a non-negative number on success; A negated errno value is
* returned on any failure (see comments ioctl() for a list of appropriate
* errno values).
*
****************************************************************************/
int nx_ioctl(int fd, int req, ...);
/****************************************************************************
* Name: file_fcntl
*