- snprintf(fid_name, sizeof(fid_name), "0x%lx", (unsigned long)ino);
-
- /* under ext3 this is neither supposed to return bad inodes nor NULL
- inodes. */
- result = ll_lookup_one_len(fid_name, mgs->mgs_fid_de, strlen(fid_name));
- if (IS_ERR(result))
- RETURN(result);
-
- inode = result->d_inode;
- if (!inode)
- RETURN(ERR_PTR(-ENOENT));
-
- if (inode->i_generation == 0 || inode->i_nlink == 0) {
- LCONSOLE_WARN("Found inode with zero generation or link -- this"
- " may indicate disk corruption (inode: %lu, link:"
- " %lu, count: %d)\n", inode->i_ino,
- (unsigned long)inode->i_nlink,
- atomic_read(&inode->i_count));
- l_dput(result);
- RETURN(ERR_PTR(-ENOENT));
- }
-
- if (gen && inode->i_generation != gen) {
- /* we didn't find the right inode.. */
- CDEBUG(D_INODE, "found wrong generation: inode %lu, link: %lu, "
- "count: %d, generation %u/%u\n", inode->i_ino,
- (unsigned long)inode->i_nlink,
- atomic_read(&inode->i_count),
- inode->i_generation, gen);
- l_dput(result);
- RETURN(ERR_PTR(-ENOENT));
- }
-
- RETURN(result);
-}