Lines Matching refs:error

111 	int error, mntflag = 0;
119 if ((error = suser(p)))
120 return (error);
125 error = copyinstr(SCARG(uap, path), fspath, MNAMELEN, NULL);
126 if (error)
127 return(error);
133 if ((error = namei(&nd)) != 0)
139 error = EINVAL;
146 error = copyin(SCARG(uap, data), args, vfsp->vfc_datasize);
147 if (error) {
160 error = EOPNOTSUPP; /* Needs translation */
164 if ((error = vfs_busy(mp, VB_READ|VB_NOWAIT)) != 0) {
178 error = EPERM;
181 if ((error = vinvalbuf(vp, V_SAVE, p->p_ucred, p, 0, INFSLP)) != 0) {
189 error = copyinstr(SCARG(uap, type), fstypename, MFSNAMELEN, NULL);
190 if (error) {
197 error = EOPNOTSUPP;
202 error = copyin(SCARG(uap, data), args, vfsp->vfc_datasize);
203 if (error) {
210 error = EBUSY;
222 error = vfs_busy(vp->v_mount, VB_READ|VB_NOWAIT|VB_DUPOK);
223 if (error) {
250 error = VFS_MOUNT(mp, fspath, args, &nd, p);
251 if (!error) {
260 if (error)
265 error = vfs_allocate_syncvnode(mp);
283 if (!error) {
289 error = vfs_allocate_syncvnode(mp);
292 if ((error = VFS_START(mp, 0, p)) != 0)
304 return (error);
366 int error;
369 if ((error = suser(p)) != 0)
370 return (error);
374 if ((error = namei(&nd)) != 0)
375 return (error);
410 int error;
426 error = EBUSY;
429 error = vfs_busy(mp, VB_WRITE|VB_WAIT|VB_DUPOK);
430 if (error) {
455 error = dounmount_leaf(mp, flags, p);
456 if (error)
466 return (error);
474 int error;
494 (error = VFS_SYNC(mp, MNT_WAIT, 0, p->p_ucred, p)) == 0) ||
496 error = VFS_UNMOUNT(mp, flags, p);
498 if (error && !(flags & MNT_DOOMED)) {
502 return (error);
559 int error;
563 if ((error = namei(&nd)) != 0)
564 return (error);
578 int error;
589 if ((error = copyout(s, d, co_sz1)) != 0)
590 return (error);
591 if ((error = copyout(&fsid, d + co_sz1, sizeof(fsid))) != 0)
592 return (error);
611 int error;
618 if ((error = namei(&nd)) != 0)
619 return (error);
623 if ((error = VFS_STATFS(mp, sp, p)) != 0)
624 return (error);
643 int error;
645 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
646 return (error);
653 error = VFS_STATFS(mp, sp, p);
655 if (error)
656 return (error);
677 int error, flags = SCARG(uap, flags);
694 (error = VFS_STATFS(mp, sp, p))) {
700 error = (copyout_statfs(sp, sfsp, p));
701 if (error) {
703 return (error);
732 int error;
744 error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p);
746 while (!error && (mp = vp->v_mountedhere) != NULL) {
749 error = VFS_ROOT(mp, &tdp);
751 if (error)
756 if (error) {
758 return (error);
778 int error;
785 if ((error = change_dir(&nd, p)) != 0)
786 return (error);
804 int error;
807 if ((error = suser(p)) != 0)
808 return (error);
811 if ((error = change_dir(&nd, p)) != 0)
812 return (error);
837 int error;
839 if ((error = namei(ndp)) != 0)
840 return (error);
843 error = ENOTDIR;
845 error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p);
846 if (error)
850 return (error);
864 int error = 0;
872 if ((error = copyinstr(SCARG(uap, pathname), pathname, MAXPATHLEN,
877 error = ENOENT;
881 error = EINVAL;
897 error = vfs_getcwd_common(p->p_fd->fd_cdir, NULL, &bp, cwdbuf,
900 if (error) {
907 error = ENAMETOOLONG;
922 if ((error = namei(&nd)) != 0)
929 error = copyoutstr(nd.ni_cnd.cn_rpbuf, SCARG(uap, resolved),
940 return (error);
955 int error, allow;
965 error = copyinstr(SCARG(uap, permissions), permissions,
967 if (error)
968 return (error);
970 error = copyinstr(SCARG(uap, path), pathname, MAXPATHLEN, &pathlen);
971 if (error)
979 error = EINVAL;
997 if ((error = namei(&nd)) != 0)
1020 error = unveil_add(p, &nd, permissions);
1022 error = EPERM;
1034 return (error);
1077 int type, indx, error, localtrunc = 0;
1084 error = pledge_flock(p);
1085 if (error != 0)
1086 return (error);
1092 if ((error = falloc(p, &fp, &indx)) != 0) {
1094 return (error);
1124 if ((error = vn_open(&nd, flags, cmode)) != 0) {
1126 if (error == ENODEV &&
1128 (error =
1131 goto error;
1133 if (error == ERESTART)
1134 error = EINTR;
1136 goto error;
1156 error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type);
1157 if (error) {
1161 goto error;
1168 error = EACCES;
1170 error = EROFS;
1172 error = EISDIR;
1173 else if ((error = vn_writechk(vp)) == 0) {
1176 error = VOP_SETATTR(vp, &vattr, fp->f_cred, p);
1178 if (error) {
1183 goto error;
1193 return (error);
1194 error:
1198 return (error);
1215 int indx, error;
1227 if ((error = falloc(p, &fp, &indx)) != 0) {
1229 return (error);
1243 if ((error = vn_open(&nd, flags, cmode)) != 0) {
1244 if (error == ERESTART)
1245 error = EINTR;
1250 return (error);
1271 if ((error = namei(&nd)) != 0) {
1272 printf("can't unlink temp file! %d\n", error);
1273 error = 0;
1277 error = VOP_REMOVE(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd);
1278 if (error) {
1279 printf("error removing vop: %d\n", error);
1280 error = 0;
1284 return (error);
1299 int error;
1305 error = suser(p);
1306 if (error)
1307 return (error);
1310 error = namei(&nd);
1311 if (error)
1312 return (error);
1316 error = VFS_VPTOFH(vp, &fh.fh_fid);
1318 if (error)
1319 return (error);
1320 error = copyout(&fh, SCARG(uap, fhp), sizeof(fh));
1321 return (error);
1343 int type, indx, error=0;
1351 if ((error = suser(p)))
1352 return (error);
1363 if ((error = falloc(p, &fp, &indx)) != 0) {
1370 if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
1374 error = ESTALE;
1378 if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp)) != 0) {
1386 error = EOPNOTSUPP;
1390 error = ENOTDIR;
1394 if ((error = VOP_ACCESS(vp, VREAD, cred, p)) != 0)
1399 error = EISDIR;
1402 if ((error = VOP_ACCESS(vp, VWRITE, cred, p)) != 0 ||
1403 (error = vn_writechk(vp)) != 0)
1409 if ((error = VOP_SETATTR(vp, &va, cred, p)) != 0)
1412 if ((error = VOP_OPEN(vp, flags, cred, p)) != 0)
1435 error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type);
1436 if (error) {
1460 return (error);
1471 int error;
1479 if ((error = suser(p)))
1480 return (error);
1482 if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
1483 return (error);
1487 if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp)))
1488 return (error);
1489 error = vn_stat(vp, &sb, p);
1491 if (error)
1492 return (error);
1493 error = copyout(&sb, SCARG(uap, sb), sizeof(sb));
1494 return (error);
1508 int error;
1513 if ((error = suser(p)))
1514 return (error);
1516 if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
1517 return (error);
1521 if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp)))
1522 return (error);
1526 if ((error = VFS_STATFS(mp, sp, p)) != 0)
1527 return (error);
1567 int error;
1575 if ((error = namei(&nd)) != 0)
1576 return (error);
1579 if (!vnoperm(nd.ni_dvp) && (error = suser(p)) != 0)
1582 error = EINVAL;
1587 error = EEXIST;
1607 error = EOPNOTSUPP;
1617 error = EINVAL;
1622 if (!error) {
1623 error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr);
1634 return (error);
1701 int error, follow;
1710 if ((error = namei(&nd)) != 0)
1711 return (error);
1715 error = EPERM;
1722 if ((error = namei(&nd)) != 0)
1731 error = EEXIST;
1739 error = EXDEV;
1743 error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
1746 return (error);
1781 int error;
1785 error = copyinstr(upath, path, MAXPATHLEN, NULL);
1786 if (error)
1791 if ((error = namei(&nd)) != 0)
1800 error = EEXIST;
1805 error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, path);
1808 return (error);
1841 int error;
1851 if ((error = namei(&nd)) != 0)
1852 return (error);
1857 error = ENOTDIR;
1864 error = EINVAL;
1871 error = EBUSY;
1880 error = EBUSY;
1882 if (!error) {
1884 error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd);
1887 error = VOP_REMOVE(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd);
1897 return (error);
1914 int error;
1919 error = ESPIPE;
1924 error = (*fp->f_ops->fo_seek)(fp, &offset, SCARG(uap, whence), p);
1925 if (error)
1932 error = 0;
1935 return (error);
1973 int vflags = 0, error;
2006 if ((error = namei(&nd)) != 0)
2012 error = VOP_ACCESS(vp, vflags, p->p_ucred, p);
2013 if (!error && (vflags & VWRITE))
2014 error = vn_writechk(vp);
2022 return (error);
2057 int error, follow;
2069 if ((error = namei(&nd)) != 0) {
2071 return (error);
2073 error = vn_stat(nd.ni_vp, &sb, p);
2076 if (error)
2077 return (error);
2081 error = copyout(&sb, buf, sizeof(sb));
2083 if (error == 0 && KTRPOINT(p, KTR_STRUCT))
2086 return (error);
2137 int follow, error;
2147 if ((error = namei(&nd)) != 0)
2148 return (error);
2149 error = VOP_PATHCONF(nd.ni_vp, name, retval);
2151 return (error);
2191 int error;
2197 if ((error = namei(&nd)) != 0)
2198 return (error);
2201 error = EINVAL;
2212 error = VOP_READLINK(vp, &auio, p->p_ucred);
2216 return (error);
2252 int error, follow;
2261 if ((error = namei(&nd)) != 0)
2262 return (error);
2278 int error;
2280 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
2281 return (error);
2292 int error;
2296 error = EROFS;
2298 error = EINVAL;
2301 if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))
2305 error = EINVAL;
2311 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2315 return (error);
2351 int error, follow;
2365 if ((error = namei(&nd)) != 0)
2366 return (error);
2370 error = EROFS;
2374 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2377 return (error);
2394 int error;
2401 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
2402 return (error);
2406 error = EROFS;
2410 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2414 return (error);
2454 int error, follow;
2465 if ((error = namei(&nd)) != 0)
2466 return (error);
2470 error = EROFS;
2472 if ((error = pledge_chown(p, uid, gid)))
2477 error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
2478 if (error)
2489 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2493 return (error);
2509 int error;
2518 if ((error = namei(&nd)) != 0)
2519 return (error);
2523 error = EROFS;
2525 if ((error = pledge_chown(p, uid, gid)))
2530 error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
2531 if (error)
2542 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2546 return (error);
2562 int error;
2568 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
2569 return (error);
2573 error = EROFS;
2575 if ((error = pledge_chown(p, uid, gid)))
2580 error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
2581 if (error)
2592 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2597 return (error);
2614 int error;
2618 error = copyin(tvp, tv, sizeof(tv));
2619 if (error)
2620 return (error);
2647 int error, i;
2651 error = copyin(tsp, ts, sizeof(ts));
2652 if (error)
2653 return (error);
2678 int error, follow;
2688 if ((error = namei(&nd)) != 0)
2689 return (error);
2700 int error;
2734 error = EROFS;
2736 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
2738 return (error);
2754 int error;
2758 error = copyin(tvp, tv, sizeof(tv));
2759 if (error)
2760 return (error);
2786 int error, i;
2790 error = copyin(tsp, ts, sizeof(ts));
2791 if (error)
2792 return (error);
2816 int error;
2818 if ((error = getvnode(p, fd, &fp)) != 0)
2819 return (error);
2834 int error;
2840 if ((error = vn_writechk(vp)) != 0)
2841 return error;
2843 if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
2844 return error;
2867 int error;
2873 if ((error = namei(&nd)) != 0)
2874 return (error);
2877 if ((error = VOP_ACCESS(vp, VWRITE, p->p_ucred, p)) == 0)
2878 error = dotruncate(p, vp, SCARG(uap, length));
2880 return (error);
2895 int error;
2897 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
2898 return (error);
2900 error = EINVAL;
2905 error = dotruncate(p, vp, SCARG(uap, length));
2909 return (error);
2923 int error;
2925 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
2926 return (error);
2929 error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, p);
2933 return (error);
2972 int error;
2979 if ((error = namei(&fromnd)) != 0)
2980 return (error);
2993 if ((error = namei(&tond)) != 0) {
3003 error = ENOTDIR;
3006 error = EISDIR;
3011 error = EINVAL;
3017 error = -1;
3019 if (!error) {
3023 error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
3043 if (error == -1)
3045 return (error);
3080 int error;
3087 if ((error = namei(&nd)) != 0)
3088 return (error);
3102 error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr);
3103 if (!error)
3105 return (error);
3137 int error, eofflag;
3143 if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
3144 return (error);
3146 error = EBADF;
3151 error = EINVAL;
3159 error = EINVAL;
3172 error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag);
3177 if (error)
3182 return (error);
3215 int error;
3221 if ((error = namei(&nd)) != 0)
3222 return (error);
3226 error = ENOTTY;
3229 if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
3232 (error = suser(p)))
3238 return (error);
3312 int error, iovcnt = SCARG(uap, iovcnt);
3316 error = iovec_copyin(SCARG(uap, iovp), &iov, aiov, iovcnt, &resid);
3317 if (error)
3325 error = dofilereadv(p, SCARG(uap, fd), &auio, FO_POSITION, retval);
3328 return (error);
3372 int error, iovcnt = SCARG(uap, iovcnt);
3376 error = iovec_copyin(SCARG(uap, iovp), &iov, aiov, iovcnt, &resid);
3377 if (error)
3385 error = dofilewritev(p, SCARG(uap, fd), &auio, FO_POSITION, retval);
3388 return (error);