tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Vnode API change: add global vnode cache



Hello!
Can you consider possibility integration global vnode cache with
one more generic FS function genfs_lookup().
genfs_lookup can be used by other FS, if FS no need something exotic.
Interface for genfs_lookup() can be next:

/*
 * Call back function for initiate new created vnode (vnode / fs node pair).
 */
int
fs_fill_vnode(struct mount *mp, ino_t fileno, struct vnode *vp) {
        ....
        vp->data = ...
        vp->v_op = ...
        vp->v_tag = ...
        ....
}

/*
 * Called from mount() for initiate new instance genfs_lookup for new mp.
 */
int
genfs_init_lookup(struct mount *mp,
        int (fillvnode)(struct mount *, ino_t, struct vnode *), /* 
&fs_fill_vnode() */
        int (*readdir)(void *)) {
}
/*
 * Called from unmount() for destroy instance genfs_lookup for mp.
 */
int
genfs_remove_lookup(struct mount *mp) {
}

/*
 * Generic lookup for FSs.
 */
int
genfs_lookup(void * v){
        ...
        find fileno with the help of readdir() for vpp
        try find vnode for this fileno in cache
        vcache_lookup(struct mount *mp, void *fileno, size_t ino_t, struct 
vnode **vpp)
        if found not new vnode goto return
        else
        get and initiate new vnode(vnode / fs node pair) with call back
        fillvnode()
return:
        ....
        maybe vget, vref, VOP_UNLOCK(*vpp) ... what need
        return 0;
}

Thanks in advance.
Ilia.



Home | Main Index | Thread Index | Old Index