From 0fda09a56aaf8105c7c5cb0326d0c8fcec6fc04c Mon Sep 17 00:00:00 2001 From: Eric Mei Date: Mon, 6 Dec 2010 15:50:07 -0700 Subject: [PATCH 1/1] b=20563 fix fid_flatten32(). a=andreas.dilger r=eric.mei r=di.wang r=vitaly.fertman --- lustre/include/lustre_fid.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lustre/include/lustre_fid.h b/lustre/include/lustre_fid.h index 1c48f89..f8aba33 100644 --- a/lustre/include/lustre_fid.h +++ b/lustre/include/lustre_fid.h @@ -363,15 +363,14 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid) seq = fid_seq(fid) - FID_SEQ_START; - /* - map the high bits of the OID into higher bits of the inode number so that - inodes generated at about the same time have a reduced chance of collisions. - This will give a period of 1024 clients and 128 k = 128M inodes without collisions. - */ - + /* Map the high bits of the OID into higher bits of the inode number so + * that inodes generated at about the same time have a reduced chance + * of collisions. This will give a period of 2^12 = 1024 unique clients + * (from SEQ) and up to min(LUSTRE_SEQ_MAX_WIDTH, 2^20) = 128k objects + * (from OID), or up to 128M inodes without collisions for new files. */ ino = ((seq & 0x000fffffULL) << 12) + ((seq >> 8) & 0xfffff000) + (seq >> (64 - (40-8)) & 0xffffff00) + - (fid_oid(fid) & 0xff000fff) + ((fid_oid(fid) & 0x00fff000) << 16); + (fid_oid(fid) & 0xff000fff) + ((fid_oid(fid) & 0x00fff000) << 8); RETURN(ino ? ino : fid_oid(fid)); } -- 1.8.3.1