lkml.org 
[lkml]   [2010]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cramfs: generate unique inode number for better inode cache usage
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;
> +}



\
 
 \ /
  Last update: 2010-12-16 12:49    [W:0.059 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site