Hi folks

On Tuesday 17 April 2007 11:49, Darren J Moffat wrote:
> Leonardo Francalanci wrote:
> > Hi,
> >
> > regarding ZFS compression method: what happens when a compressed file is
> > udpated/appended? Is it ALL un-compressed first, updated/appended and
> > then re-compressed? Or only the affected blocks are uncompressed and
> > then recompressed?
>
> ZFS does NOT compress files.  It compresses the individual blocks that
> are written to comprise the file.
>
> What this means is if you have a 10G file and you need to change one
> small part in the middle you seek(2) to that point, read(2) the data
> make your change to your in memory copy and write(2) it back out again.
>   ZFS will update (and recompress) only those blocks that actual need to
> get changed.

How can this work?  With compressed data, its hard to predict its final size 
before compression.  How is the seek(2) accurate? How can the seek know where 
the uncompressed block (say) 345 is after the data is compressed? It will be 
physically on a different actual block...??. or I probably dont understand 
how compression with ZFS works.... ;-)

Or - does it compress an 8k block into a smaller 6 or 4K block, but with the 
same block number, and so the seek to a block will still work, but less disk 
space is taken up ?

Regards
Jerome
 

-- 
Jerome Haynes-Smith
Sun TSC Storage Backline


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain
confidential and privileged information. Any unauthorized review, use,
disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the
sender by reply email and
destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to