Lines Matching full:error
64 static struct p9_req_t *p9_get_request(struct p9_client *c, int *error);
66 struct p9_client *c, int8_t type, int *error, const char *fmt, ...);
86 int error, len; in p9_parse_opts() local
92 error = vfs_getopt(mp->mnt_optnew, "trans", (void **)&trans, &len); in p9_parse_opts()
93 if (error == ENOENT) in p9_parse_opts()
150 p9_get_request(struct p9_client *clnt, int *error) in p9_get_request() argument
164 *error = EAGAIN; in p9_get_request()
180 int error; in p9_parse_receive() local
189 error = p9_buf_readf(buf, 0, "dbw", &size, &type, &tag); in p9_parse_receive()
190 if (error != 0) in p9_parse_receive()
199 return (error); in p9_parse_receive()
206 int error; in p9_client_check_return() local
211 error = p9_parse_receive(req->rc, c); in p9_client_check_return()
212 if (error != 0) in p9_client_check_return()
216 * No error, We are done with the preprocessing. Return to the caller in p9_client_check_return()
223 * Interpreting the error is done in different ways for Linux and in p9_client_check_return()
227 error = p9_buf_readf(req->rc, c->proto_version, "s?d", &ename, &ecode); in p9_client_check_return()
229 error = p9_buf_readf(req->rc, c->proto_version, "d", &ecode); in p9_client_check_return()
233 if (error != 0) in p9_client_check_return()
236 /* if there was an ecode error make this the err now */ in p9_client_check_return()
237 error = ecode; in p9_client_check_return()
240 * Note this is still not completely an error, as lookups for files in p9_client_check_return()
243 if (error != 0) { in p9_client_check_return()
245 P9_DEBUG(PROTO, "RERROR error %d ename %s\n", in p9_client_check_return()
246 error, ename); in p9_client_check_return()
248 P9_DEBUG(PROTO, "RLERROR error %d\n", error); in p9_client_check_return()
255 return (error); in p9_client_check_return()
258 P9_DEBUG(ERROR, "couldn't parse receive buffer error%d\n", error); in p9_client_check_return()
259 return (error); in p9_client_check_return()
279 int req_size, int *error, const char *fmt, __va_list ap) in p9_client_prepare_req() argument
292 *error = EIO; in p9_client_prepare_req()
299 *error = EIO; in p9_client_prepare_req()
304 req = p9_get_request(c, error); in p9_client_prepare_req()
305 if (*error != 0) { in p9_client_prepare_req()
306 P9_DEBUG(ERROR, "%s: request allocation failed.\n", __func__); in p9_client_prepare_req()
311 *error = p9_buf_prepare(req->tc, type); in p9_client_prepare_req()
312 if (*error != 0) { in p9_client_prepare_req()
313 P9_DEBUG(ERROR, "%s: p9_buf_prepare failed: %d\n", in p9_client_prepare_req()
314 __func__, *error); in p9_client_prepare_req()
318 *error = p9_buf_vwritef(req->tc, c->proto_version, fmt, ap); in p9_client_prepare_req()
319 if (*error != 0) { in p9_client_prepare_req()
320 P9_DEBUG(ERROR, "%s: p9_buf_vwrite failed: %d\n", in p9_client_prepare_req()
321 __func__, *error); in p9_client_prepare_req()
325 *error = p9_buf_finalize(c, req->tc); in p9_client_prepare_req()
326 if (*error != 0) { in p9_client_prepare_req()
327 P9_DEBUG(ERROR, "%s: p9_buf_finalize failed: %d \n", in p9_client_prepare_req()
328 __func__, *error); in p9_client_prepare_req()
340 * the 9P request header to be sent, parsing and checking for error conditions
344 p9_client_request(struct p9_client *c, int8_t type, int *error, in p9_client_request() argument
351 req = p9_client_prepare_req(c, type, c->msize, error, fmt, ap); in p9_client_request()
355 if (*error != 0) in p9_client_request()
359 *error = c->ops->request(c->handle, req); in p9_client_request()
360 if (*error != 0) { in p9_client_request()
361 P9_DEBUG(ERROR, "%s: failed: %d\n", __func__, *error); in p9_client_request()
369 *error = p9_client_check_return(c, req); in p9_client_request()
370 if (*error != 0) in p9_client_request()
388 /* Alloc_unr returning -1 is an error for no units left */ in p9_tag_create()
417 /* Alloc_unr returning -1 is an error for no units left */ in p9_fid_create()
446 int error; in p9_client_version() local
451 error = 0; in p9_client_version()
458 req = p9_client_request(c, P9PROTO_TVERSION, &error, "ds", in p9_client_version()
462 req = p9_client_request(c, P9PROTO_TVERSION, &error, "ds", in p9_client_version()
466 req = p9_client_request(c, P9PROTO_TVERSION, &error, "ds", in p9_client_version()
473 /* Always return the relevant error code */ in p9_client_version()
474 if (error != 0) in p9_client_version()
475 return (error); in p9_client_version()
477 error = p9_buf_readf(req->rc, c->proto_version, "ds", &msize, &version); in p9_client_version()
478 if (error != 0) { in p9_client_version()
479 P9_DEBUG(ERROR, "%s: version error: %d\n", __func__, error); in p9_client_version()
492 error = ENOMEM; in p9_client_version()
501 return (error); in p9_client_version()
537 p9_client_create(struct mount *mp, int *error, const char *mount_tag) in p9_client_create() argument
545 *error = p9_parse_opts(mp, clnt); in p9_client_create()
546 if (*error != 0) in p9_client_create()
550 *error = EINVAL; in p9_client_create()
551 P9_DEBUG(ERROR, "%s: no transport\n", __func__); in p9_client_create()
564 *error = clnt->ops->create(mount_tag, &clnt->handle); in p9_client_create()
565 if (*error != 0) { in p9_client_create()
566 P9_DEBUG(ERROR, "%s: transport create failed .%d \n", in p9_client_create()
567 __func__, *error); in p9_client_create()
572 *error = p9_client_version(clnt); in p9_client_create()
573 if (*error != 0) in p9_client_create()
606 const char *uname, uid_t n_uname, const char *aname, int *error) in p9_client_attach() argument
616 *error = ENOMEM; in p9_client_attach()
621 req = p9_client_request(clnt, P9PROTO_TATTACH, error, "ddssd", fid->fid, in p9_client_attach()
623 if (*error != 0) in p9_client_attach()
626 *error = p9_buf_readf(req->rc, clnt->proto_version, "Q", &qid); in p9_client_attach()
627 if (*error != 0) { in p9_client_attach()
628 P9_DEBUG(ERROR, "%s: p9_buf_readf failed: %d \n", in p9_client_attach()
629 __func__, *error); in p9_client_attach()
653 int error; in p9_client_remove() local
659 error = 0; in p9_client_remove()
662 req = p9_client_request(clnt, P9PROTO_TREMOVE, &error, "d", fid->fid); in p9_client_remove()
663 if (error != 0) { in p9_client_remove()
665 return (error); in p9_client_remove()
669 return (error); in p9_client_remove()
675 int error; in p9_client_unlink() local
679 error = 0; in p9_client_unlink()
682 req = p9_client_request(clnt, P9PROTO_TUNLINKAT, &error, "dsd", in p9_client_unlink()
684 if (error != 0) { in p9_client_unlink()
686 return (error); in p9_client_unlink()
690 return (error); in p9_client_unlink()
700 int error; in p9_client_clunk() local
704 error = 0; in p9_client_clunk()
707 P9_DEBUG(ERROR, "%s: clunk with NULL fid is bad\n", __func__); in p9_client_clunk()
714 req = p9_client_request(clnt, P9PROTO_TCLUNK, &error, "d", fid->fid); in p9_client_clunk()
721 return (error); in p9_client_clunk()
732 int clone, int *error) in p9_client_walk() argument
750 *error = EIO; in p9_client_walk()
757 *error = ENOMEM; in p9_client_walk()
772 req = p9_client_request(clnt, P9PROTO_TWALK, error, "ddT", oldfid->fid, in p9_client_walk()
774 if (*error != 0) { in p9_client_walk()
780 *error = p9_buf_readf(req->rc, clnt->proto_version, "R", &nwqids, in p9_client_walk()
782 if (*error != 0) in p9_client_walk()
788 *error = ENOENT; in p9_client_walk()
820 int error, mtu; in p9_client_open() local
824 error = 0; in p9_client_open()
836 req = p9_client_request(clnt, P9PROTO_TLOPEN, &error, "dd", in p9_client_open()
839 req = p9_client_request(clnt, P9PROTO_TOPEN, &error, "db", in p9_client_open()
842 if (error != 0) in p9_client_open()
843 return (error); in p9_client_open()
845 error = p9_buf_readf(req->rc, clnt->proto_version, "Qd", &fid->qid, in p9_client_open()
847 if (error != 0) in p9_client_open()
859 return (error); in p9_client_open()
867 int error; in p9_client_readdir() local
876 error = 0; in p9_client_readdir()
886 req = p9_client_request(clnt, P9PROTO_TREADDIR, &error, "dqd", in p9_client_readdir()
889 if (error != 0) { in p9_client_readdir()
890 P9_DEBUG(ERROR, "%s: couldn't allocate req in client_readdir\n", in p9_client_readdir()
892 return (-error); in p9_client_readdir()
895 error = p9_buf_readf(req->rc, clnt->proto_version, "D", &count, in p9_client_readdir()
897 if (error != 0) { in p9_client_readdir()
898 P9_DEBUG(ERROR, "%s: p0_buf_readf failed: %d\n", in p9_client_readdir()
899 __func__, error); in p9_client_readdir()
901 return (-error); in p9_client_readdir()
916 * so in case of an error we return -error so that we can distinguish between
917 * error codes and bytes.
925 int error, rsize; in p9_client_read() local
929 error = 0; in p9_client_read()
941 req = p9_client_request(clnt, P9PROTO_TREAD, &error, "dqd", fid->fid, in p9_client_read()
943 if (error != 0) { in p9_client_read()
944 P9_DEBUG(ERROR, "%s: failed allocate request\n", __func__); in p9_client_read()
945 return (-error); in p9_client_read()
948 error = p9_buf_readf(req->rc, clnt->proto_version, "D", &count, in p9_client_read()
950 if (error != 0) { in p9_client_read()
951 P9_DEBUG(ERROR, "%s: p9_buf_readf failed: %d\n", in p9_client_read()
952 __func__, error); in p9_client_read()
964 error = -EIO; in p9_client_read()
965 P9_DEBUG(ERROR, "%s: EIO error in client_read \n", __func__); in p9_client_read()
975 return (-error); in p9_client_read()
981 * so in case of an error we return -error so that we can distinguish between
982 * error codes and bytes.
990 int ret, error, rsize; in p9_client_write() local
995 error = 0; in p9_client_write()
1012 req = p9_client_request(clnt, P9PROTO_TWRITE, &error, "dqD", fid->fid, in p9_client_write()
1014 if (error != 0) { in p9_client_write()
1015 P9_DEBUG(ERROR, "%s: failed allocate request: %d\n", in p9_client_write()
1016 __func__, error); in p9_client_write()
1017 return (-error); in p9_client_write()
1020 error = p9_buf_readf(req->rc, clnt->proto_version, "d", &ret); in p9_client_write()
1021 if (error != 0) { in p9_client_write()
1022 P9_DEBUG(ERROR, "%s: p9_buf_readf error: %d\n", in p9_client_write()
1023 __func__, error); in p9_client_write()
1034 error = EIO; in p9_client_write()
1035 P9_DEBUG(ERROR, "%s: EIO error\n", __func__); in p9_client_write()
1043 return (-error); in p9_client_write()
1052 int error; in p9_client_file_create() local
1062 error = 0; in p9_client_file_create()
1067 req = p9_client_request(clnt, P9PROTO_TCREATE, &error, "dsdb?s", in p9_client_file_create()
1069 if (error != 0) in p9_client_file_create()
1070 return (error); in p9_client_file_create()
1072 error = p9_buf_readf(req->rc, clnt->proto_version, "Qd", &qid, &mtu); in p9_client_file_create()
1073 if (error != 0) in p9_client_file_create()
1083 return (error); in p9_client_file_create()
1090 int error; in p9_client_statfs() local
1094 error = 0; in p9_client_statfs()
1099 req = p9_client_request(clnt, P9PROTO_TSTATFS, &error, "d", fid->fid); in p9_client_statfs()
1100 if (error != 0) { in p9_client_statfs()
1101 return (error); in p9_client_statfs()
1104 error = p9_buf_readf(req->rc, clnt->proto_version, "ddqqqqqqd", in p9_client_statfs()
1109 if (error != 0) in p9_client_statfs()
1123 return (error); in p9_client_statfs()
1131 int error; in p9_client_renameat() local
1138 error = 0; in p9_client_renameat()
1146 req = p9_client_request(clnt, P9PROTO_TRENAMEAT, &error, "dsds", in p9_client_renameat()
1149 if (error != 0) in p9_client_renameat()
1150 return (error); in p9_client_renameat()
1153 return (error); in p9_client_renameat()
1160 int error; in p9_create_symlink() local
1165 error = 0; in p9_create_symlink()
1170 req = p9_client_request(clnt, P9PROTO_TSYMLINK, &error, "dssd", in p9_create_symlink()
1173 if (error != 0) in p9_create_symlink()
1174 return (error); in p9_create_symlink()
1176 error = p9_buf_readf(req->rc, clnt->proto_version, "Q", &qid); in p9_create_symlink()
1177 if (error != 0) { in p9_create_symlink()
1178 P9_DEBUG(ERROR, "%s: buf_readf failed %d\n", __func__, error); in p9_create_symlink()
1179 return (error); in p9_create_symlink()
1193 int error; in p9_create_hardlink() local
1197 error = 0; in p9_create_hardlink()
1203 req = p9_client_request(clnt, P9PROTO_TLINK, &error, "dds", dfid->fid, in p9_create_hardlink()
1205 if (error != 0) in p9_create_hardlink()
1206 return (error); in p9_create_hardlink()
1216 int error; in p9_readlink() local
1220 error = 0; in p9_readlink()
1225 req = p9_client_request(clnt, P9PROTO_TREADLINK, &error, "d", fid->fid); in p9_readlink()
1226 if (error != 0) in p9_readlink()
1227 return (error); in p9_readlink()
1229 error = p9_buf_readf(req->rc, clnt->proto_version, "s", target); in p9_readlink()
1230 if (error != 0) { in p9_readlink()
1231 P9_DEBUG(ERROR, "%s: buf_readf failed %d\n", __func__, error); in p9_readlink()
1232 return (error); in p9_readlink()
1259 P9_DEBUG(ERROR, "%s: allocation failed %d", __func__, err); in p9_client_getattr()
1260 goto error; in p9_client_getattr()
1265 P9_DEBUG(ERROR, "%s: buf_readf failed %d\n", __func__, err); in p9_client_getattr()
1266 goto error; in p9_client_getattr()
1290 error: in p9_client_getattr()
1319 /* Any client_request error is converted to req == NULL error*/ in p9_client_setattr()
1324 P9_DEBUG(ERROR, "%s: allocation failed %d\n", __func__, err); in p9_client_setattr()
1325 goto error; in p9_client_setattr()
1329 error: in p9_client_setattr()