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

From: Pekka Enberg
Date: Thu Dec 16 2010 - 06:46:14 EST


On 12/16/10 11:52 AM, stefani@xxxxxxxxxxx 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;
+}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/