if (inode->i_state & I_NEW) {
cii = ITOC(inode); /* we still need to set i_ino for things like stat(2) */
inode->i_ino = hash; /* inode is locked and unique, no need to grab cii->c_lock */
cii->c_mapcount = 0;
coda_fill_inode(inode, attr);
unlock_new_inode(inode);
} elseif ((inode->i_mode & S_IFMT) != inode_type) { /* Inode has changed type, mark bad and grab a new one */
remove_inode_hash(inode);
coda_flag_inode(inode, C_PURGE);
iput(inode); goto retry;
} return inode;
}
/* this is effectively coda_iget: - get attributes (might be cached) - get the inode for the fid using vfs iget - link the two up if this is needed - fill in the attributes
*/ struct inode *coda_cnode_make(struct CodaFid *fid, struct super_block *sb)
{ struct coda_vattr attr; struct inode *inode; int error;
/* We get inode numbers from Venus -- see venus source */
error = venus_getattr(sb, fid, &attr); if (error) return ERR_PTR(error);
/* Although we treat Coda file identifiers as immutable, there is one * special case for files created during a disconnection where they may * not be globally unique. When an identifier collision is detected we * first try to flush the cached inode from the kernel and finally * resort to renaming/rehashing in-place. Userspace remembers both old * and new values of the identifier to handle any in-flight upcalls. * The real solution is to use globally unique UUIDs as identifiers, but
* retrofitting the existing userspace code for this is non-trivial. */ void coda_replace_fid(struct inode *inode, struct CodaFid *oldfid, struct CodaFid *newfid)
{ struct coda_inode_info *cii = ITOC(inode); unsignedlong hash = coda_f2i(newfid);
BUG_ON(!coda_fideq(&cii->c_fid, oldfid));
/* replace fid and rehash inode */ /* XXX we probably need to hold some lock here! */
remove_inode_hash(inode);
cii->c_fid = *newfid;
inode->i_ino = hash;
__insert_inode_hash(inode, hash);
}
/* convert a fid to an inode. */ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
{ struct inode *inode; unsignedlong hash = coda_f2i(fid);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.