Lines Matching refs:rc

71 	int rc;
103 rc = cifs_wait_for_server_reconnect(server, tcon->retry);
104 if (rc)
105 return rc;
127 rc = -EHOSTDOWN;
155 rc = cifs_negotiate_protocol(0, ses, server);
156 if (!rc)
157 rc = cifs_setup_session(0, ses, server, nls_codepage);
160 if (rc || !tcon->need_reconnect) {
167 rc = cifs_tree_connect(0, tcon, nls_codepage);
169 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
171 if (rc) {
172 pr_warn_once("reconnect tcon failed rc = %d\n", rc);
200 rc = -EAGAIN;
203 return rc;
213 int rc;
215 rc = cifs_reconnect_tcon(tcon, smb_command);
216 if (rc)
217 return rc;
238 int rc;
241 rc = small_smb_init(smb_command, wct, NULL, request_buf);
242 if (rc)
243 return rc;
257 return rc;
291 int rc;
293 rc = cifs_reconnect_tcon(tcon, smb_command);
294 if (rc)
295 return rc;
350 int rc = 0;
375 rc = decode_negTokenInit(
377 if (rc != 1)
408 int rc = 0;
418 rc = smb_init(SMB_COM_NEGOTIATE, 0, NULL /* no tcon yet */ ,
420 if (rc)
421 return rc;
445 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
447 if (rc != 0)
457 rc = -EOPNOTSUPP;
461 rc = -EOPNOTSUPP;
492 rc = decode_ext_sec_blob(ses, pSMBr);
494 rc = -EIO; /* no crypt key only if plain text pwd */
500 if (!rc)
501 rc = cifs_enable_signing(server, ses->sign);
505 cifs_dbg(FYI, "negprot rc %d\n", rc);
506 return rc;
513 int rc = 0;
534 rc = small_smb_init(SMB_COM_TREE_DISCONNECT, 0, tcon,
536 if (rc)
537 return rc;
539 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)smb_buffer, 0);
541 if (rc)
542 cifs_dbg(FYI, "Tree disconnect failed %d\n", rc);
546 if (rc == -EAGAIN)
547 rc = 0;
549 return rc;
573 int rc = 0;
580 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);
581 if (rc)
582 return rc;
600 rc = cifs_call_async(server, &rqst, NULL, cifs_echo_callback, NULL,
602 if (rc)
603 cifs_dbg(FYI, "Echo request failed: %d\n", rc);
607 return rc;
614 int rc = 0;
635 rc = small_smb_init(SMB_COM_LOGOFF_ANDX, 2, NULL, (void **)&pSMB);
636 if (rc) {
638 return rc;
649 rc = SendReceiveNoRsp(xid, ses, (char *) pSMB, 0);
657 if (rc == -EAGAIN)
658 rc = 0;
659 return rc;
671 int rc = 0;
677 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
679 if (rc)
680 return rc;
725 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
727 if (rc)
728 cifs_dbg(FYI, "Posix delete returned %d\n", rc);
733 if (rc == -EAGAIN)
736 return rc;
745 int rc = 0;
751 rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB,
753 if (rc)
754 return rc;
770 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
773 if (rc)
774 cifs_dbg(FYI, "Error in RMFile = %d\n", rc);
777 if (rc == -EAGAIN)
780 return rc;
789 int rc = 0;
796 rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB,
798 if (rc)
799 return rc;
814 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
817 if (rc)
818 cifs_dbg(FYI, "Error in RMDir = %d\n", rc);
821 if (rc == -EAGAIN)
823 return rc;
831 int rc = 0;
840 rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB,
842 if (rc)
843 return rc;
858 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
861 if (rc)
862 cifs_dbg(FYI, "Error in Mkdir = %d\n", rc);
865 if (rc == -EAGAIN)
867 return rc;
880 int rc = 0;
888 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
890 if (rc)
891 return rc;
936 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
938 if (rc) {
939 cifs_dbg(FYI, "Posix create returned %d\n", rc);
944 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
946 if (rc || get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)) {
947 rc = -EIO; /* bad smb */
986 if (rc == -EAGAIN)
989 return rc;
1043 int rc;
1051 rc = smb_init(SMB_COM_OPEN_ANDX, 15, tcon, (void **) &pSMB,
1053 if (rc)
1054 return rc;
1100 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1103 if (rc) {
1104 cifs_dbg(FYI, "Error in Open = %d\n", rc);
1135 if (rc == -EAGAIN)
1137 return rc;
1144 int rc;
1160 rc = smb_init(SMB_COM_NT_CREATE_ANDX, 24, tcon, (void **)&req,
1162 if (rc)
1163 return rc;
1224 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *)req,
1227 if (rc) {
1228 cifs_dbg(FYI, "Error in Open = %d\n", rc);
1230 if (rc == -EAGAIN)
1232 return rc;
1259 return rc;
1282 int rc = 0;
1284 rc = cifs_verify_signature(&rqst, server,
1286 if (rc)
1288 rc);
1317 int rc;
1337 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **)&smb);
1338 if (rc)
1339 return rc;
1368 rc = cifs_call_async(tcon->ses->server, &rqst, cifs_readv_receive,
1371 if (rc == 0)
1377 return rc;
1384 int rc = -EACCES;
1410 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **) &pSMB);
1411 if (rc)
1412 return rc;
1441 rc = SendReceive2(xid, tcon->ses, iov, 1, &resp_buf_type,
1446 if (rc) {
1447 cifs_dbg(VFS, "Send error in read = %d\n", rc);
1459 rc = -EIO;
1464 /* if (rc = copy_to_user(buf, pReadData, data_length)) {
1465 cifs_dbg(VFS, "Faulting on read rc = %d\n",rc);
1466 rc = -EFAULT;
1486 return rc;
1494 int rc = -EACCES;
1522 rc = smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **) &pSMB,
1524 if (rc)
1525 return rc;
1584 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1587 if (rc) {
1588 cifs_dbg(FYI, "Send error in write = %d\n", rc);
1608 return rc;
1666 int rc = -EACCES;
1683 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **)&smb);
1684 if (rc)
1732 rc = cifs_call_async(tcon->ses->server, &rqst, NULL,
1735 if (rc == 0)
1742 return rc;
1749 int rc;
1774 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **) &pSMB);
1775 if (rc)
1776 return rc;
1818 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 0,
1822 if (rc) {
1823 cifs_dbg(FYI, "Send error Write2 = %d\n", rc);
1826 rc = -EIO;
1847 return rc;
1854 int rc = 0;
1864 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
1865 if (rc)
1866 return rc;
1886 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type,
1889 if (rc)
1890 cifs_dbg(FYI, "Send error in cifs_lockv = %d\n", rc);
1892 return rc;
1902 int rc = 0;
1904 /* LOCK_RSP *pSMBr = NULL; */ /* No response data other than rc to parse */
1911 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
1913 if (rc)
1914 return rc;
1950 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB,
1953 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, flags);
1956 if (rc)
1957 cifs_dbg(FYI, "Send error in Lock = %d\n", rc);
1961 return rc;
1974 int rc = 0;
1984 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
1986 if (rc)
1987 return rc;
2037 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB,
2042 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,
2048 if (rc) {
2049 cifs_dbg(FYI, "Send error in Posix Lock = %d\n", rc);
2054 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
2056 if (rc || get_bcc(&pSMBr->hdr) < sizeof(*parm_data)) {
2057 rc = -EIO; /* bad smb */
2063 rc = -EIO;
2092 return rc;
2099 int rc = 0;
2104 rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB);
2105 if (rc == -EAGAIN)
2107 if (rc)
2108 return rc;
2113 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2116 if (rc) {
2117 if (rc != -EINTR) {
2119 cifs_dbg(VFS, "Send error in Close = %d\n", rc);
2124 if (rc == -EAGAIN)
2125 rc = 0;
2127 return rc;
2133 int rc = 0;
2137 rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB);
2138 if (rc)
2139 return rc;
2143 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2146 if (rc)
2147 cifs_dbg(VFS, "Send error in Flush = %d\n", rc);
2149 return rc;
2157 int rc = 0;
2167 rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB,
2169 if (rc)
2170 return rc;
2203 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2206 if (rc)
2207 cifs_dbg(FYI, "Send error in rename = %d\n", rc);
2211 if (rc == -EAGAIN)
2214 return rc;
2226 int rc = 0;
2232 rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB,
2234 if (rc)
2235 return rc;
2285 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB,
2288 if (rc)
2290 rc);
2297 return rc;
2305 int rc = 0;
2314 rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB,
2316 if (rc)
2317 return rc;
2349 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2351 if (rc) {
2353 rc, le16_to_cpu(pSMBr->CopyCount));
2357 if (rc == -EAGAIN)
2360 return rc;
2373 int rc = 0;
2379 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2381 if (rc)
2382 return rc;
2435 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2438 if (rc)
2440 rc);
2444 if (rc == -EAGAIN)
2447 return rc;
2460 int rc = 0;
2466 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2468 if (rc)
2469 return rc;
2519 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2522 if (rc)
2524 rc);
2527 if (rc == -EAGAIN)
2530 return rc;
2539 int rc = 0;
2550 rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB,
2552 if (rc)
2553 return rc;
2590 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2593 if (rc)
2594 cifs_dbg(FYI, "Send error in hard link (NT rename) = %d\n", rc);
2597 if (rc == -EAGAIN)
2600 return rc;
2611 int rc = 0;
2620 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2622 if (rc)
2623 return rc;
2660 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2662 if (rc) {
2663 cifs_dbg(FYI, "Send error in QuerySymLinkInfo = %d\n", rc);
2667 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
2669 if (rc || get_bcc(&pSMBr->hdr) < 2)
2670 rc = -EIO;
2687 rc = -ENOMEM;
2691 if (rc == -EAGAIN)
2693 return rc;
2712 int rc;
2730 rc = CIFS_open(xid, &oparms, &oplock, NULL);
2731 if (rc)
2732 return rc;
2734 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon,
2736 if (rc)
2758 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *)io_req,
2760 if (rc)
2767 rc = -EIO;
2774 rc = -EIO;
2783 rc = -EIO;
2797 return rc;
2804 int rc = 0;
2810 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB,
2812 if (rc)
2813 return rc;
2839 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2841 if (rc)
2842 cifs_dbg(FYI, "Send error in SetCompression = %d\n", rc);
2850 return rc;
2988 __u16 rc = 0;
3021 if (rc == 0) {
3022 rc = (__u16)(count * sizeof(struct cifs_posix_ace));
3023 rc += sizeof(struct cifs_posix_acl);
3026 return rc;
3037 int rc = 0;
3045 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3047 if (rc)
3048 return rc;
3089 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3092 if (rc) {
3093 cifs_dbg(FYI, "Send error in Query POSIX ACL = %d\n", rc);
3097 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3099 if (rc || get_bcc(&pSMBr->hdr) < 2)
3100 rc = -EIO; /* bad smb */
3104 rc = cifs_to_posix_acl(acl,
3115 if (rc == -EAGAIN)
3117 return rc;
3129 int rc = 0;
3135 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3137 if (rc)
3138 return rc;
3167 rc = -EOPNOTSUPP;
3183 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3185 if (rc)
3186 cifs_dbg(FYI, "Set POSIX ACL returned %d\n", rc);
3190 if (rc == -EAGAIN)
3192 return rc;
3216 int rc = 0;
3227 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3229 if (rc)
3230 return rc;
3258 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3260 if (rc) {
3261 cifs_dbg(FYI, "error %d in GetExtAttr\n", rc);
3264 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3266 if (rc || get_bcc(&pSMBr->hdr) < 2)
3267 /* If rc should we check for EOPNOSUPP and
3269 rc = -EIO; /* bad smb */
3277 rc = -EIO;
3288 if (rc == -EAGAIN)
3290 return rc;
3308 int rc;
3312 rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon,
3314 if (rc)
3315 return rc;
3390 int rc = 0;
3401 rc = smb_init_nttransact(NT_TRANSACT_QUERY_SECURITY_DESC, 0,
3403 if (rc)
3404 return rc;
3417 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type,
3421 if (rc) {
3422 cifs_dbg(FYI, "Send error in QuerySecDesc = %d\n", rc);
3431 rc = validate_ntransact(rsp_iov.iov_base, (char **)&parm,
3433 if (rc)
3441 rc = -EIO; /* bad smb */
3461 rc = -EINVAL;
3467 rc = -ENOMEM;
3473 return rc;
3481 int rc = 0;
3487 rc = smb_init(SMB_COM_NT_TRANSACT, 19, tcon, (void **) &pSMB, &pSMBr);
3488 if (rc)
3489 return rc;
3523 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3526 cifs_dbg(FYI, "SetCIFSACL bytes_returned: %d, rc: %d\n",
3527 bytes_returned, rc);
3528 if (rc)
3529 cifs_dbg(FYI, "Set CIFS ACL returned %d\n", rc);
3532 if (rc == -EAGAIN)
3535 return (rc);
3548 int rc = 0;
3554 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB,
3556 if (rc)
3557 return rc;
3574 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3576 if (rc) {
3577 cifs_dbg(FYI, "Send error in QueryInfo = %d\n", rc);
3597 rc = -EIO; /* bad buffer passed in */
3601 if (rc == -EAGAIN)
3604 return rc;
3613 int rc = 0;
3618 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3620 if (rc)
3621 return rc;
3649 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3651 if (rc) {
3652 cifs_dbg(FYI, "Send error in QFileInfo = %d\n", rc);
3654 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3656 if (rc) /* BB add auto retry on EOPNOTSUPP? */
3657 rc = -EIO;
3659 rc = -EIO; /* bad smb */
3666 rc = -ENOMEM;
3669 if (rc == -EAGAIN)
3672 return rc;
3684 int rc = 0;
3691 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3693 if (rc)
3694 return rc;
3734 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3736 if (rc) {
3737 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
3739 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3741 if (rc) /* BB add auto retry on EOPNOTSUPP? */
3742 rc = -EIO;
3744 rc = -EIO; /* bad smb */
3746 rc = -EIO; /* 24 or 26 expected but we do not read
3765 rc = -ENOMEM;
3768 if (rc == -EAGAIN)
3771 return rc;
3780 int rc = 0;
3785 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3787 if (rc)
3788 return rc;
3816 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3818 if (rc) {
3819 cifs_dbg(FYI, "Send error in UnixQFileInfo = %d\n", rc);
3821 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3823 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
3825 rc = -EIO; /* bad smb */
3836 if (rc == -EAGAIN)
3839 return rc;
3851 int rc = 0;
3858 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3860 if (rc)
3861 return rc;
3898 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3900 if (rc) {
3901 cifs_dbg(FYI, "Send error in UnixQPathInfo = %d\n", rc);
3903 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3905 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
3907 rc = -EIO; /* bad smb */
3917 if (rc == -EAGAIN)
3920 return rc;
3939 int rc = 0;
3944 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3946 if (rc)
3947 return rc;
4016 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4020 if (rc) {
4025 /* BB: add code to handle unsupported level rc */
4026 cifs_dbg(FYI, "Error in FindFirst = %d\n", rc);
4032 if (rc == -EAGAIN)
4034 return rc;
4037 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4038 if (rc) {
4040 return rc;
4080 int rc = 0;
4087 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4089 if (rc)
4090 return rc;
4134 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4138 if (rc) {
4140 if (rc == -EBADF) {
4142 rc = 0; /* search probably was closed at end of search*/
4144 cifs_dbg(FYI, "FindNext returned = %d\n", rc);
4146 return rc;
4150 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4151 if (rc) {
4153 return rc;
4198 int rc = 0;
4202 rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB);
4206 if (rc == -EAGAIN)
4208 if (rc)
4209 return rc;
4213 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
4215 if (rc)
4216 cifs_dbg(VFS, "Send error in FindClose = %d\n", rc);
4221 if (rc == -EAGAIN)
4222 rc = 0;
4224 return rc;
4232 int rc = 0;
4243 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4245 if (rc)
4246 return rc;
4284 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4286 if (rc) {
4287 cifs_dbg(FYI, "error %d in QueryInternalInfo\n", rc);
4290 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4292 if (rc || get_bcc(&pSMBr->hdr) < 2)
4293 /* If rc should we check for EOPNOSUPP and
4295 rc = -EIO; /* bad smb */
4303 rc = -EIO;
4313 if (rc == -EAGAIN)
4315 return rc;
4327 int rc = 0;
4344 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, ses->tcon_ipc,
4346 if (rc)
4347 return rc;
4400 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
4402 if (rc) {
4403 cifs_dbg(FYI, "Send error in GetDFSRefer = %d\n", rc);
4406 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4409 if (rc || get_bcc(&pSMBr->hdr) < 17) {
4410 rc = -EIO; /* bad smb */
4418 rc = parse_dfs_referrals(&pSMBr->dfs_data,
4427 if (rc == -EAGAIN)
4430 return rc;
4442 int rc = 0;
4448 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4450 if (rc)
4451 return rc;
4476 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4478 if (rc) {
4479 cifs_dbg(FYI, "Send error in QFSInfo = %d\n", rc);
4481 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4483 if (rc || get_bcc(&pSMBr->hdr) < 18)
4484 rc = -EIO; /* bad smb */
4515 if (rc == -EAGAIN)
4518 return rc;
4529 int rc = 0;
4535 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4537 if (rc)
4538 return rc;
4563 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4565 if (rc) {
4566 cifs_dbg(FYI, "Send error in QFSInfo = %d\n", rc);
4568 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4570 if (rc || get_bcc(&pSMBr->hdr) < 24)
4571 rc = -EIO; /* bad smb */
4602 if (rc == -EAGAIN)
4605 return rc;
4615 int rc = 0;
4621 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4623 if (rc)
4624 return rc;
4650 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4652 if (rc) {
4653 cifs_dbg(VFS, "Send error in QFSAttributeInfo = %d\n", rc);
4655 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4657 if (rc || get_bcc(&pSMBr->hdr) < 13) {
4659 rc = -EIO; /* bad smb */
4672 if (rc == -EAGAIN)
4675 return rc;
4685 int rc = 0;
4691 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4693 if (rc)
4694 return rc;
4721 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4723 if (rc) {
4724 cifs_dbg(FYI, "Send error in QFSDeviceInfo = %d\n", rc);
4726 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4728 if (rc || get_bcc(&pSMBr->hdr) <
4730 rc = -EIO; /* bad smb */
4743 if (rc == -EAGAIN)
4746 return rc;
4756 int rc = 0;
4762 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
4764 if (rc)
4765 return rc;
4791 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4793 if (rc) {
4794 cifs_dbg(VFS, "Send error in QFSUnixInfo = %d\n", rc);
4796 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4798 if (rc || get_bcc(&pSMBr->hdr) < 13) {
4799 rc = -EIO; /* bad smb */
4812 if (rc == -EAGAIN)
4816 return rc;
4825 int rc = 0;
4832 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
4834 if (rc)
4835 return rc;
4874 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4876 if (rc) {
4877 cifs_dbg(VFS, "Send error in SETFSUnixInfo = %d\n", rc);
4879 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4880 if (rc)
4881 rc = -EIO; /* bad smb */
4885 if (rc == -EAGAIN)
4888 return rc;
4901 int rc = 0;
4907 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4909 if (rc)
4910 return rc;
4936 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4938 if (rc) {
4939 cifs_dbg(FYI, "Send error in QFSUnixInfo = %d\n", rc);
4941 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4943 if (rc || get_bcc(&pSMBr->hdr) < 13) {
4944 rc = -EIO; /* bad smb */
4980 if (rc == -EAGAIN)
4983 return rc;
5002 int rc = 0;
5010 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5012 if (rc)
5013 return rc;
5069 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5071 if (rc)
5072 cifs_dbg(FYI, "SetPathInfo (file size) returned %d\n", rc);
5076 if (rc == -EAGAIN)
5079 return rc;
5088 int rc = 0;
5093 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5095 if (rc)
5096 return rc;
5147 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5149 if (rc) {
5151 rc);
5157 return rc;
5172 int rc = 0;
5176 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5178 if (rc)
5179 return rc;
5219 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5221 if (rc)
5223 rc);
5228 return rc;
5237 int rc = 0;
5241 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5243 if (rc)
5244 return rc;
5281 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5283 if (rc)
5284 cifs_dbg(FYI, "Send error in SetFileDisposition = %d\n", rc);
5286 return rc;
5298 int rc;
5310 rc = CIFS_open(xid, &oparms, &oplock, NULL);
5311 if (rc)
5314 rc = CIFSSMBSetFileInfo(xid, tcon, data, fid.netfid, current->tgid);
5318 return rc;
5330 int rc = 0;
5339 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5341 if (rc)
5342 return rc;
5387 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5389 if (rc)
5390 cifs_dbg(FYI, "SetPathInfo (times) returned %d\n", rc);
5394 if (rc == -EAGAIN)
5397 if (rc == -EOPNOTSUPP)
5401 return rc;
5458 int rc = 0;
5462 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5464 if (rc)
5465 return rc;
5505 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5507 if (rc)
5509 rc);
5514 return rc;
5526 int rc = 0;
5533 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5535 if (rc)
5536 return rc;
5581 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5583 if (rc)
5584 cifs_dbg(FYI, "SetPathInfo (perms) returned %d\n", rc);
5587 if (rc == -EAGAIN)
5589 return rc;
5613 int rc = 0;
5625 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5627 if (rc)
5628 return rc;
5665 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5667 if (rc) {
5668 cifs_dbg(FYI, "Send error in QueryAllEAs = %d\n", rc);
5677 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5678 if (rc || get_bcc(&pSMBr->hdr) < 4) {
5679 rc = -EIO; /* bad smb */
5701 rc = -ENODATA;
5709 rc = -EIO;
5726 rc = -EIO;
5735 rc = -EIO;
5743 rc = value_len;
5747 rc = -ERANGE;
5755 rc += (5 + 1 + name_len);
5756 if (rc < (int) buf_size) {
5768 rc = -ERANGE;
5778 rc = -ENODATA;
5782 if (rc == -EAGAIN)
5785 return (ssize_t)rc;
5798 int rc = 0;
5805 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5807 if (rc)
5808 return rc;
5876 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5878 if (rc)
5879 cifs_dbg(FYI, "SetPathInfo (EA) returned %d\n", rc);
5883 if (rc == -EAGAIN)
5886 return rc;