fs/: Remove support for CONFIG_FS_WRITABLE

This commit is contained in:
Gregory Nutt
2020-03-21 10:48:14 -06:00
committed by Xiang Xiao
parent 66ab039b89
commit 7a871e2f29
15 changed files with 56 additions and 153 deletions
+4 -8
View File
@@ -3736,7 +3736,7 @@ nsh>
</tr> </tr>
<tr> <tr>
<td><b><code>df</code></b></td> <td><b><code>df</code></b></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_FS_READABLE</code><sup>3</sup></td> <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code></code></td>
<td><code>CONFIG_NSH_DISABLE_DF</code></td> <td><code>CONFIG_NSH_DISABLE_DF</code></td>
</tr> </tr>
<tr> <tr>
@@ -3785,7 +3785,7 @@ nsh&gt;
<td><code>CONFIG_NSH_DISABLE_GET</code></td> <td><code>CONFIG_NSH_DISABLE_GET</code></td>
</tr> </tr>
<tr> <tr>
<td><b><code>help</code></b><sup>4</sup></td> <td><b><code>help</code></b><sup>3</sup></td>
<td><br></td> <td><br></td>
<td><code>CONFIG_NSH_DISABLE_HELP</code></td> <td><code>CONFIG_NSH_DISABLE_HELP</code></td>
</tr> </tr>
@@ -3880,7 +3880,7 @@ nsh&gt;
</tr> </tr>
<tr> <tr>
<td><b><code>mount</code></b></td> <td><b><code>mount</code></b></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_FS_READABLE</code><sup>3</sup></td> <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code></code></td>
<td><code>CONFIG_NSH_DISABLE_MOUNT</code></td> <td><code>CONFIG_NSH_DISABLE_MOUNT</code></td>
</tr> </tr>
<tr> <tr>
@@ -4006,7 +4006,7 @@ nsh&gt;
</tr> </tr>
<tr> <tr>
<td><b><code>umount</code></b></td> <td><b><code>umount</code></b></td>
<td>!<code>CONFIG_DISABLE_MOUNTPOINT</code> &amp;&amp; <code>CONFIG_FS_READABLE</code><sup>3</sup></td> <td>!<code>CONFIG_DISABLE_MOUNTPOINT</code></code></td>
<td><code>CONFIG_NSH_DISABLE_UMOUNT</code></td> <td><code>CONFIG_NSH_DISABLE_UMOUNT</code></td>
</tr> </tr>
<tr> <tr>
@@ -4062,10 +4062,6 @@ nsh&gt;
Special TFTP server start-up options will probably be required to permit Special TFTP server start-up options will probably be required to permit
creation of files for the correct operation of the <code>put</code> command.</small><br> creation of files for the correct operation of the <code>put</code> command.</small><br>
<sup>3</sup><small> <sup>3</sup><small>
<code>CONFIG_FS_READABLE</code> is not a user configuration but is set automatically
if any readable file system is selected. At present, this is either <code>CONFIG_FS_FAT</code>
or <code>CONFIG_FS_ROMFS</code>.</small><br>
<sup>4</sup><small>
Verbose help output can be suppressed by defining <code>CONFIG_NSH_HELP_TERSE</code>. Verbose help output can be suppressed by defining <code>CONFIG_NSH_HELP_TERSE</code>.
In that case, the help command is still available but will be slightly smaller. In that case, the help command is still available but will be slightly smaller.
</small> </small>
-13
View File
@@ -59,19 +59,6 @@ config FS_READABLE
---help--- ---help---
Automatically selected if any readable file system is selected Automatically selected if any readable file system is selected
config FS_WRITABLE
bool "Writable file system"
default n
---help---
Automatically selected if any writable file system is selected. If
not selected, support for writing will be disabled in all block
drivers and also the block-to-character (BCH) layer and the MTD FTL
layer.
This selection can also be manually selected. You might want to do
this if there are no writable file systems enabled, but you still
want support for write access in block drivers and/or FTL.
source fs/aio/Kconfig source fs/aio/Kconfig
source fs/semaphore/Kconfig source fs/semaphore/Kconfig
source fs/mqueue/Kconfig source fs/mqueue/Kconfig
-8
View File
@@ -70,10 +70,8 @@ static int part_open(FAR struct inode *inode);
static int part_close(FAR struct inode *inode); static int part_close(FAR struct inode *inode);
static ssize_t part_read(FAR struct inode *inode, unsigned char *buffer, static ssize_t part_read(FAR struct inode *inode, unsigned char *buffer,
size_t start_sector, unsigned int nsectors); size_t start_sector, unsigned int nsectors);
#ifdef CONFIG_FS_WRITABLE
static ssize_t part_write(FAR struct inode *inode, const unsigned char *buffer, static ssize_t part_write(FAR struct inode *inode, const unsigned char *buffer,
size_t start_sector, unsigned int nsectors); size_t start_sector, unsigned int nsectors);
#endif
static int part_geometry(FAR struct inode *inode, struct geometry *geometry); static int part_geometry(FAR struct inode *inode, struct geometry *geometry);
static int part_ioctl(FAR struct inode *inode, int cmd, unsigned long arg); static int part_ioctl(FAR struct inode *inode, int cmd, unsigned long arg);
@@ -90,11 +88,7 @@ static const struct block_operations g_part_bops =
part_open, /* open */ part_open, /* open */
part_close, /* close */ part_close, /* close */
part_read, /* read */ part_read, /* read */
#ifdef CONFIG_FS_WRITABLE
part_write, /* write */ part_write, /* write */
#else
NULL, /* write */
#endif
part_geometry, /* geometry */ part_geometry, /* geometry */
part_ioctl /* ioctl */ part_ioctl /* ioctl */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
@@ -180,7 +174,6 @@ static ssize_t part_read(FAR struct inode *inode, unsigned char *buffer,
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_FS_WRITABLE
static ssize_t part_write(FAR struct inode *inode, const unsigned char *buffer, static ssize_t part_write(FAR struct inode *inode, const unsigned char *buffer,
size_t start_sector, unsigned int nsectors) size_t start_sector, unsigned int nsectors)
{ {
@@ -196,7 +189,6 @@ static ssize_t part_write(FAR struct inode *inode, const unsigned char *buffer,
return parent->u.i_bops->write(parent, buffer, start_sector, nsectors); return parent->u.i_bops->write(parent, buffer, start_sector, nsectors);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: part_geometry * Name: part_geometry
-1
View File
@@ -8,7 +8,6 @@ config FS_FAT
default n default n
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
select FS_READABLE select FS_READABLE
select FS_WRITABLE
---help--- ---help---
Enable FAT filesystem support Enable FAT filesystem support
-1
View File
@@ -8,7 +8,6 @@ config FS_HOSTFS
default n default n
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
select FS_READABLE select FS_READABLE
select FS_WRITABLE
---help--- ---help---
The Host file system provides a mechanism to mount directories The Host file system provides a mechanism to mount directories
from the host OS during simulation mode. The host directory from the host OS during simulation mode. The host directory
-1
View File
@@ -2,7 +2,6 @@ config FS_LITTLEFS
bool "LITTLEFS File System" bool "LITTLEFS File System"
default n default n
select FS_READABLE select FS_READABLE
select FS_WRITABLE
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
---help--- ---help---
Build the LITTLEFS file system. https://github.com/ARMmbed/littlefs. Build the LITTLEFS file system. https://github.com/ARMmbed/littlefs.
-1
View File
@@ -8,7 +8,6 @@ config NFS
default n default n
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
select FS_READABLE select FS_READABLE
select FS_WRITABLE
---help--- ---help---
Enable network file system (NFS) client file system Enable network file system (NFS) client file system
-1
View File
@@ -8,7 +8,6 @@ config FS_NXFFS
default n default n
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
select FS_READABLE select FS_READABLE
select FS_WRITABLE
---help--- ---help---
Enable NuttX FLASH file system (NXFF) support. Enable NuttX FLASH file system (NXFF) support.
-1
View File
@@ -8,7 +8,6 @@ config FS_SMARTFS
default n default n
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
select FS_READABLE select FS_READABLE
select FS_WRITABLE
---help--- ---help---
Enable NuttX SMART Flash file system (SMARTFS) support. Enable NuttX SMART Flash file system (SMARTFS) support.
-1
View File
@@ -7,7 +7,6 @@ config FS_SPIFFS
bool "SPIFFS File System" bool "SPIFFS File System"
default n default n
select FS_READABLE select FS_READABLE
select FS_WRITABLE
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
---help--- ---help---
Build the SPIFFS file system. This is a port of version 0.3.7 of Build the SPIFFS file system. This is a port of version 0.3.7 of
-1
View File
@@ -8,7 +8,6 @@ config FS_TMPFS
default n default n
depends on !DISABLE_MOUNTPOINT depends on !DISABLE_MOUNTPOINT
select FS_READABLE select FS_READABLE
select FS_WRITABLE
---help--- ---help---
Enable TMPFS filesystem support Enable TMPFS filesystem support
+13 -29
View File
@@ -1,35 +1,20 @@
/**************************************************************************** /****************************************************************************
* fs/vfs/fs_mkdir.c * fs/vfs/fs_mkdir.c
* *
* Copyright (C) 2007, 2008, 2014, 2017 Gregory Nutt. All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more
* Author: Gregory Nutt <gnutt@nuttx.org> * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* *
* Redistribution and use in source and binary forms, with or without * http://www.apache.org/licenses/LICENSE-2.0
* modification, are permitted provided that the following conditions
* are met:
* *
* 1. Redistributions of source code must retain the above copyright * Unless required by applicable law or agreed to in writing, software
* notice, this list of conditions and the following disclaimer. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* 2. Redistributions in binary form must reproduce the above copyright * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* notice, this list of conditions and the following disclaimer in * License for the specific language governing permissions and limitations
* the documentation and/or other materials provided with the * under the License.
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
@@ -54,8 +39,7 @@
****************************************************************************/ ****************************************************************************/
#undef FS_HAVE_WRITABLE_MOUNTPOINT #undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1 # define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif #endif
+13 -29
View File
@@ -1,35 +1,20 @@
/**************************************************************************** /****************************************************************************
* fs/vfs/fs_rename.c * fs/vfs/fs_rename.c
* *
* Copyright (C) 2007-2009, 2014, 2017 Gregory Nutt. All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more
* Author: Gregory Nutt <gnutt@nuttx.org> * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* *
* Redistribution and use in source and binary forms, with or without * http://www.apache.org/licenses/LICENSE-2.0
* modification, are permitted provided that the following conditions
* are met:
* *
* 1. Redistributions of source code must retain the above copyright * Unless required by applicable law or agreed to in writing, software
* notice, this list of conditions and the following disclaimer. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* 2. Redistributions in binary form must reproduce the above copyright * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* notice, this list of conditions and the following disclaimer in * License for the specific language governing permissions and limitations
* the documentation and/or other materials provided with the * under the License.
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
@@ -55,8 +40,7 @@
****************************************************************************/ ****************************************************************************/
#undef FS_HAVE_WRITABLE_MOUNTPOINT #undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1 # define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif #endif
+13 -29
View File
@@ -1,35 +1,20 @@
/**************************************************************************** /****************************************************************************
* fs/vfs/fs_rmdir.c * fs/vfs/fs_rmdir.c
* *
* Copyright (C) 2007-2009, 2014, 2017 Gregory Nutt. All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more
* Author: Gregory Nutt <gnutt@nuttx.org> * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* *
* Redistribution and use in source and binary forms, with or without * http://www.apache.org/licenses/LICENSE-2.0
* modification, are permitted provided that the following conditions
* are met:
* *
* 1. Redistributions of source code must retain the above copyright * Unless required by applicable law or agreed to in writing, software
* notice, this list of conditions and the following disclaimer. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* 2. Redistributions in binary form must reproduce the above copyright * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* notice, this list of conditions and the following disclaimer in * License for the specific language governing permissions and limitations
* the documentation and/or other materials provided with the * under the License.
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
@@ -53,8 +38,7 @@
****************************************************************************/ ****************************************************************************/
#undef FS_HAVE_WRITABLE_MOUNTPOINT #undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1 # define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif #endif
+13 -29
View File
@@ -1,35 +1,20 @@
/**************************************************************************** /****************************************************************************
* fs/vfs/fs_unlink.c * fs/vfs/fs_unlink.c
* *
* Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more
* Author: Gregory Nutt <gnutt@nuttx.org> * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* *
* Redistribution and use in source and binary forms, with or without * http://www.apache.org/licenses/LICENSE-2.0
* modification, are permitted provided that the following conditions
* are met:
* *
* 1. Redistributions of source code must retain the above copyright * Unless required by applicable law or agreed to in writing, software
* notice, this list of conditions and the following disclaimer. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* 2. Redistributions in binary form must reproduce the above copyright * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* notice, this list of conditions and the following disclaimer in * License for the specific language governing permissions and limitations
* the documentation and/or other materials provided with the * under the License.
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
@@ -53,8 +38,7 @@
****************************************************************************/ ****************************************************************************/
#undef FS_HAVE_WRITABLE_MOUNTPOINT #undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1 # define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif #endif