mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
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:
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user