Skip to content

Commit

Permalink
Fix open() a block device with CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y
Browse files Browse the repository at this point in the history
  • Loading branch information
masayuki2009 committed Mar 1, 2017
1 parent b118fb4 commit e239961
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions fs/driver/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions fs/driver/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions fs/driver/fs_blockproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -231,4 +230,4 @@ int block_proxy(FAR const char *blkdev, int oflags)
return ret;
}

#endif /* !CONFIG_DISABLE_PSEUDOFS_OPERATIONS && !CONFIG_DISABLE_MOUNTPOINT */
#endif /* !CONFIG_DISABLE_MOUNTPOINT */
3 changes: 1 addition & 2 deletions fs/vfs/fs_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e239961

Please sign in to comment.