mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
rpmsgblk: bind block inode to ept when create ept
A segmentfault might happen when read/write/unlink ops called without an open ops called because it bind ept's ops in rpmsgblk_open_handler. proxy> rm /dev/ram1 segmentfault proxy> ls /dev/ram1 segmentfault Signed-off-by: liaoao <liaoao@xiaomi.com>
This commit is contained in:
@@ -1199,6 +1199,31 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
|
||||
|
||||
int close_blockdriver(FAR struct inode *inode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: find_blockdriver
|
||||
*
|
||||
* Description:
|
||||
* Return the inode of the block driver specified by 'pathname'
|
||||
*
|
||||
* Input Parameters:
|
||||
* pathname - The full path to the block driver to be located
|
||||
* mountflags - If MS_RDONLY is not set, then driver must support write
|
||||
* operations (see include/sys/mount.h)
|
||||
* ppinode - Address of the location to return the inode reference
|
||||
*
|
||||
* Returned Value:
|
||||
* Returns zero on success or a negated errno on failure:
|
||||
*
|
||||
* ENOENT - No block driver of this name is registered
|
||||
* ENOTBLK - The inode associated with the pathname is not a block driver
|
||||
* EACCESS - The MS_RDONLY option was not set but this driver does not
|
||||
* support write access
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int find_blockdriver(FAR const char *pathname, int mountflags,
|
||||
FAR struct inode **ppinode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: find_mtddriver
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user