Skip to content

Commit

Permalink
fs/reference_count: set default reference count option to n
Browse files Browse the repository at this point in the history
Most of developers will not have the scenarios of open/close file descriptors in multi-threads,
The default option will incur additional code size overhead for such devices.
this PR will preserve the behavior before PR#13296 was introduced, and ensure that the default code size is not affected.

Note that this option will ensure the safety of access to the file
system from multi-tasks (Task A blocking rw(fd), then Task B close(fd)),
the disadvantage is that it will increase the amount of code-size,
there is no need to enable this option if the application could ensure
he file operations are safe.

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 18, 2024
1 parent 4ad001c commit 60cab67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,17 @@ config FS_HEAPSIZE

config FS_REFCOUNT
bool "File reference count"
default !DEFAULT_SMALL
default n
---help---
Enable will Records the number of filep references. The file is
actually closed when the count reaches 0

Note that this option will ensure the safety of access to the file
system from multi-tasks (Task A blocking rw(fd), then Task B close(fd)),
the disadvantage is that it will increase the amount of code-size,
there is no need to enable this option if the application could ensure
he file operations are safe.

source "fs/vfs/Kconfig"
source "fs/aio/Kconfig"
source "fs/semaphore/Kconfig"
Expand Down

0 comments on commit 60cab67

Please sign in to comment.