const char *name, int namelen, struct jffs2_inode_info *dead_f) 
const char *name, int namelen, struct jffs2_inode_info *dead_f, uint32_t time) 
int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,		    const char *name, int namelen, struct jffs2_inode_info *dead_f){	struct jffs2_raw_dirent *rd;	struct jffs2_full_dirent *fd;	uint32_t alloclen, phys_ofs;	int ret;	if (1 /* alternative branch needs testing */ || 	    !jffs2_can_mark_obsolete(c)) {		/* We can't mark stuff obsolete on the medium. We need to write a deletion dirent */		rd = jffs2_alloc_raw_dirent();		if (!rd)			return -ENOMEM;		ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_DELETION);		if (ret) {			jffs2_free_raw_dirent(rd);			return ret;		}		down(&dir_f->sem);		/* Build a deletion node */		rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);		rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT);		rd->totlen = cpu_to_je32(sizeof(*rd) + namelen);		rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4));				rd->pino = cpu_to_je32(dir_f->inocache->ino);		rd->version = cpu_to_je32(++dir_f->highest_version);		rd->ino = cpu_to_je32(0);		rd->mctime = cpu_to_je32(get_seconds());		rd->nsize = namelen;		rd->type = DT_UNKNOWN;		rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));		rd->name_crc = cpu_to_je32(crc32(0, name, namelen));		fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, phys_ofs, ALLOC_DELETION);				jffs2_free_raw_dirent(rd);		if (IS_ERR(fd)) {			jffs2_complete_reservation(c);			up(&dir_f->sem);			return PTR_ERR(fd);		}		/* File it. This will mark the old one obsolete. */		jffs2_add_fd_to_list(c, fd, &dir_f->dents);		up(&dir_f->sem);	} else {		struct jffs2_full_dirent **prev = &dir_f->dents;		uint32_t nhash = full_name_hash(name, namelen);		down(&dir_f->sem);		while ((*prev) && (*prev)->nhash <= nhash) {			if ((*prev)->nhash == nhash && 			    !memcmp((*prev)->name, name, namelen) &&			    !(*prev)->name[namelen]) {				struct jffs2_full_dirent *this = *prev;				D1(printk(KERN_DEBUG "Marking old dirent node (ino #%u) @%08x obsolete\n",					  this->ino, ref_offset(this->raw)));				*prev = this->next;				jffs2_mark_node_obsolete(c, (this->raw));				jffs2_free_full_dirent(this);				break;			}			prev = &((*prev)->next);		}		up(&dir_f->sem);	}	/* dead_f is NULL if this was a rename not a real unlink */	/* Also catch the !f->inocache case, where there was a dirent	   pointing to an inode which didn't exist. */	if (dead_f && dead_f->inocache) { 		down(&dead_f->sem);		if (S_ISDIR(OFNI_EDONI_2SFFJ(dead_f)->i_mode)) {			while (dead_f->dents) {				/* There can be only deleted ones */				fd = dead_f->dents;								dead_f->dents = fd->next;								if (fd->ino) {					printk(KERN_WARNING "Deleting inode #%u with active dentry \"%s\"->ino #%u\n",					       dead_f->inocache->ino, fd->name, fd->ino);				} else {					D1(printk(KERN_DEBUG "Removing deletion dirent for \"%s\" from dir ino #%u\n",						fd->name, dead_f->inocache->ino));				}				jffs2_mark_node_obsolete(c, fd->raw);				jffs2_free_full_dirent(fd);			}		}		dead_f->inocache->nlink--;		/* NB: Caller must set inode nlink if appropriate */		up(&dead_f->sem);	}	jffs2_complete_reservation(c);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3a69e0cd22cf34920508a4032d53e41251925f53/write.c/clean/fs/jffs2/write.c