Re: [PATCH] cramfs: generate unique inode number for better inode cache usage

Pekka Enberg
2010-12-16T11:46:01Z

On 12/16/10 11:52 AM, stefani@seibold.net wrote:
> +static unsigned long cramino(struct cramfs_inode * cino, unsigned int offset)
> +{
> + if (!cino->offset)
> + return offset + 1;
> + if (!cino->size)
> + return offset + 1;
> +
> + /* the mode test fix buggy mkcramfs implementations */

I'm getting into the bikeshedding territory but a less terse comment
would be in order here, I think.

> + switch (cino->mode& S_IFMT) {
> + case S_IFREG:
> + case S_IFDIR:
> + case S_IFLNK:
> + return cino->offset<< 2;
> + default:
> + break;
> + }
> + return offset + 1;
> +}