Re: [PATCH V3 10/17] Squashfs: cache operations

2009-01-07 Thread Geert Uytterhoeven
On Mon, 5 Jan 2009, Phillip Lougher wrote:
 diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c
 new file mode 100644
 index 000..f29eda1
 --- /dev/null
 +++ b/fs/squashfs/cache.c

 +/*
 + * Copy upto length bytes from cache entry to buffer starting at offset bytes
 + * into the cache entry.  If there's not length bytes then copy the number of
 + * bytes available.  In all cases return the number of bytes copied.
 + */
 +int squashfs_copy_data(void *buffer, struct squashfs_cache_entry *entry,
^
const?

It also makes it clear from the prototype in which direction is copied.
 + int offset, int length)
^^^ ^^^
 +{
 + int remaining = length;
^^^
Shouldn't all of these be unsigned int?

 +
 + if (length == 0)
 + return 0;
 + else if (buffer == NULL)
 + return min(length, entry-length - offset);
 +
 + while (offset  entry-length) {
 + void *buff = entry-data[offset / PAGE_CACHE_SIZE]
 + + (offset % PAGE_CACHE_SIZE);
 + int bytes = min_t(int, entry-length - offset,
 + PAGE_CACHE_SIZE - (offset % PAGE_CACHE_SIZE));
 +
 + if (bytes = remaining) {
 + memcpy(buffer, buff, remaining);
 + remaining = 0;
 + break;
 + }
 +
 + memcpy(buffer, buff, bytes);
 + buffer += bytes;
 + remaining -= bytes;
 + offset += bytes;
 + }
 +
 + return length - remaining;
 +}

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 01/17] Squashfs: inode operations

2009-01-07 Thread Geert Uytterhoeven
On Mon, 5 Jan 2009, Phillip Lougher wrote:
 diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c
 new file mode 100644
 index 000..7a63398
 --- /dev/null
 +++ b/fs/squashfs/inode.c
 @@ -0,0 +1,346 @@

 +int squashfs_read_inode(struct inode *inode, long long ino)
 +{
 + struct super_block *sb = inode-i_sb;
 + struct squashfs_sb_info *msblk = sb-s_fs_info;
 + u64 block = SQUASHFS_INODE_BLK(ino) + msblk-inode_table;
^^^

 + TRACE(File inode %x:%x, start_block %llx, block_list_start 
 
 + %llx, offset %x\n, SQUASHFS_INODE_BLK(ino),
 
 + offset, squashfs_i(inode)-start, block, offset);

Note that I get lots of

| warning: format '%llx' expects type 'long long unsigned int', but argument 3 
has type 'u64'

on ppc64, since you switched from `unsigned long long' to 'u64', as `u64' is
(still -- this is being changed) `unsigned long' on pp64.

I guess no action has to be taken, for now?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 01/17] Squashfs: inode operations

2009-01-07 Thread Stephen Rothwell
Hi Geert,

On Wed, 7 Jan 2009 19:00:24 +0100 (CET) Geert Uytterhoeven 
geert.uytterhoe...@sonycom.com wrote:

 Note that I get lots of
 
 | warning: format '%llx' expects type 'long long unsigned int', but argument 
 3 has type 'u64'
 
 on ppc64, since you switched from `unsigned long long' to 'u64', as `u64' is
 (still -- this is being changed) `unsigned long' on pp64.
 
 I guess no action has to be taken, for now?

Correct, as we are in the process of changing u64 to unsigned long long for
powerpc.
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgpjU8K9LPVQg.pgp
Description: PGP signature