fix:3.1代码检视

Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: I0e0b59cdc22b292ccf0a790010c037d43793a934
This commit is contained in:
x_xiny 2022-03-19 20:22:59 +08:00
parent 41b80ad20a
commit 5b87a530f5
20 changed files with 156 additions and 76 deletions

View File

@ -45,8 +45,6 @@
#include "bcache.h" #include "bcache.h"
#endif #endif
#include "pthread.h"
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus
extern "C" { extern "C" {

View File

@ -37,113 +37,172 @@
/* vnode operations returns EIO */ /* vnode operations returns EIO */
static int ErrorVopCreate(struct Vnode *parent, const char *name, int mode, struct Vnode **vnode) static int ErrorVopCreate(struct Vnode *parent, const char *name, int mode, struct Vnode **vnode)
{ {
(void)parent;
(void)name;
(void)mode;
(void)vnode;
return -EIO; return -EIO;
} }
static int ErrorVopLookup(struct Vnode *parent, const char *name, int len, struct Vnode **vnode) static int ErrorVopLookup(struct Vnode *parent, const char *name, int len, struct Vnode **vnode)
{ {
(void)parent;
(void)name;
(void)len;
(void)vnode;
return -EIO; return -EIO;
} }
static int ErrorVopOpen(struct Vnode *vnode, int fd, int mode, int flags) static int ErrorVopOpen(struct Vnode *vnode, int fd, int mode, int flags)
{ {
(void)vnode;
(void)fd;
(void)mode;
(void)flags;
return -EIO; return -EIO;
} }
static int ErrorVopClose(struct Vnode *vnode) static int ErrorVopClose(struct Vnode *vnode)
{ {
(void)vnode;
/* already closed at force umount, do nothing here */ /* already closed at force umount, do nothing here */
return OK; return OK;
} }
static int ErrorVopReclaim(struct Vnode *vnode) static int ErrorVopReclaim(struct Vnode *vnode)
{ {
(void)vnode;
return -EIO; return -EIO;
} }
static int ErrorVopUnlink(struct Vnode *parent, struct Vnode *vnode, const char *fileName) static int ErrorVopUnlink(struct Vnode *parent, struct Vnode *vnode, const char *fileName)
{ {
(void)parent;
(void)vnode;
(void)fileName;
return -EIO; return -EIO;
} }
static int ErrorVopRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName) static int ErrorVopRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName)
{ {
(void)parent;
(void)vnode;
(void)dirName;
return -EIO; return -EIO;
} }
static int ErrorVopMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode) static int ErrorVopMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode)
{ {
(void)parent;
(void)dirName;
(void)mode;
(void)vnode;
return -EIO; return -EIO;
} }
static int ErrorVopReaddir(struct Vnode *vnode, struct fs_dirent_s *dir) static int ErrorVopReaddir(struct Vnode *vnode, struct fs_dirent_s *dir)
{ {
(void)vnode;
(void)dir;
return -EIO; return -EIO;
} }
static int ErrorVopOpendir(struct Vnode *vnode, struct fs_dirent_s *dir) static int ErrorVopOpendir(struct Vnode *vnode, struct fs_dirent_s *dir)
{ {
(void)vnode;
(void)dir;
return -EIO; return -EIO;
} }
static int ErrorVopRewinddir(struct Vnode *vnode, struct fs_dirent_s *dir) static int ErrorVopRewinddir(struct Vnode *vnode, struct fs_dirent_s *dir)
{ {
(void)vnode;
(void)dir;
return -EIO; return -EIO;
} }
static int ErrorVopClosedir(struct Vnode *vnode, struct fs_dirent_s *dir) static int ErrorVopClosedir(struct Vnode *vnode, struct fs_dirent_s *dir)
{ {
(void)vnode;
(void)dir;
/* already closed at force umount, do nothing here */ /* already closed at force umount, do nothing here */
return OK; return OK;
} }
static int ErrorVopGetattr(struct Vnode *vnode, struct stat *st) static int ErrorVopGetattr(struct Vnode *vnode, struct stat *st)
{ {
(void)vnode;
(void)st;
return -EIO; return -EIO;
} }
static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st) static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st)
{ {
(void)vnode;
(void)st;
return -EIO; return -EIO;
} }
static int ErrorVopChattr(struct Vnode *vnode, struct IATTR *attr) static int ErrorVopChattr(struct Vnode *vnode, struct IATTR *attr)
{ {
(void)vnode;
(void)attr;
return -EIO; return -EIO;
} }
static int ErrorVopRename(struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName) static int ErrorVopRename(struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName)
{ {
(void)src;
(void)dstParent;
(void)srcName;
(void)dstName;
return -EIO; return -EIO;
} }
static int ErrorVopTruncate(struct Vnode *vnode, off_t len) static int ErrorVopTruncate(struct Vnode *vnode, off_t len)
{ {
(void)vnode;
(void)len;
return -EIO; return -EIO;
} }
static int ErrorVopTruncate64(struct Vnode *vnode, off64_t len) static int ErrorVopTruncate64(struct Vnode *vnode, off64_t len)
{ {
(void)vnode;
(void)len;
return -EIO; return -EIO;
} }
static int ErrorVopFscheck(struct Vnode *vnode, struct fs_dirent_s *dir) static int ErrorVopFscheck(struct Vnode *vnode, struct fs_dirent_s *dir)
{ {
(void)vnode;
(void)dir;
return -EIO; return -EIO;
} }
static int ErrorVopLink(struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName) static int ErrorVopLink(struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName)
{ {
(void)src;
(void)dstParent;
(void)dst;
(void)dstName;
return -EIO; return -EIO;
} }
static int ErrorVopSymlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target) static int ErrorVopSymlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target)
{ {
(void)parentVnode;
(void)newVnode;
(void)path;
(void)target;
return -EIO; return -EIO;
} }
static ssize_t ErrorVopReadlink(struct Vnode *vnode, char *buffer, size_t bufLen) static ssize_t ErrorVopReadlink(struct Vnode *vnode, char *buffer, size_t bufLen)
{ {
(void)vnode;
(void)buffer;
(void)bufLen;
return -EIO; return -EIO;
} }
@ -175,72 +234,105 @@ static struct VnodeOps g_errorVnodeOps = {
/* file operations returns EIO */ /* file operations returns EIO */
static int ErrorFopOpen(struct file *filep) static int ErrorFopOpen(struct file *filep)
{ {
(void)filep;
return -EIO; return -EIO;
} }
static int ErrorFopClose(struct file *filep) static int ErrorFopClose(struct file *filep)
{ {
(void)filep;
/* already closed at force umount, do nothing here */ /* already closed at force umount, do nothing here */
return OK; return OK;
} }
static ssize_t ErrorFopRead(struct file *filep, char *buffer, size_t buflen) static ssize_t ErrorFopRead(struct file *filep, char *buffer, size_t buflen)
{ {
(void)filep;
(void)buffer;
(void)buflen;
return -EIO; return -EIO;
} }
static ssize_t ErrorFopWrite(struct file *filep, const char *buffer, size_t buflen) static ssize_t ErrorFopWrite(struct file *filep, const char *buffer, size_t buflen)
{ {
(void)filep;
(void)buffer;
(void)buflen;
return -EIO; return -EIO;
} }
static off_t ErrorFopSeek(struct file *filep, off_t offset, int whence) static off_t ErrorFopSeek(struct file *filep, off_t offset, int whence)
{ {
(void)filep;
(void)offset;
(void)whence;
return -EIO; return -EIO;
} }
static int ErrorFopIoctl(struct file *filep, int cmd, unsigned long arg) static int ErrorFopIoctl(struct file *filep, int cmd, unsigned long arg)
{ {
(void)filep;
(void)cmd;
(void)arg;
return -EIO; return -EIO;
} }
static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region) static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region)
{ {
(void)filep;
(void)region;
return -EIO; return -EIO;
} }
static int ErrorFopPoll(struct file *filep, poll_table *fds) static int ErrorFopPoll(struct file *filep, poll_table *fds)
{ {
(void)filep;
(void)fds;
return -EIO; return -EIO;
} }
static int ErrorFopStat(struct file *filep, struct stat* st) static int ErrorFopStat(struct file *filep, struct stat* st)
{ {
(void)filep;
(void)st;
return -EIO; return -EIO;
} }
static int ErrorFopFallocate(struct file* filep, int mode, off_t offset, off_t len) static int ErrorFopFallocate(struct file* filep, int mode, off_t offset, off_t len)
{ {
(void)filep;
(void)mode;
(void)offset;
(void)len;
return -EIO; return -EIO;
} }
static int ErrorFopFallocate64(struct file *filep, int mode, off64_t offset, off64_t len) static int ErrorFopFallocate64(struct file *filep, int mode, off64_t offset, off64_t len)
{ {
(void)filep;
(void)mode;
(void)offset;
(void)len;
return -EIO; return -EIO;
} }
static int ErrorFopFsync(struct file *filep) static int ErrorFopFsync(struct file *filep)
{ {
(void)filep;
return -EIO; return -EIO;
} }
static ssize_t ErrorFopReadpage(struct file *filep, char *buffer, size_t buflen) static ssize_t ErrorFopReadpage(struct file *filep, char *buffer, size_t buflen)
{ {
(void)filep;
(void)buffer;
(void)buflen;
return -EIO; return -EIO;
} }
static int ErrorFopUnlink(struct Vnode *vnode) static int ErrorFopUnlink(struct Vnode *vnode)
{ {
(void)vnode;
return -EIO; return -EIO;
} }

View File

@ -45,7 +45,6 @@
#ifdef LOSCFG_DRIVERS_TZDRIVER #ifdef LOSCFG_DRIVERS_TZDRIVER
#include "fs/file.h" #include "fs/file.h"
#endif #endif
#include "fs/file.h"
#include "unistd.h" #include "unistd.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -65,7 +65,6 @@
#include "lwip/api_shell.h" #include "lwip/api_shell.h"
#include "lwip/dns.h" #include "lwip/dns.h"
#include "lwip/netdb.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/priv/tcp_priv.h" #include "lwip/priv/tcp_priv.h"

View File

@ -34,8 +34,6 @@
#include <lwip/snmp.h> #include <lwip/snmp.h>
#include <lwip/etharp.h> #include <lwip/etharp.h>
#include <lwip/sockets.h> #include <lwip/sockets.h>
#include <lwip/snmp.h>
#include <lwip/etharp.h>
#include <lwip/ethip6.h> #include <lwip/ethip6.h>
#define LWIP_NETIF_HOSTNAME_DEFAULT "default" #define LWIP_NETIF_HOSTNAME_DEFAULT "default"

View File

@ -57,8 +57,6 @@
#include "sys/prctl.h" #include "sys/prctl.h"
#include "sys/socket.h" #include "sys/socket.h"
#include "sys/utsname.h" #include "sys/utsname.h"
#include "poll.h"
#include "sys/uio.h"
#ifdef LOSCFG_SHELL #ifdef LOSCFG_SHELL
#include "shmsg.h" #include "shmsg.h"
#endif #endif

View File

@ -63,7 +63,6 @@
#include "epoll.h" #include "epoll.h"
#endif #endif
#include <sys/wait.h> #include <sys/wait.h>
#include "sys/resource.h"
#ifdef LOSCFG_FS_VFS #ifdef LOSCFG_FS_VFS
#include "vnode.h" #include "vnode.h"
#endif #endif

View File

@ -44,9 +44,6 @@
#include "shmsg.h" #include "shmsg.h"
#endif #endif
#include "user_copy.h" #include "user_copy.h"
#include "los_strncpy_from_user.h"
#include "capability_type.h"
#include "capability_api.h"
#include "unistd.h" #include "unistd.h"