new_dentry->d_name.name, new_dentry->d_name.len); 
new_dentry->d_name.name, new_dentry->d_name.len, now); 
static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,                        struct inode *new_dir_i, struct dentry *new_dentry){	int ret;	struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb);	struct jffs2_inode_info *victim_f = NULL;	uint8_t type;	/* The VFS will check for us and prevent trying to rename a 	 * file over a directory and vice versa, but if it's a directory,	 * the VFS can't check whether the victim is empty. The filesystem	 * needs to do that for itself.	 */	if (new_dentry->d_inode) {		victim_f = JFFS2_INODE_INFO(new_dentry->d_inode);		if (S_ISDIR(new_dentry->d_inode->i_mode)) {			struct jffs2_full_dirent *fd;			down(&victim_f->sem);			for (fd = victim_f->dents; fd; fd = fd->next) {				if (fd->ino) {					up(&victim_f->sem);					return -ENOTEMPTY;				}			}			up(&victim_f->sem);		}	}	/* XXX: We probably ought to alloc enough space for	   both nodes at the same time. Writing the new link, 	   then getting -ENOSPC, is quite bad :)	*/	/* Make a hard link */		/* XXX: This is ugly */	type = (old_dentry->d_inode->i_mode & S_IFMT) >> 12;	if (!type) type = DT_REG;	ret = jffs2_do_link(c, JFFS2_INODE_INFO(new_dir_i), 			    old_dentry->d_inode->i_ino, type,			    new_dentry->d_name.name, new_dentry->d_name.len);	if (ret)		return ret;	if (victim_f) {		/* There was a victim. Kill it off nicely */		new_dentry->d_inode->i_nlink--;		/* Don't oops if the victim was a dirent pointing to an		   inode which didn't exist. */		if (victim_f->inocache) {			down(&victim_f->sem);			victim_f->inocache->nlink--;			up(&victim_f->sem);		}	}	/* If it was a directory we moved, and there was no victim, 	   increase i_nlink on its new parent */	if (S_ISDIR(old_dentry->d_inode->i_mode) && !victim_f)		new_dir_i->i_nlink++;	/* Unlink the original */	ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), 		      old_dentry->d_name.name, old_dentry->d_name.len, NULL);	/* We don't touch inode->i_nlink */	if (ret) {		/* Oh shit. We really ought to make a single node which can do both atomically */		struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode);		down(&f->sem);		old_dentry->d_inode->i_nlink++;		if (f->inocache)			f->inocache->nlink++;		up(&f->sem);		printk(KERN_NOTICE "jffs2_rename(): Link succeeded, unlink failed (err %d). You now have a hard link\n", ret);		/* Might as well let the VFS know */		d_instantiate(new_dentry, old_dentry->d_inode);		atomic_inc(&old_dentry->d_inode->i_count);		return ret;	}	if (S_ISDIR(old_dentry->d_inode->i_mode))		old_dir_i->i_nlink--;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3a69e0cd22cf34920508a4032d53e41251925f53/dir.c/buggy/fs/jffs2/dir.c