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