On Wed, 2007-09-05 at 16:24 +0200, Jan Kara wrote: > On Tue 04-09-07 12:01:53, Andreas Dilger wrote: > > On Sep 03, 2007 20:03 +0200, Jan Kara wrote: > > > I've finally got to writing up some proposal how could look system calls > > > allowing for online filesystem defragmentation and generally moving file > > > blocks around for improving performance. Comments are welcome. > > > > > > int sys_movedata(int datafd, int spacefd, loff_t from, size_t len) > > > The call takes blocks used to carry data starting at offset @from of length > > > @len in @spacefd and places them instead of corresponding blocks in @datafd. > > > > Calling these "@spacefd" and "@datafd" is a bit confusing. How about "@srcfd" > > and "@tgtfd" instead? For defragmentation, are you planning to have @datafd > > be the "real" inode and "@spacefd" be the temporary inode with defragged data, > > or the reverse? It isn't really clear. > The idea behind the names was that you move data from @datafd into blocks > provided by @spacefd. Calling it @srcfd and @tgtfd has the problem whether > you mean source of data or source of blocks... FWIW, I think @srcfd and @tgtfd are clearer. When I think about changing the block on the disk that's associated with a block's worth of data in a file, I think about scooping the file data out of the source block and setting it down in the destination block. I do not think about pulling the on-disk block out from under the data and replacing it with a different on-disk block. Cheers, Eric
Attachment:
signature.asc
Description: This is a digitally signed message part