mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Fix open() a block device with CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y
This commit is contained in:
@@ -44,11 +44,8 @@ CSRCS += fs_registerdriver.c fs_unregisterdriver.c
|
||||
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
||||
CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c
|
||||
CSRCS += fs_findblockdriver.c fs_openblockdriver.c fs_closeblockdriver.c
|
||||
|
||||
ifneq ($(CONFIG_DISABLE_PSEUDOFS_OPERATIONS),y)
|
||||
CSRCS += fs_blockproxy.c
|
||||
endif
|
||||
endif
|
||||
|
||||
# Include driver build support
|
||||
|
||||
|
||||
+1
-2
@@ -118,8 +118,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && \
|
||||
!defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
int block_proxy(FAR const char *blkdev, int oflags);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -55,8 +55,7 @@
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/drivers/drivers.h>
|
||||
|
||||
#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && \
|
||||
!defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@@ -231,4 +230,4 @@ errout_with_chardev:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_DISABLE_PSEUDOFS_OPERATIONS && !CONFIG_DISABLE_MOUNTPOINT */
|
||||
#endif /* !CONFIG_DISABLE_MOUNTPOINT */
|
||||
|
||||
+1
-2
@@ -140,8 +140,7 @@ int open(const char *path, int oflags, ...)
|
||||
inode = desc.node;
|
||||
DEBUGASSERT(inode != NULL);
|
||||
|
||||
#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && \
|
||||
!defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
/* If the inode is block driver, then we may return a character driver
|
||||
* proxy for the block driver. block_proxy() will instantiate a BCH
|
||||
* character driver wrapper around the block driver, open(), then
|
||||
|
||||
Reference in New Issue
Block a user