version 1.279, 2006/11/30 01:09:48 |
version 1.279.2.2, 2007/01/21 16:32:35 |
Line 2026 sys_unlink(struct lwp *l, void *v, regis |
|
Line 2026 sys_unlink(struct lwp *l, void *v, regis |
|
struct vnode *vp; |
struct vnode *vp; |
int error; |
int error; |
struct nameidata nd; |
struct nameidata nd; |
|
#if NVERIEXEC > 0 |
|
pathname_t pathbuf; |
|
#endif /* NVERIEXEC > 0 */ |
|
|
restart: |
restart: |
NDINIT(&nd, DELETE, LOCKPARENT | LOCKLEAF, UIO_USERSPACE, |
NDINIT(&nd, DELETE, LOCKPARENT | LOCKLEAF, UIO_USERSPACE, |
|
|
} |
} |
|
|
#if NVERIEXEC > 0 |
#if NVERIEXEC > 0 |
|
error = pathname_get(nd.ni_dirp, nd.ni_segflg, &pathbuf); |
|
|
/* Handle remove requests for veriexec entries. */ |
/* Handle remove requests for veriexec entries. */ |
if ((error = veriexec_removechk(vp, nd.ni_dirp, l)) != 0) { |
if (!error) { |
|
error = veriexec_removechk(vp, pathname_path(pathbuf), l); |
|
pathname_put(pathbuf); |
|
} |
|
|
|
if (error) { |
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); |
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); |
if (nd.ni_dvp == vp) |
if (nd.ni_dvp == vp) |
vrele(nd.ni_dvp); |
vrele(nd.ni_dvp); |
Line 3197 sys_fsync_range(struct lwp *l, void *v, |
|
Line 3207 sys_fsync_range(struct lwp *l, void *v, |
|
return (error); |
return (error); |
|
|
if ((fp->f_flag & FWRITE) == 0) { |
if ((fp->f_flag & FWRITE) == 0) { |
FILE_UNUSE(fp, l); |
error = EBADF; |
return (EBADF); |
goto out; |
} |
} |
|
|
flags = SCARG(uap, flags); |
flags = SCARG(uap, flags); |
if (((flags & (FDATASYNC | FFILESYNC)) == 0) || |
if (((flags & (FDATASYNC | FFILESYNC)) == 0) || |
((~flags & (FDATASYNC | FFILESYNC)) == 0)) { |
((~flags & (FDATASYNC | FFILESYNC)) == 0)) { |
return (EINVAL); |
error = EINVAL; |
|
goto out; |
} |
} |
/* Now set up the flags for value(s) to pass to VOP_FSYNC() */ |
/* Now set up the flags for value(s) to pass to VOP_FSYNC() */ |
if (flags & FDATASYNC) |
if (flags & FDATASYNC) |
Line 3220 sys_fsync_range(struct lwp *l, void *v, |
|
Line 3231 sys_fsync_range(struct lwp *l, void *v, |
|
s = SCARG(uap, start); |
s = SCARG(uap, start); |
e = s + len; |
e = s + len; |
if (e < s) { |
if (e < s) { |
FILE_UNUSE(fp, l); |
error = EINVAL; |
return (EINVAL); |
goto out; |
} |
} |
} else { |
} else { |
e = 0; |
e = 0; |
Line 3237 sys_fsync_range(struct lwp *l, void *v, |
|
Line 3248 sys_fsync_range(struct lwp *l, void *v, |
|
(*bioops.io_fsync)(vp, nflags); |
(*bioops.io_fsync)(vp, nflags); |
|
|
VOP_UNLOCK(vp, 0); |
VOP_UNLOCK(vp, 0); |
|
out: |
FILE_UNUSE(fp, l); |
FILE_UNUSE(fp, l); |
return (error); |
return (error); |
} |
} |
Line 3374 rename_files(const char *from, const cha |
|
Line 3386 rename_files(const char *from, const cha |
|
} |
} |
|
|
#if NVERIEXEC > 0 |
#if NVERIEXEC > 0 |
if (!error) |
if (!error) { |
error = veriexec_renamechk(fvp, fromnd.ni_dirp, tvp, |
pathname_t frompath, topath; |
tond.ni_dirp, l); |
|
|
error = pathname_get(fromnd.ni_dirp, fromnd.ni_segflg, |
|
&frompath); |
|
if (!error) |
|
error = pathname_get(tond.ni_dirp, tond.ni_segflg, |
|
&topath); |
|
if (!error) |
|
error = veriexec_renamechk(fvp, pathname_path(frompath), |
|
tvp, pathname_path(topath), l); |
|
|
|
pathname_put(frompath); |
|
pathname_put(topath); |
|
} |
#endif /* NVERIEXEC > 0 */ |
#endif /* NVERIEXEC > 0 */ |
|
|
out: |
out: |