Problem with files removing

Kolakowski, Mikolaj Mikolaj.Kolakowski at intel.com
Tue Feb 5 11:29:24 EST 2002


I have added d_delete call to jffs2_unlink, anybody could verify the code
below?
Will it work? 

static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry)
{
	struct jffs2_sb_info *c = JFFS2_SB_INFO(dir_i->i_sb);
	struct jffs2_inode_info *dir_f = JFFS2_INODE_INFO(dir_i);
	struct jffs2_inode_info *dead_f = JFFS2_INODE_INFO(dentry->d_inode);
	int ret;
    
	ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, 
			       dentry->d_name.len, dead_f);
	dentry->d_inode->i_nlink = dead_f->inocache->nlink;

  	if (!ret)                                                 
    	{
        		if (dentry->d_inode->i_data.nrpages)
            		truncate_inode_pages(&dentry->d_inode->i_data, 0);
        		d_delete(dentry);
    	}
	return ret;
}

Thanks
Mikolaj




More information about the linux-mtd mailing list