A way to update revalidated metadata

From: Yee Man Chan <ymc@dont-contact.us>
Date: Thu, 8 Aug 2002 22:50:30 -0700 (PDT)

Recently when I was hacking squid, I find a need to
update the metadata. Then I come up with a thought
that might allow us to update the revalidated
metadata.

The idea is to fix a certain amount of space in the
beginning of a swap object for metadata.

Here is a solution for UFS:

1. Remove O_APPEND from file_open

2. Change the lseek in diskHandleWrite to use SEEK_END
instead of SEEK_SET. If offset is -1, we make lseek
goes to 0.

    if (fdd->write_q->file_offset != -1)
        len = lseek(fd, fdd->write_q->file_offset,
SEEK_END);
    else
        len = lseek(fd, 0, SEEK_END);

3. This won't change the interface of diskHandleWrite
and it works with existing code but it also allow us
to do write to any place in the file. We can do this
by

storeWrite(sio, buf, len,
write_offset-swapout.queue_offset-swap_hdr_sz,
xfree);

where write_offset is the location we want to start
overwriting the original data.

    If we made this changes and we define a fixed
amount of space for metadata, then we should be able
to update it after revalidation. What do you guys
think?

Yee Man

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
Received on Thu Aug 08 2002 - 23:50:37 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:16:01 MST