Skip to content

No ->fallocate: cannot preallocate overlay pages or reserve pool capacity #27

Description

@congwang-mk

daxfs implements neither ->fallocate nor ->direct_IO, so fallocate() returns -EOPNOTSUPP and O_DIRECT opens fail.

Neither is likely to matter much for a memory filesystem, but the combination has a practical consequence worth recording: benchmarking daxfs with fio requires --fallocate=none --direct=0, and preallocating a file is only possible by writing it. Combined with #17, where a truncate-extended range used to read short, laying out a test file with truncate did not work either.

->fallocate is the one with a real use case: preallocating overlay pages up front would let a writer reserve pool capacity and fail early with -ENOSPC, rather than discovering the pool is exhausted mid-write and taking a short write. That maps cleanly onto daxfs_write_prealloc(), which already batch-allocates pages for a range.

->direct_IO is arguably meaningless here, since reads already bypass the page cache. Probably worth an explicit note rather than an implementation.

Found during the review in #15.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions