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

fs/reference_count: set default reference count option to n #13519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
8 changes: 7 additions & 1 deletion fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ config FS_HEAPBUF_SECTION

config FS_REFCOUNT
bool "File reference count"
default !DEFAULT_SMALL
anchao marked this conversation as resolved.
Show resolved Hide resolved
default n
Copy link
Contributor

@xiaoxiang781216 xiaoxiang781216 Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default should be !DISABLE_PTHREAD, the default config should prefer the safe over size, since many user doesn't know every config option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in nuttx, is pthread the only way to share files between threads?
how about eg. aio?

IMO, FS_REFCOUNT should not be a user-visible option at all.
we should just enable it automatically when a user enabled functionalities which possibly need it.

---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)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change Task to thread

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
Loading