On Tue, 30 Oct 2007 07:13:46 +0800
"Yan Zheng" <[EMAIL PROTECTED]> wrote:
> 2007/10/30, Chris Mason <[EMAIL PROTECTED]>:
> > I made one small change here:
> > > @@ -238,7 +236,7 @@ insert:
> > > csum_offset = 0;
> > > if (found_next) {
> > > u64 tmp = min((u64)i_size_read(inode), next_offset);
> > > - tmp -= offset + root->sectorsize - 1;
> > > + tmp -= offset - root->sectorsize + 1;
> > tmp -= offset & ~((u64)root->sectorsize - 1);
>
> 'offset' is already aligned to sector size, so this line is
> equivalent to 'tmp -= offset'. I think it's better change this line
> to 'tmp = tmp - offset + root->sectorsize - 1'
In this case, we're calculating the number of csums we're going to
insert, and so it should include the csum for the block we were
passed. So, tmp -= offset is correct. The extra alignment is mostly
paranoia.
-chris
_______________________________________________
Btrfs-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/btrfs-devel