-/* $OpenBSD: fuse_lookup.c,v 1.12 2016/08/12 20:18:44 natano Exp $ */
+/* $OpenBSD: fuse_lookup.c,v 1.13 2016/08/16 21:32:58 natano Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
(cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME))
return (EROFS);
- if ((error = cache_lookup(vdp, vpp, cnp)) >= 0)
- return (error);
-
if (flags & ISDOTDOT) {
/* got ".." */
nid = dp->parent;
* Write access to directory required to delete files.
*/
error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc);
- if (error != 0) {
- fb_delete(fbuf);
- return (error);
- }
+ if (error)
+ goto out;
cnp->cn_flags |= SAVENAME;
}
/*
* Write access to directory required to delete files.
*/
- if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) {
- fb_delete(fbuf);
- return (error);
- }
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
+ goto out;
if (nid == VTOI(vdp)->ufs_ino.i_number) {
error = EISDIR;
update_vattr(fmp->mp, &fbuf->fb_vattr);
- if (error) {
- fb_delete(fbuf);
- return (error);
- }
+ if (error)
+ goto out;
if (vdp != NULL && vdp->v_type == VDIR)
VTOI(tdp)->parent = dp->ufs_ino.i_number;
}
out:
- if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE &&
- nameiop != DELETE)
- cache_enter(vdp, *vpp, cnp);
-
fb_delete(fbuf);
return (error);
}
-/* $OpenBSD: fuse_vnops.c,v 1.29 2016/08/12 20:18:44 natano Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.30 2016/08/16 21:32:58 natano Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
* Remove the inode from its hash chain.
*/
ufs_ihashrem(&ip->ufs_ino);
- cache_purge(vp);
free(ip, M_FUSEFS, 0);
vp->v_data = NULL;
goto out;
}
- cache_purge(dvp);
vput(dvp);
dvp = NULL;
- cache_purge(ITOV(ip));
fb_delete(fbuf);
out:
if (dvp)