fs/inode: remove all unnecessary check for filep/inode

Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-08-28 17:17:05 +08:00
committed by Xiang Xiao
parent baabf4bbf3
commit 7aa45305b7
158 changed files with 412 additions and 714 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
/* Sanity checks */
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv != NULL);
/* Recover the file system state from the open file */
+2 -2
View File
@@ -994,7 +994,7 @@ int nxffs_open(FAR struct file *filep, FAR const char *relpath,
/* Sanity checks */
DEBUGASSERT(filep->f_priv == NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv == NULL);
/* Get the mountpoint private data from the NuttX inode reference in the
* file structure
@@ -1116,7 +1116,7 @@ int nxffs_close(FAR struct file *filep)
/* Sanity checks */
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv != NULL);
/* Recover the open file state from the struct file instance */
+1 -1
View File
@@ -142,7 +142,7 @@ ssize_t nxffs_read(FAR struct file *filep, FAR char *buffer, size_t buflen)
/* Sanity checks */
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv != NULL);
/* Recover the open file state from the struct file instance */
+2 -2
View File
@@ -181,11 +181,11 @@ int nxffs_fstat(FAR const struct file *filep, FAR struct stat *buf)
int ret;
finfo("Buf %p\n", buf);
DEBUGASSERT(filep != NULL && buf != NULL);
DEBUGASSERT(buf != NULL);
/* Recover the open file state from the struct file instance */
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv != NULL);
ofile = (FAR struct nxffs_ofile_s *)filep->f_priv;
/* Recover the volume state from the open file */
+1 -1
View File
@@ -57,7 +57,7 @@ int nxffs_truncate(FAR struct file *filep, off_t length)
/* Sanity checks */
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv != NULL);
/* Recover the open file state from the struct file instance */
+1 -1
View File
@@ -519,7 +519,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer,
/* Sanity checks */
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
DEBUGASSERT(filep->f_priv != NULL);
/* Recover the open file state from the struct file instance */