Native versions for AllocateFileRange() #2229

pull sipa wants to merge 2 commits into bitcoin:master from sipa:prealloc changing 3 files +54 −2
  1. sipa commented at 11:10 pm on January 27, 2013: member

    Implement native versions of AllocateFileRange() for:

    • Linux: posix_fallocate()
    • Mac OSX: fcntl(…, F_PREALLOCATE, …)
    • Windows: SetEndOfFile()

    This should prevent the double-writing fallback that is used currently.

  2. BitcoinPullTester commented at 0:22 am on January 28, 2013: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/f92555255c2d928ce618d383aa5da46bd195ef43 for binaries and test log.
  3. sipa commented at 0:26 am on January 28, 2013: member
    Test plan: either (1) start syncing from scratch or (2) delete the blocks/rev* files and start a -reindex. In both cases, at any point in time, should the filesize of the blk* files be a multiple of 16 MiB and the rev* files a multiple of 1 MiB.
  4. BitcoinPullTester commented at 12:07 pm on January 28, 2013: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/2d5e0349e19eec9b4c322cdeab37cb0019551fb6 for binaries and test log.
  5. CodeShark commented at 2:42 pm on January 28, 2013: contributor
    The test succeeded under OS X Version 10.8.2
  6. gmaxwell commented at 6:01 pm on January 28, 2013: contributor
    Reindex test passes on Fedora 16/17. Needs windows testing.
  7. gavinandresen commented at 6:55 pm on January 28, 2013: contributor

    This is just an optimization, yes?

    I think it can wait for 0.8.1.

  8. sipa commented at 7:09 pm on January 28, 2013: member
    Indeed an optimization, but one that is easy to test. Ok for 0.8.1.
  9. jgarzik commented at 2:09 am on January 30, 2013: contributor

    Nit: use #elif

    ACK

  10. Native versions for AllocateFileRange() 288fdc092a
  11. sipa commented at 3:18 am on January 30, 2013: member
    Added a commit to drop the pre-allocated padding when finalizing a block file (=moving to a next one).
  12. gmaxwell commented at 3:23 am on January 30, 2013: contributor
    ah, good to not waste 30MiB…
  13. sipa commented at 3:25 am on January 30, 2013: member

    @gmaxwell Largest advantage is the ability to cat the files together to create a bootstrap.dat :)

    … though I’m sure people would otherwise complain about wasted disk space too :p

  14. Drop padding in blk* when finalizing file 1eb578796c
  15. BitcoinPullTester commented at 4:37 am on January 30, 2013: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/1eb578796c98f457546059b66eb98fd0efc8e690 for binaries and test log.
  16. laanwj commented at 7:08 pm on February 4, 2013: member
    ACK
  17. gavinandresen referenced this in commit b8f4e42e1b on Feb 22, 2013
  18. gavinandresen merged this on Feb 22, 2013
  19. gavinandresen closed this on Feb 22, 2013

  20. sipa deleted the branch on May 3, 2013
  21. laudney referenced this in commit 88f7b770f9 on Mar 19, 2014
  22. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me