Re: A way to update revalidated metadata

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 11 Aug 2002 00:36:11 +0200

Good idea, but it needs to be addressed from the API side first to
separate the object into three components:

  a) Metadata
  b) MIME headers (maybe move into metadata)
  c) Object content

Simply defining that an object may be opened read-write and allow
overwriting is not a good approach. Instead there needs to be "FS"
API operations for the kind of object modifications you need to do.

Also keep in mind that there may be other clients using the same
object at the same time, and you need to consider if/when/how these
clients should see the updates, and the effect on these.

Regards
Henrik

On Friday 09 August 2002 07.50, Yee Man Chan wrote:
> 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 Sat Aug 10 2002 - 17:37:09 MDT

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