fid->fid = newfid; fid->fidopen = 0; fid->v9ses = v9ses; 
static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,				      struct nameidata *nameidata){	struct super_block *sb;	struct v9fs_session_info *v9ses;	struct v9fs_fid *dirfid;	struct v9fs_fid *fid;	struct inode *inode;	struct v9fs_fcall *fcall = NULL;	struct stat newstat;	int dirfidnum = -1;	int newfid = -1;	int result = 0;	dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",		dir, dentry->d_iname, dentry, nameidata);	sb = dir->i_sb;	v9ses = v9fs_inode2v9ses(dir);	dirfid = v9fs_fid_lookup(dentry->d_parent, FID_WALK);	if (!dirfid) {		dprintk(DEBUG_ERROR, "no dirfid\n");		return ERR_PTR(-EINVAL);	}	dirfidnum = dirfid->fid;	if (dirfidnum < 0) {		dprintk(DEBUG_ERROR, "no dirfid for inode %p, #%lu\n",			dir, dir->i_ino);		return ERR_PTR(-EBADF);	}	newfid = v9fs_get_idpool(&v9ses->fidpool);	if (newfid < 0) {		eprintk(KERN_WARNING, "newfid fails!\n");		return ERR_PTR(-ENOSPC);	}	result =	    v9fs_t_walk(v9ses, dirfidnum, newfid, (char *)dentry->d_name.name,			NULL);	if (result < 0) {		v9fs_put_idpool(newfid, &v9ses->fidpool);		if (result == -ENOENT) {			d_add(dentry, NULL);			dprintk(DEBUG_ERROR,				"Return negative dentry %p count %d\n",				dentry, atomic_read(&dentry->d_count));			return NULL;		}		dprintk(DEBUG_ERROR, "walk error:%d\n", result);		goto FreeFcall;	}	result = v9fs_t_stat(v9ses, newfid, &fcall);	if (result < 0) {		dprintk(DEBUG_ERROR, "stat error\n");		goto FreeFcall;	}	v9fs_mistat2unix(fcall->params.rstat.stat, &newstat, sb);	inode = v9fs_get_inode(sb, newstat.st_mode);	if (IS_ERR(inode) && (PTR_ERR(inode) == -ENOSPC)) {		eprintk(KERN_WARNING, "inode alloc failes, returns %ld\n",			PTR_ERR(inode));		result = -ENOSPC;		goto FreeFcall;	}	inode->i_ino = v9fs_qid2ino(&fcall->params.rstat.stat->qid);	fid = v9fs_fid_create(dentry);	if (fid == NULL) {		dprintk(DEBUG_ERROR, "couldn't insert\n");		result = -ENOMEM;		goto FreeFcall;	}	fid->fid = newfid;	fid->fidopen = 0;	fid->v9ses = v9ses;	fid->qid = fcall->params.rstat.stat->qid;	dentry->d_op = &v9fs_dentry_operations;	v9fs_mistat2inode(fcall->params.rstat.stat, inode, inode->i_sb);	d_add(dentry, inode);	kfree(fcall);	return NULL;      FreeFcall:	kfree(fcall);	return ERR_PTR(result);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0b8dd17762194ec77066d339e0b2866b0c66b715/vfs_inode.c/buggy/fs/9p/vfs_inode.c