[lkml]   [2001]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectdevice ordered files (for backups etc)
While reading the "getting fs access events" thread I remembered
something which I've been meaning to look at for ages.

[some history]
I don't trust programs which dump file systems by reading the data
directly from the block device (I'm never sure that they get things
right). I prefer to do backups through the standard fs interfaces (so
logically we do 2 steps, make a list of files and then archive them).

However, this does mean that the order of real block reads may not be
very good (since files may accessed in an order which doesn't minimise
seeks). Ignoring the problem of files with blocks spread far apart,
it seems clear that mapping the file to a rough index into the device
and ordering the reading of the files by this index ought to reduce
the seeks.

Now most systems provide no interface for this (pity), though Linux
does through the FIBMAP ioctl() (for fs which support bmap at least).
However to use this we need to open() all the files get the block
index, sort them and then reopen the files in the right order.

There is also the problem that we are (indirectly) reading the
directories to do the readdir()/lstat() etc in some arbitrary order,
so causing more seeks.

Is there some trick I'm missing or is there really no way to avoid
these seek penalty and go through the standard fs interfaces?

-- Jon
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:53    [W:0.097 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site