Beispiel #1
0
int coda_notify_change(struct dentry *de, struct iattr *iattr)
{
	struct inode *inode = de->d_inode;
        struct coda_vattr vattr;
        int error;
	
	ENTRY;
        memset(&vattr, 0, sizeof(vattr)); 

        coda_iattr_to_vattr(iattr, &vattr);
        vattr.va_type = C_VNON; /* cannot set type */
	CDEBUG(D_SUPER, "vattr.va_mode %o\n", vattr.va_mode);

	/* Venus is responsible for truncating the container-file!!! */
	error = venus_setattr(inode->i_sb, coda_i2f(inode), &vattr);

	if ( !error ) {
	        coda_vattr_to_iattr(inode, &vattr); 
		coda_cache_clear_inode(inode);
	}
	CDEBUG(D_SUPER, "inode.i_mode %o, error %d\n", inode->i_mode, error);

	EXIT;
	return error;
}
Beispiel #2
0
static void coda_clear_inode(struct inode *inode)
{
	struct coda_inode_info *cii = ITOC(inode);
        struct inode *open_inode;

        ENTRY;
        CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n", 
	       inode->i_ino, atomic_read(&inode->i_count));        

	if ( cii->c_magic != CODA_CNODE_MAGIC )
                return;

        list_del_init(&cii->c_cilist);

	if ( inode->i_ino == CTL_INO )
		goto out;

	if ( inode->i_mapping != &inode->i_data ) {
		open_inode = inode->i_mapping->host;
                CDEBUG(D_SUPER, "DELINO cached file: ino %ld count %d.\n",  
			open_inode->i_ino,  atomic_read(&open_inode->i_count));
		inode->i_mapping = &inode->i_data;
		iput(open_inode);
        }
	
	CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);
	coda_cache_clear_inode(inode);
out:
	inode->u.coda_i.c_magic = 0;
	memset(&inode->u.coda_i.c_fid, 0, sizeof(struct ViceFid));
	EXIT;
}
Beispiel #3
0
static int  coda_notify_change(struct dentry *de, struct iattr *iattr)
{
    struct inode *inode = de->d_inode;
    struct coda_inode_info *cii;
    struct coda_vattr vattr;
    int error;

    ENTRY;
    memset(&vattr, 0, sizeof(vattr));
    cii = ITOC(inode);
    CHECK_CNODE(cii);

    coda_iattr_to_vattr(iattr, &vattr);
    vattr.va_type = C_VNON; /* cannot set type */
    CDEBUG(D_SUPER, "vattr.va_mode %o\n", vattr.va_mode);

    error = venus_setattr(inode->i_sb, &cii->c_fid, &vattr);

    if ( !error ) {
        coda_vattr_to_iattr(inode, &vattr);
        coda_cache_clear_inode(inode);
    }
    CDEBUG(D_SUPER, "inode.i_mode %o, error %d\n",
           inode->i_mode, error);

    EXIT;
    return error;
}
Beispiel #4
0
static void coda_delete_inode(struct inode *inode)
{
    struct coda_inode_info *cii;
    struct inode *open_inode;

    ENTRY;
    CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n",
           inode->i_ino, inode->i_count);

    cii = ITOC(inode);
    if ( inode->i_ino == CTL_INO || cii->c_magic != CODA_CNODE_MAGIC ) {
        clear_inode(inode);
        return;
    }


    if ( ! list_empty(&cii->c_volrootlist) )
        list_del(&cii->c_volrootlist);

    open_inode = cii->c_ovp;
    if ( open_inode ) {
        CDEBUG(D_SUPER, "DELINO cached file: ino %ld count %d.\n",
               open_inode->i_ino,  open_inode->i_count);
        cii->c_ovp = NULL;
        iput(open_inode);
    }

    coda_cache_clear_inode(inode);
    CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);
    inode->u.generic_ip = NULL;
    clear_inode(inode);
    EXIT;
}
Beispiel #5
0
static void coda_clear_inode(struct inode *inode)
{
	struct coda_inode_info *cii = ITOC(inode);

        CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n", 
	       inode->i_ino, atomic_read(&inode->i_count));        
	CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);

        list_del_init(&cii->c_cilist);
	coda_cache_clear_inode(inode);
}
Beispiel #6
0
static void coda_clear_inode(struct inode *inode)
{
	struct coda_inode_info *cii = ITOC(inode);

        CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n", 
	       inode->i_ino, atomic_read(&inode->i_count));        
	CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);

	if (cii->c_container) BUG();
	
        list_del_init(&cii->c_cilist);
	inode->i_mapping = &inode->i_data;
	coda_cache_clear_inode(inode);

#if 0
	cii_free(inode->u.generic_ip);
	inode->u.generic_ip = NULL;
#endif
}
Beispiel #7
0
int coda_setattr(struct dentry *de, struct iattr *iattr)
{
	struct inode *inode = de->d_inode;
	struct coda_vattr vattr;
	int error;

	memset(&vattr, 0, sizeof(vattr)); 

	inode->i_ctime = CURRENT_TIME_SEC;
	coda_iattr_to_vattr(iattr, &vattr);
	vattr.va_type = C_VNON; /* cannot set type */

	/* Venus is responsible for truncating the container-file!!! */
	error = venus_setattr(inode->i_sb, coda_i2f(inode), &vattr);

	if (!error) {
	        coda_vattr_to_iattr(inode, &vattr); 
		coda_cache_clear_inode(inode);
	}
	return error;
}
Beispiel #8
0
static void coda_evict_inode(struct inode *inode)
{
	truncate_inode_pages(&inode->i_data, 0);
	end_writeback(inode);
	coda_cache_clear_inode(inode);
}
Beispiel #9
0
static void coda_evict_inode(struct inode *inode)
{
	truncate_inode_pages_final(&inode->i_data);
	clear_inode(inode);
	coda_cache_clear_inode(inode);
}