rem: err = ENOMEM;
add: err = FS_ENOMEM;
context: sys_open_entry_ref(bool kernel, nspace_id device, vnode_id parent, const char *name,	int openMode, bool coe){    int             err;    vnode           *vn;    void            *cookie;    ofile           *f;    int             nfd;    op_open         *opo;    op_free_cookie  *opf;	err = get_file_vn(device, parent, name, TRUE, &vn);	if (err)		return err;	opo = vn->ns->fs->ops.open;	if (!opo) {		err = EINVAL;		goto error1;	}	err = (*opo)(vn->ns->data, vn->data, openMode, &cookie);	if (err)		goto error1;	/*	 *	find a file descriptor	 */	f = (ofile *)calloc(sizeof(ofile), 1);    if (!f) {		err = ENOMEM;		goto error2;	}	f->type = FD_FILE;	f->vn = vn;	f->cookie = cookie;	f->ocnt = 0;	f->rcnt = 0;	f->pos = 0;	f->omode = openMode;	nfd = new_fd(kernel, -1, f, -1, coe);	if (nfd < 0) {		err = EMFILE;		goto error3;	}	return nfd;error3:    free(f);error2:    (*vn->ns->fs->ops.close)(vn->ns->data, vn->data, cookie);    opf = vn->ns->fs->ops.free_cookie;    if (opf)        (*opf)(vn->ns->data, vn->data, cookie);error1:    dec_vnode(vn, FALSE);    return err;}