Skip to content

nolibc: Add fallocate()

Daniel Palmer lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 8 repliesIn review
  2. v32 patches 17 repliesSuperseded
  3. v22 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches2 repliesSuperseded

Changes in v4 from the cover letter

- Added statfs()...
- Reworked the test a bit to use statfs() to work out if /tmp is a tmpfs or not and skip the test if it isn't. This skips the test on sparc32 where CONFIG_TMPFS=n.
- Adding the needed bits to the sparc32 config to allow tmpfs to be enabled allows it to run and pass the test. I will check the changes and send a patch.
- Cleaned up the if() around deciding how to pass the parameters for fallocate() based on the comments from David and Thomas.
- Test passed on all of the supported targets.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tools/nolibc: fcntl: Add fallocate()tools/include/nolibc/arch-mips.h tools/include/nolibc/fcntl.h tools/include/nolibc/sys.h+50 -00 replies
2/3tools/nolibc: Add statfs()tools/include/nolibc/Makefile tools/include/nolibc/nolibc.h tools/include/nolibc/sys/statfs.h+52 -07 replies
3/3selftests/nolibc: Add a very basic test for fallocate()tools/testing/selftests/nolibc/nolibc-test.c+70 -00 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWilly Tarreau
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] nolibc: Add fallocate()

While poking around with my "static PIE for nommu" series I found I needed fallocate(). Implementing it turned out a bit more interesting than I thought it would be due to how the offset and size need to be passed on 32bit machines.

v4:
- Added statfs()...
- Reworked the test a bit to use statfs() to work out if /tmp is a tmpfs or not and skip the test if it isn't. This skips the test on sparc32 where CONFIG_TMPFS=n.
- Adding the needed bits to the sparc32 config to allow tmpfs to be enabled allows it to run and pass the test. I will check the changes and send a patch.
- Cleaned up the if() around deciding how to pass the parameters for fallocate() based on the comments from David and Thomas.
- Test passed on all of the supported targets.

v3:
- Reworked the test a bit, ran it on all the targets I could get to run (s390, loongarch and sh currently don't work for me). sparc32 doesn't seem to support fallocate() so made it skip the test.
- Rebase on nolibc/for-next with the large file support bits.

v2:
- Addressed Thomas' comments
- Trial and error'd a test for the arguments being passed correctly. Hopefully someone smarter than I am can tell if it actually works.

Daniel Palmer (3):
tools/nolibc: fcntl: Add fallocate() tools/nolibc: Add statfs()
selftests/nolibc: Add a very basic test for fallocate()

 tools/include/nolibc/Makefile                |  1 +
 tools/include/nolibc/arch-mips.h             | 11 +++
 tools/include/nolibc/fcntl.h                 | 31 +++++++++
 tools/include/nolibc/nolibc.h                |  1 +
 tools/include/nolibc/sys.h                   |  8 +++
 tools/include/nolibc/sys/statfs.h            | 50 ++++++++++++++
 tools/testing/selftests/nolibc/nolibc-test.c | 70 ++++++++++++++++++++
 7 files changed, 172 insertions(+)
 create mode 100644 tools/include/nolibc/sys/statfs.h

base-commit: bb2d82d41894cb30d836e9796ff67d2f9a71eccf

Signature · 1 line
2.53.0