Merged in masayuki2009/nuttx.nuttx/fix_open_block_device (pull request #230)

Fix open() a block device with CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y

Approved-by: Gregory Nutt
This commit is contained in:
Masayuki Ishikawa 2017-03-01 15:24:08 +00:00 committed by Gregory Nutt
commit fd479b98b5
4 changed files with 4 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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