Exemple #1
0
/* all filling in of inodes postponed until lookup */
static void coda_read_inode(struct inode *inode)
{
	struct coda_sb_info *sbi = coda_sbp(inode->i_sb);
	struct coda_inode_info *cii;

        if (!sbi) BUG();

#if 0
	/* check if the inode is already initialized */
	if (inode->u.generic_ip) {
            printk("coda_read_inode: initialized inode");
            return;
        }

	inode->u.generic_ip = cii_alloc();
	if (!inode->u.generic_ip) {
		CDEBUG(D_CNODE, "coda_read_inode: failed to allocate inode info\n");
		make_bad_inode(inode);
		return;
	}
	memset(inode->u.generic_ip, 0, sizeof(struct coda_inode_info));
#endif

	cii = ITOC(inode);
	if (!coda_isnullfid(&cii->c_fid)) {
            printk("coda_read_inode: initialized inode");
            return;
        }

	list_add(&cii->c_cilist, &sbi->sbi_cihead);
}
Exemple #2
0
static void coda_put_super(struct super_block *sb)
{
        struct coda_sb_info *sbi;

	sbi = coda_sbp(sb);
	sbi->sbi_vcomm->vc_sb = NULL;
        list_del_init(&sbi->sbi_cihead);

	printk("Coda: Bye bye.\n");
	kfree(sbi);
}
Exemple #3
0
/* all filling in of inodes postponed until lookup */
static void coda_read_inode(struct inode *inode)
{
	struct coda_sb_info *sbi = coda_sbp(inode->i_sb);
	struct coda_inode_info *cii;

        if (!sbi) BUG();

	cii = ITOC(inode);
	if (!coda_isnullfid(&cii->c_fid)) {
            printk("coda_read_inode: initialized inode");
            return;
        }

	cii->c_mapcount = 0;
	list_add(&cii->c_cilist, &sbi->sbi_cihead);
}
Exemple #4
0
/* 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
*/
int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
{
        struct coda_inode_info *cnp;
	struct coda_sb_info *sbi= coda_sbp(sb);
        struct coda_vattr attr;
        int error;
	ino_t ino;
        
        ENTRY;

        /* 
	 * We get inode numbers from Venus -- see venus source
	 */

	error = venus_getattr(sb, fid, &attr);
	if ( error ) {
	    CDEBUG(D_CNODE, 
		   "coda_cnode_make: coda_getvattr returned %d for %s.\n", 
		   error, coda_f2s(fid));
	    *inode = NULL;
	    return error;
	} 

	ino = attr.va_fileid;
        *inode = iget(sb, ino);
        if ( !*inode ) {
                printk("coda_cnode_make: iget failed\n");
                return -ENOMEM;
        }

	cnp = ITOC(*inode);
	/* see if we've got it already */
	if  ( cnp->c_magic != 0 && coda_fideq(fid, &cnp->c_fid)) {
		/* replace the attributes, type might have changed */
		coda_fill_inode(*inode, &attr);
		return 0;
	}

	/* not fresh: collision */
	if  ( cnp->c_magic != 0 ) {
               printk("coda_cnode_make on initialized inode %ld, old %s new
%s!\n",
                      (*inode)->i_ino, coda_f2s(&cnp->c_fid), coda_f2s2(fid));
               iput(*inode);
               return -ENOENT;
        }
Exemple #5
0
/* all filling in of inodes postponed until lookup */
static void coda_read_inode(struct inode *inode)
{
	struct coda_sb_info *sbi = coda_sbp(inode->i_sb);
	struct coda_inode_info *cii;
	ENTRY;

        if (!sbi) BUG();

	cii = ITOC(inode);
        if (cii->c_magic == CODA_CNODE_MAGIC) {
            printk("coda_read_inode: initialized inode");
            return;
        }

	memset(cii, 0, sizeof(struct coda_inode_info));
	list_add(&cii->c_cilist, &sbi->sbi_cihead);
        cii->c_magic = CODA_CNODE_MAGIC;
}
Exemple #6
0
static void coda_put_super(struct super_block *sb)
{
    struct coda_sb_info *sb_info;

    ENTRY;


    sb->s_dev = 0;
    coda_cache_clear_all(sb);
    sb_info = coda_sbp(sb);
    sb_info->sbi_vcomm->vc_inuse = 0;
    coda_super_info.sbi_sb = NULL;
    printk("Coda: Bye bye.\n");
    memset(sb_info, 0, sizeof(* sb_info));

    MOD_DEC_USE_COUNT;
    EXIT;
}