Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for CONFIG_FS_WRITABLE #602

Merged
merged 12 commits into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fs/: Remove support for CONFIG_FS_WRITABLE
  • Loading branch information
gregory-nutt committed Mar 21, 2020
commit ec32730420e44df6020c32259f212d0617d05621
12 changes: 4 additions & 8 deletions Documentation/NuttShell.html
Original file line number Diff line number Diff line change
Expand Up @@ -3736,7 +3736,7 @@ <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
</tr>
<tr>
<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>
</tr>
<tr>
Expand Down Expand Up @@ -3785,7 +3785,7 @@ <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
<td><code>CONFIG_NSH_DISABLE_GET</code></td>
</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><code>CONFIG_NSH_DISABLE_HELP</code></td>
</tr>
Expand Down Expand Up @@ -3880,7 +3880,7 @@ <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
</tr>
<tr>
<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>
</tr>
<tr>
Expand Down Expand Up @@ -4006,7 +4006,7 @@ <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
</tr>
<tr>
<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>
</tr>
<tr>
Expand Down Expand Up @@ -4062,10 +4062,6 @@ <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
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>
<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>.
In that case, the help command is still available but will be slightly smaller.
</small>
Expand Down
13 changes: 0 additions & 13 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,6 @@ config FS_READABLE
---help---
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/semaphore/Kconfig
source fs/mqueue/Kconfig
Expand Down
8 changes: 0 additions & 8 deletions fs/driver/fs_blockpartition.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ static int part_open(FAR struct inode *inode);
static int part_close(FAR struct inode *inode);
static ssize_t part_read(FAR struct inode *inode, unsigned char *buffer,
size_t start_sector, unsigned int nsectors);
#ifdef CONFIG_FS_WRITABLE
static ssize_t part_write(FAR struct inode *inode, const unsigned char *buffer,
size_t start_sector, unsigned int nsectors);
#endif
static int part_geometry(FAR struct inode *inode, struct geometry *geometry);
static int part_ioctl(FAR struct inode *inode, int cmd, unsigned long arg);

Expand All @@ -90,11 +88,7 @@ static const struct block_operations g_part_bops =
part_open, /* open */
part_close, /* close */
part_read, /* read */
#ifdef CONFIG_FS_WRITABLE
part_write, /* write */
#else
NULL, /* write */
#endif
part_geometry, /* geometry */
part_ioctl /* ioctl */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
Expand Down Expand Up @@ -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,
size_t start_sector, unsigned int nsectors)
{
Expand All @@ -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);
}
#endif

/****************************************************************************
* Name: part_geometry
Expand Down
1 change: 0 additions & 1 deletion fs/fat/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config FS_FAT
default n
depends on !DISABLE_MOUNTPOINT
select FS_READABLE
select FS_WRITABLE
---help---
Enable FAT filesystem support

Expand Down
1 change: 0 additions & 1 deletion fs/hostfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config FS_HOSTFS
default n
depends on !DISABLE_MOUNTPOINT
select FS_READABLE
select FS_WRITABLE
---help---
The Host file system provides a mechanism to mount directories
from the host OS during simulation mode. The host directory
Expand Down
1 change: 0 additions & 1 deletion fs/littlefs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ config FS_LITTLEFS
bool "LITTLEFS File System"
default n
select FS_READABLE
select FS_WRITABLE
depends on !DISABLE_MOUNTPOINT
---help---
Build the LITTLEFS file system. https://github.com/ARMmbed/littlefs.
1 change: 0 additions & 1 deletion fs/nfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config NFS
default n
depends on !DISABLE_MOUNTPOINT
select FS_READABLE
select FS_WRITABLE
---help---
Enable network file system (NFS) client file system

Expand Down
1 change: 0 additions & 1 deletion fs/nxffs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config FS_NXFFS
default n
depends on !DISABLE_MOUNTPOINT
select FS_READABLE
select FS_WRITABLE
---help---
Enable NuttX FLASH file system (NXFF) support.

Expand Down
1 change: 0 additions & 1 deletion fs/smartfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config FS_SMARTFS
default n
depends on !DISABLE_MOUNTPOINT
select FS_READABLE
select FS_WRITABLE
---help---
Enable NuttX SMART Flash file system (SMARTFS) support.

Expand Down
1 change: 0 additions & 1 deletion fs/spiffs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ config FS_SPIFFS
bool "SPIFFS File System"
default n
select FS_READABLE
select FS_WRITABLE
depends on !DISABLE_MOUNTPOINT
---help---
Build the SPIFFS file system. This is a port of version 0.3.7 of
Expand Down
1 change: 0 additions & 1 deletion fs/tmpfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config FS_TMPFS
default n
depends on !DISABLE_MOUNTPOINT
select FS_READABLE
select FS_WRITABLE
---help---
Enable TMPFS filesystem support

Expand Down
42 changes: 13 additions & 29 deletions fs/vfs/fs_mkdir.c
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
/****************************************************************************
* fs/vfs/fs_mkdir.c
*
* Copyright (C) 2007, 2008, 2014, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <[email protected]>
* Licensed to the Apache Software Foundation (ASF) under one or more
* 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
* modification, are permitted provided that the following conditions
* are met:
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

Expand All @@ -54,8 +39,7 @@
****************************************************************************/

#undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
CONFIG_NFILE_STREAMS > 0
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif

Expand Down
42 changes: 13 additions & 29 deletions fs/vfs/fs_rename.c
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
/****************************************************************************
* fs/vfs/fs_rename.c
*
* Copyright (C) 2007-2009, 2014, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <[email protected]>
* Licensed to the Apache Software Foundation (ASF) under one or more
* 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
* modification, are permitted provided that the following conditions
* are met:
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

Expand All @@ -55,8 +40,7 @@
****************************************************************************/

#undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
CONFIG_NFILE_STREAMS > 0
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif

Expand Down
42 changes: 13 additions & 29 deletions fs/vfs/fs_rmdir.c
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
/****************************************************************************
* fs/vfs/fs_rmdir.c
*
* Copyright (C) 2007-2009, 2014, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <[email protected]>
* Licensed to the Apache Software Foundation (ASF) under one or more
* 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
* modification, are permitted provided that the following conditions
* are met:
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

Expand All @@ -53,8 +38,7 @@
****************************************************************************/

#undef FS_HAVE_WRITABLE_MOUNTPOINT
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \
CONFIG_NFILE_STREAMS > 0
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_STREAMS > 0
# define FS_HAVE_WRITABLE_MOUNTPOINT 1
#endif

Expand Down
Loading