Lines Matching refs:err
88 int err = 0; in nfsd_cross_mnt() local
90 err = follow_down(&path); in nfsd_cross_mnt()
91 if (err < 0) in nfsd_cross_mnt()
96 err = PTR_ERR(exp2); in nfsd_cross_mnt()
104 if (err == -ENOENT && !(exp->ex_flags & NFSEXP_V4ROOT)) in nfsd_cross_mnt()
105 err = 0; in nfsd_cross_mnt()
126 return err; in nfsd_cross_mnt()
251 __be32 err; in nfsd_lookup() local
253 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC); in nfsd_lookup()
254 if (err) in nfsd_lookup()
255 return err; in nfsd_lookup()
256 err = nfsd_lookup_dentry(rqstp, fhp, name, len, &exp, &dentry); in nfsd_lookup()
257 if (err) in nfsd_lookup()
258 return err; in nfsd_lookup()
259 err = check_nfsd_access(exp, rqstp); in nfsd_lookup()
260 if (err) in nfsd_lookup()
266 err = fh_compose(resfh, exp, dentry, fhp); in nfsd_lookup()
267 if (!err && !dentry->d_inode) in nfsd_lookup()
268 err = nfserr_noent; in nfsd_lookup()
272 return err; in nfsd_lookup()
311 __be32 err; in nfsd_setattr() local
321 err = fh_verify(rqstp, fhp, ftype, accmode); in nfsd_setattr()
322 if (err) in nfsd_setattr()
378 err = nfsd_permission(rqstp, fhp->fh_export, dentry, in nfsd_setattr()
380 if (err) in nfsd_setattr()
422 err = nfserr_notsync; in nfsd_setattr()
430 err = nfserrno(host_err); in nfsd_setattr()
435 if (!err) in nfsd_setattr()
438 return err; in nfsd_setattr()
441 err = nfserrno(host_err); in nfsd_setattr()
751 __be32 err; in nfsd_open() local
769 err = fh_verify(rqstp, fhp, type, may_flags); in nfsd_open()
770 if (err) in nfsd_open()
780 err = nfserr_perm; in nfsd_open()
817 err = nfserrno(host_err); in nfsd_open()
820 return err; in nfsd_open()
924 __be32 err; in nfsd_vfs_read() local
927 err = nfserr_perm; in nfsd_vfs_read()
949 err = 0; in nfsd_vfs_read()
952 err = nfserrno(host_err); in nfsd_vfs_read()
953 return err; in nfsd_vfs_read()
985 int err = 0; in wait_for_concurrent_writes() local
996 err = vfs_fsync(file, 0); in wait_for_concurrent_writes()
1000 return err; in wait_for_concurrent_writes()
1012 __be32 err = 0; in nfsd_vfs_write() local
1051 err = 0; in nfsd_vfs_write()
1053 err = nfserrno(host_err); in nfsd_vfs_write()
1054 return err; in nfsd_vfs_write()
1068 __be32 err; in nfsd_read() local
1070 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); in nfsd_read()
1071 if (err) in nfsd_read()
1072 return err; in nfsd_read()
1082 err = nfsd_vfs_read(rqstp, fhp, file, offset, vec, vlen, count); in nfsd_read()
1095 return err; in nfsd_read()
1104 __be32 err; in nfsd_read_file() local
1107 err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry, in nfsd_read_file()
1109 if (err) in nfsd_read_file()
1111 err = nfsd_vfs_read(rqstp, fhp, file, offset, vec, vlen, count); in nfsd_read_file()
1113 err = nfsd_read(rqstp, fhp, offset, vec, vlen, count); in nfsd_read_file()
1115 return err; in nfsd_read_file()
1128 __be32 err = 0; in nfsd_write() local
1131 err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry, in nfsd_write()
1133 if (err) in nfsd_write()
1135 err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt, in nfsd_write()
1138 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file); in nfsd_write()
1139 if (err) in nfsd_write()
1143 err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, in nfsd_write()
1148 return err; in nfsd_write()
1167 __be32 err = nfserr_inval; in nfsd_commit() local
1177 err = nfsd_open(rqstp, fhp, S_IFREG, in nfsd_commit()
1179 if (err) in nfsd_commit()
1185 err = nfserrno(err2); in nfsd_commit()
1187 err = nfserr_notsupp; in nfsd_commit()
1192 return err; in nfsd_commit()
1246 __be32 err; in nfsd_create() local
1250 err = nfserr_perm; in nfsd_create()
1253 err = nfserr_exist; in nfsd_create()
1257 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); in nfsd_create()
1258 if (err) in nfsd_create()
1264 err = nfserr_notdir; in nfsd_create()
1282 err = fh_compose(resfhp, fhp->fh_export, dchild, fhp); in nfsd_create()
1283 if (err) in nfsd_create()
1294 err = nfserr_io; in nfsd_create()
1301 err = nfserr_exist; in nfsd_create()
1312 err = nfserr_inval; in nfsd_create()
1322 err = 0; in nfsd_create()
1343 err = nfsd_create_setattr(rqstp, resfhp, iap); in nfsd_create()
1352 err = err2; in nfsd_create()
1356 if (!err) in nfsd_create()
1357 err = fh_update(resfhp); in nfsd_create()
1361 return err; in nfsd_create()
1364 err = nfserrno(host_err); in nfsd_create()
1387 __be32 err; in do_nfsd_create() local
1391 err = nfserr_perm; in do_nfsd_create()
1394 err = nfserr_exist; in do_nfsd_create()
1399 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC); in do_nfsd_create()
1400 if (err) in do_nfsd_create()
1408 err = nfserr_notdir; in do_nfsd_create()
1428 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); in do_nfsd_create()
1429 if (err) in do_nfsd_create()
1433 err = fh_compose(resfhp, fhp->fh_export, dchild, fhp); in do_nfsd_create()
1434 if (err) in do_nfsd_create()
1449 err = 0; in do_nfsd_create()
1488 err = nfserr_exist; in do_nfsd_create()
1516 err = nfsd_create_setattr(rqstp, resfhp, iap); in do_nfsd_create()
1521 if (!err) in do_nfsd_create()
1522 err = nfserrno(commit_metadata(fhp)); in do_nfsd_create()
1527 if (!err) in do_nfsd_create()
1528 err = fh_update(resfhp); in do_nfsd_create()
1535 return err; in do_nfsd_create()
1538 err = nfserrno(host_err); in do_nfsd_create()
1553 __be32 err; in nfsd_readlink() local
1557 err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP); in nfsd_readlink()
1558 if (err) in nfsd_readlink()
1565 err = nfserr_inval; in nfsd_readlink()
1581 err = 0; in nfsd_readlink()
1583 return err; in nfsd_readlink()
1586 err = nfserrno(host_err); in nfsd_readlink()
1602 __be32 err, cerr; in nfsd_symlink() local
1605 err = nfserr_noent; in nfsd_symlink()
1608 err = nfserr_exist; in nfsd_symlink()
1612 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); in nfsd_symlink()
1613 if (err) in nfsd_symlink()
1639 err = nfserrno(host_err); in nfsd_symlink()
1640 if (!err) in nfsd_symlink()
1641 err = nfserrno(commit_metadata(fhp)); in nfsd_symlink()
1648 if (err==0) err = cerr; in nfsd_symlink()
1650 return err; in nfsd_symlink()
1653 err = nfserrno(host_err); in nfsd_symlink()
1667 __be32 err; in nfsd_link() local
1670 err = fh_verify(rqstp, ffhp, S_IFDIR, NFSD_MAY_CREATE); in nfsd_link()
1671 if (err) in nfsd_link()
1673 err = fh_verify(rqstp, tfhp, 0, NFSD_MAY_NOP); in nfsd_link()
1674 if (err) in nfsd_link()
1676 err = nfserr_isdir; in nfsd_link()
1679 err = nfserr_perm; in nfsd_link()
1682 err = nfserr_exist; in nfsd_link()
1688 err = nfserrno(host_err); in nfsd_link()
1703 err = nfserr_noent; in nfsd_link()
1708 err = nfserrno(host_err); in nfsd_link()
1713 err = nfserrno(commit_metadata(ffhp)); in nfsd_link()
1714 if (!err) in nfsd_link()
1715 err = nfserrno(commit_metadata(tfhp)); in nfsd_link()
1718 err = nfserr_acces; in nfsd_link()
1720 err = nfserrno(host_err); in nfsd_link()
1728 return err; in nfsd_link()
1731 err = nfserrno(host_err); in nfsd_link()
1745 __be32 err; in nfsd_rename() local
1748 err = fh_verify(rqstp, ffhp, S_IFDIR, NFSD_MAY_REMOVE); in nfsd_rename()
1749 if (err) in nfsd_rename()
1751 err = fh_verify(rqstp, tfhp, S_IFDIR, NFSD_MAY_CREATE); in nfsd_rename()
1752 if (err) in nfsd_rename()
1761 err = nfserr_perm; in nfsd_rename()
1767 err = nfserrno(host_err); in nfsd_rename()
1823 err = nfserrno(host_err); in nfsd_rename()
1836 return err; in nfsd_rename()
1849 __be32 err; in nfsd_unlink() local
1852 err = nfserr_acces; in nfsd_unlink()
1855 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_REMOVE); in nfsd_unlink()
1856 if (err) in nfsd_unlink()
1874 err = nfserr_noent; in nfsd_unlink()
1894 err = nfserrno(host_err); in nfsd_unlink()
1896 return err; in nfsd_unlink()
1965 cdp->err = nfserr_eof; /* will be cleared on successful read */ in nfsd_buffered_readdir()
1998 if (cdp->err != nfs_ok) in nfsd_buffered_readdir()
2019 return cdp->err; in nfsd_buffered_readdir()
2030 __be32 err; in nfsd_readdir() local
2039 err = nfsd_open(rqstp, fhp, S_IFDIR, may_flags, &file); in nfsd_readdir()
2040 if (err) in nfsd_readdir()
2045 err = nfserrno((int)offset); in nfsd_readdir()
2049 err = nfsd_buffered_readdir(file, func, cdp, offsetp); in nfsd_readdir()
2051 if (err == nfserr_eof || err == nfserr_toosmall) in nfsd_readdir()
2052 err = nfs_ok; /* can still be found in ->err */ in nfsd_readdir()
2056 return err; in nfsd_readdir()
2066 __be32 err; in nfsd_statfs() local
2068 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access); in nfsd_statfs()
2069 if (!err) { in nfsd_statfs()
2075 err = nfserr_io; in nfsd_statfs()
2077 return err; in nfsd_statfs()
2093 int err; in nfsd_permission() local
2159 err = inode_permission(inode, acc & (MAY_READ|MAY_WRITE|MAY_EXEC)); in nfsd_permission()
2162 if (err == -EACCES && S_ISREG(inode->i_mode) && in nfsd_permission()
2165 err = inode_permission(inode, MAY_EXEC); in nfsd_permission()
2167 return err? nfserrno(err) : 0; in nfsd_permission()