• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to read files from disk directly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read files from disk directly?


  • Subject: Re: How to read files from disk directly?
  • From: Mark Day <email@hidden>
  • Date: Tue, 5 Jul 2011 17:09:49 -0700

On Jul 5, 2011, at 4:53 PM, Wim Lewis wrote:

Also, I don't remember whether HFS+ works this way, but on some filesystems the inode number corresponds to its location on disk, and file contents are preferentially stored near their inodes;

No, HFS doesn't work this way.  inode numbers are just unique IDs that are generated sequentially (with the potential for wraparound).

if you sort your work queue by inode, that might increase locality of reads from the disk.

That would probably better than reading files in some random order, but for a different reason.  HFS maintains a persistent "next allocation pointer" that hints where to look next when doing an allocation.  If your disk has sufficiently contiguous free space, and you tend to write files all at once (as most files are), then by coincidence, files with nearby inode numbers will tend to be allocated nearby.  And in fact, HFS prefers to allocate a file contiguously, even if that means placing it somewhere far away from the "next allocation" pointer.

The allocator's behavior could change in the future, so please don't depend on it.

-Mark

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: How to read files from disk directly? (From: Ken Hornstein <email@hidden>)
 >Re: How to read files from disk directly? (From: Eric Gorr <email@hidden>)
 >Re: How to read files from disk directly? (From: Shantonu Sen <email@hidden>)
 >Re: How to read files from disk directly? (From: Eric Gorr <email@hidden>)
 >Re: How to read files from disk directly? (From: Gregg Wonderly <email@hidden>)
 >Re: How to read files from disk directly? (From: Wim Lewis <email@hidden>)

  • Prev by Date: Re: How to read files from disk directly?
  • Next by Date: Problem with fcntl/F_LOG2PHYS (was: Re: How to read files from disk directly?)
  • Previous by thread: Re: How to read files from disk directly?
  • Next by thread: Re: How to read files from disk directly?
  • Index(es):
    • Date
    • Thread