BCH: Add readonly configuration for BCH devices
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
This commit is contained in:
parent
e085f0ee80
commit
5d3d123272
@ -28,4 +28,10 @@ config BCH_BUFFER_ALIGNMENT
|
||||
int "Buffer aligned bytes"
|
||||
default 0
|
||||
|
||||
config BCH_DEVICE_READONLY
|
||||
bool "Set BCH device readonly"
|
||||
default n
|
||||
---help---
|
||||
Set bch devices read-only
|
||||
|
||||
endif # BCH
|
||||
|
@ -198,7 +198,11 @@ static int file_vopen(FAR struct file *filep, FAR const char *path,
|
||||
|
||||
/* Get the file structure of the opened character driver proxy */
|
||||
|
||||
#ifdef CONFIG_BCH_DEVICE_READONLY
|
||||
ret = block_proxy(filep, path, O_RDOK);
|
||||
#else
|
||||
ret = block_proxy(filep, path, oflags);
|
||||
#endif
|
||||
#ifdef CONFIG_FS_NOTIFY
|
||||
if (ret >= 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user