Lines Matching refs:rc
118 int rc; in cifs_posix_open() local
134 rc = PTR_ERR(tlink); in cifs_posix_open()
142 rc = CIFSPOSIXCreate(xid, tcon, posix_flags, mode, pnetfid, presp_data, in cifs_posix_open()
147 if (rc) in cifs_posix_open()
163 rc = -ENOMEM; in cifs_posix_open()
172 return rc; in cifs_posix_open()
180 int rc; in cifs_nt_open() local
244 rc = server->ops->open(xid, &oparms, oplock, buf); in cifs_nt_open()
246 if (rc) in cifs_nt_open()
250 rc = cifs_get_inode_info_unix(&inode, full_path, inode->i_sb, in cifs_nt_open()
253 rc = cifs_get_inode_info(&inode, full_path, buf, inode->i_sb, in cifs_nt_open()
256 if (rc) { in cifs_nt_open()
258 if (rc == -ESTALE) in cifs_nt_open()
259 rc = -EOPENSTALE; in cifs_nt_open()
264 return rc; in cifs_nt_open()
518 int rc = -EACCES; in cifs_open() local
544 rc = -ENOMEM; in cifs_open()
568 rc = cifs_posix_open(full_path, &inode, inode->i_sb, in cifs_open()
571 if (rc == 0) { in cifs_open()
574 } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { in cifs_open()
580 } else if ((rc != -EIO) && (rc != -EREMOTE) && in cifs_open()
581 (rc != -EOPNOTSUPP)) /* path not found or net err */ in cifs_open()
598 rc = cifs_nt_open(full_path, inode, cifs_sb, tcon, in cifs_open()
600 if (rc) { in cifs_open()
611 rc = -ENOMEM; in cifs_open()
639 return rc; in cifs_open()
654 int rc = 0; in cifs_relock_file() local
660 return rc; in cifs_relock_file()
666 rc = cifs_push_posix_locks(cfile); in cifs_relock_file()
668 rc = tcon->ses->server->ops->push_mand_locks(cfile); in cifs_relock_file()
671 return rc; in cifs_relock_file()
677 int rc = -EACCES; in cifs_reopen_file() local
695 rc = 0; in cifs_reopen_file()
697 return rc; in cifs_reopen_file()
713 rc = -ENOMEM; in cifs_reopen_file()
716 return rc; in cifs_reopen_file()
737 rc = cifs_posix_open(full_path, NULL, inode->i_sb, in cifs_reopen_file()
740 if (rc == 0) { in cifs_reopen_file()
782 rc = server->ops->open(xid, &oparms, &oplock, NULL); in cifs_reopen_file()
783 if (rc == -ENOENT && oparms.reconnect == false) { in cifs_reopen_file()
785 rc = server->ops->open(xid, &oparms, &oplock, NULL); in cifs_reopen_file()
790 if (rc) { in cifs_reopen_file()
792 cifs_dbg(FYI, "cifs_reopen returned 0x%x\n", rc); in cifs_reopen_file()
803 rc = filemap_write_and_wait(inode->i_mapping); in cifs_reopen_file()
804 if (!is_interrupt_error(rc)) in cifs_reopen_file()
805 mapping_set_error(inode->i_mapping, rc); in cifs_reopen_file()
808 rc = cifs_get_inode_info_unix(&inode, full_path, in cifs_reopen_file()
811 rc = cifs_get_inode_info(&inode, full_path, NULL, in cifs_reopen_file()
837 return rc; in cifs_reopen_file()
889 int rc = 0; in cifs_closedir() local
899 return rc; in cifs_closedir()
911 rc = server->ops->close_dir(xid, tcon, &cfile->fid); in cifs_closedir()
913 rc = -ENOSYS; in cifs_closedir()
914 cifs_dbg(FYI, "Closing uncompleted readdir with rc %d\n", rc); in cifs_closedir()
916 rc = 0; in cifs_closedir()
935 return rc; in cifs_closedir()
1011 bool rc = false; in cifs_find_lock_conflict() local
1016 rc = cifs_find_fid_lock_conflict(cur, offset, length, type, in cifs_find_lock_conflict()
1019 if (rc) in cifs_find_lock_conflict()
1023 return rc; in cifs_find_lock_conflict()
1037 int rc = 0; in cifs_lock_test() local
1057 rc = 1; in cifs_lock_test()
1062 return rc; in cifs_lock_test()
1087 int rc = 0; in cifs_lock_add_if() local
1099 return rc; in cifs_lock_add_if()
1103 rc = 1; in cifs_lock_add_if()
1105 rc = -EACCES; in cifs_lock_add_if()
1109 rc = wait_event_interruptible(lock->block_q, in cifs_lock_add_if()
1112 if (!rc) in cifs_lock_add_if()
1119 return rc; in cifs_lock_add_if()
1132 int rc = 0; in cifs_posix_lock_test() local
1144 rc = 1; in cifs_posix_lock_test()
1148 return rc; in cifs_posix_lock_test()
1161 int rc = 1; in cifs_posix_lock_set() local
1164 return rc; in cifs_posix_lock_set()
1170 return rc; in cifs_posix_lock_set()
1173 rc = posix_lock_file(file, flock, NULL); in cifs_posix_lock_set()
1175 if (rc == FILE_LOCK_DEFERRED) { in cifs_posix_lock_set()
1176 rc = wait_event_interruptible(flock->fl_wait, !flock->fl_blocker); in cifs_posix_lock_set()
1177 if (!rc) in cifs_posix_lock_set()
1181 return rc; in cifs_posix_lock_set()
1188 int rc = 0, stored_rc; in cifs_push_mandatory_locks() local
1241 rc = stored_rc; in cifs_push_mandatory_locks()
1252 rc = stored_rc; in cifs_push_mandatory_locks()
1258 return rc; in cifs_push_mandatory_locks()
1284 int rc = 0, xid, type; in cifs_push_posix_locks() local
1310 rc = -ENOMEM; in cifs_push_posix_locks()
1348 rc = stored_rc; in cifs_push_posix_locks()
1355 return rc; in cifs_push_posix_locks()
1370 int rc = 0; in cifs_push_locks() local
1376 return rc; in cifs_push_locks()
1382 rc = cifs_push_posix_locks(cfile); in cifs_push_locks()
1384 rc = tcon->ses->server->ops->push_mand_locks(cfile); in cifs_push_locks()
1388 return rc; in cifs_push_locks()
1442 int rc = 0; in cifs_getlk() local
1452 rc = cifs_posix_lock_test(file, flock); in cifs_getlk()
1453 if (!rc) in cifs_getlk()
1454 return rc; in cifs_getlk()
1460 rc = CIFSSMBPosixLock(xid, tcon, netfid, in cifs_getlk()
1464 return rc; in cifs_getlk()
1467 rc = cifs_lock_test(cfile, flock->fl_start, length, type, flock); in cifs_getlk()
1468 if (!rc) in cifs_getlk()
1469 return rc; in cifs_getlk()
1472 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, type, in cifs_getlk()
1474 if (rc == 0) { in cifs_getlk()
1475 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1478 if (rc != 0) in cifs_getlk()
1480 rc); in cifs_getlk()
1491 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1494 if (rc == 0) { in cifs_getlk()
1495 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1498 if (rc != 0) in cifs_getlk()
1500 rc); in cifs_getlk()
1530 int rc = 0, stored_rc; in cifs_unlock_range() local
1610 rc = stored_rc; in cifs_unlock_range()
1628 rc = stored_rc; in cifs_unlock_range()
1636 return rc; in cifs_unlock_range()
1644 int rc = 0; in cifs_setlk() local
1654 rc = cifs_posix_lock_set(file, flock); in cifs_setlk()
1655 if (!rc || rc < 0) in cifs_setlk()
1656 return rc; in cifs_setlk()
1666 rc = CIFSSMBPosixLock(xid, tcon, cfile->fid.netfid, in cifs_setlk()
1681 rc = cifs_lock_add_if(cfile, lock, wait_flag); in cifs_setlk()
1682 if (rc < 0) { in cifs_setlk()
1684 return rc; in cifs_setlk()
1686 if (!rc) in cifs_setlk()
1704 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_setlk()
1706 if (rc) { in cifs_setlk()
1708 return rc; in cifs_setlk()
1713 rc = server->ops->mand_unlock_range(cfile, flock, xid); in cifs_setlk()
1723 if (rc) { in cifs_setlk()
1724 cifs_dbg(VFS, "%s failed rc=%d\n", __func__, rc); in cifs_setlk()
1726 return rc; in cifs_setlk()
1728 rc = locks_lock_file_wait(file, flock); in cifs_setlk()
1730 return rc; in cifs_setlk()
1735 int rc, xid; in cifs_lock() local
1744 rc = -EACCES; in cifs_lock()
1767 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); in cifs_lock()
1769 return rc; in cifs_lock()
1781 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, in cifs_lock()
1784 return rc; in cifs_lock()
1805 int rc = 0; in cifs_write() local
1828 rc = -EAGAIN; in cifs_write()
1829 while (rc == -EAGAIN) { in cifs_write()
1838 rc = cifs_reopen_file(open_file, false); in cifs_write()
1839 if (rc != 0) in cifs_write()
1852 rc = server->ops->sync_write(xid, &open_file->fid, in cifs_write()
1855 if (rc || (bytes_written == 0)) { in cifs_write()
1860 return rc; in cifs_write()
1925 int rc = -EBADF; in cifs_get_writable_file() local
1939 return rc; in cifs_get_writable_file()
1952 return rc; in cifs_get_writable_file()
1986 rc = cifs_reopen_file(inv_file, false); in cifs_get_writable_file()
1987 if (!rc) { in cifs_get_writable_file()
2002 return rc; in cifs_get_writable_file()
2009 int rc; in find_writable_file() local
2011 rc = cifs_get_writable_file(cifs_inode, fsuid_only, &cfile); in find_writable_file()
2012 if (rc) in find_writable_file()
2013 cifs_dbg(FYI, "couldn't find writable handle rc=%d", rc); in find_writable_file()
2094 int rc = -EFAULT; in cifs_partialpagewrite() local
2123 rc = cifs_get_writable_file(CIFS_I(mapping->host), false, &open_file); in cifs_partialpagewrite()
2124 if (!rc) { in cifs_partialpagewrite()
2131 rc = 0; in cifs_partialpagewrite()
2133 rc = bytes_written; in cifs_partialpagewrite()
2135 rc = -EFAULT; in cifs_partialpagewrite()
2137 cifs_dbg(FYI, "No writable handle for write page rc=%d\n", rc); in cifs_partialpagewrite()
2138 if (!is_retryable_error(rc)) in cifs_partialpagewrite()
2139 rc = -EIO; in cifs_partialpagewrite()
2143 return rc; in cifs_partialpagewrite()
2246 int rc; in wdata_send_pages() local
2260 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in wdata_send_pages()
2261 if (rc) in wdata_send_pages()
2262 return rc; in wdata_send_pages()
2265 rc = -EAGAIN; in wdata_send_pages()
2267 rc = server->ops->async_writev(wdata, cifs_writedata_release); in wdata_send_pages()
2269 return rc; in wdata_send_pages()
2282 int rc = 0; in cifs_writepages() local
2316 rc = cifs_get_writable_file(CIFS_I(inode), false, &cfile); in cifs_writepages()
2319 if (rc) in cifs_writepages()
2320 get_file_rc = rc; in cifs_writepages()
2322 rc = server->ops->wait_mtu_credits(server, cifs_sb->wsize, in cifs_writepages()
2324 if (rc != 0) { in cifs_writepages()
2334 rc = -ENOMEM; in cifs_writepages()
2364 rc = get_file_rc; in cifs_writepages()
2366 rc = -EBADF; in cifs_writepages()
2368 rc = wdata_send_pages(wdata, nr_pages, mapping, wbc); in cifs_writepages()
2374 if (rc != 0) { in cifs_writepages()
2377 if (is_retryable_error(rc)) in cifs_writepages()
2385 if (!is_retryable_error(rc)) in cifs_writepages()
2386 mapping_set_error(mapping, rc); in cifs_writepages()
2390 if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN) { in cifs_writepages()
2396 if (is_interrupt_error(rc)) { in cifs_writepages()
2401 if (rc != 0 && saved_rc == 0) in cifs_writepages()
2402 saved_rc = rc; in cifs_writepages()
2422 rc = saved_rc; in cifs_writepages()
2430 return rc; in cifs_writepages()
2436 int rc; in cifs_writepage_locked() local
2457 rc = cifs_partialpagewrite(page, 0, PAGE_SIZE); in cifs_writepage_locked()
2458 if (is_retryable_error(rc)) { in cifs_writepage_locked()
2459 if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN) in cifs_writepage_locked()
2462 } else if (rc != 0) { in cifs_writepage_locked()
2464 mapping_set_error(page->mapping, rc); in cifs_writepage_locked()
2471 return rc; in cifs_writepage_locked()
2476 int rc = cifs_writepage_locked(page, wbc); in cifs_writepage() local
2478 return rc; in cifs_writepage()
2485 int rc; in cifs_write_end() local
2518 rc = cifs_write(cfile, pid, page_data + offset, copied, &pos); in cifs_write_end()
2524 rc = copied; in cifs_write_end()
2529 if (rc > 0) { in cifs_write_end()
2539 return rc; in cifs_write_end()
2546 int rc = 0; in cifs_strict_fsync() local
2553 rc = file_write_and_wait_range(file, start, end); in cifs_strict_fsync()
2554 if (rc) in cifs_strict_fsync()
2555 return rc; in cifs_strict_fsync()
2563 rc = cifs_zap_mapping(inode); in cifs_strict_fsync()
2564 if (rc) { in cifs_strict_fsync()
2565 cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc); in cifs_strict_fsync()
2566 rc = 0; /* don't care about it in fsync */ in cifs_strict_fsync()
2574 rc = server->ops->flush(xid, tcon, &smbfile->fid); in cifs_strict_fsync()
2576 rc = -ENOSYS; in cifs_strict_fsync()
2580 return rc; in cifs_strict_fsync()
2586 int rc = 0; in cifs_fsync() local
2592 rc = file_write_and_wait_range(file, start, end); in cifs_fsync()
2593 if (rc) in cifs_fsync()
2594 return rc; in cifs_fsync()
2605 rc = server->ops->flush(xid, tcon, &smbfile->fid); in cifs_fsync()
2607 rc = -ENOSYS; in cifs_fsync()
2611 return rc; in cifs_fsync()
2621 int rc = 0; in cifs_flush() local
2624 rc = filemap_write_and_wait(inode->i_mapping); in cifs_flush()
2626 cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc); in cifs_flush()
2628 return rc; in cifs_flush()
2634 int rc = 0; in cifs_write_allocate_pages() local
2645 rc = -ENOMEM; in cifs_write_allocate_pages()
2650 if (rc) { in cifs_write_allocate_pages()
2654 return rc; in cifs_write_allocate_pages()
2755 int rc; in cifs_resend_wdata() local
2761 rc = cifs_reopen_file(wdata->cfile, false); in cifs_resend_wdata()
2762 if (rc == -EAGAIN) in cifs_resend_wdata()
2764 else if (rc) in cifs_resend_wdata()
2775 rc = server->ops->wait_mtu_credits(server, wdata->bytes, in cifs_resend_wdata()
2777 if (rc) in cifs_resend_wdata()
2787 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in cifs_resend_wdata()
2789 if (!rc) { in cifs_resend_wdata()
2791 rc = -EAGAIN; in cifs_resend_wdata()
2793 rc = server->ops->async_writev(wdata, in cifs_resend_wdata()
2798 if (!rc) { in cifs_resend_wdata()
2805 } while (rc == -EAGAIN); in cifs_resend_wdata()
2809 return rc; in cifs_resend_wdata()
2818 int rc = 0; in cifs_write_from_iter() local
2844 rc = cifs_reopen_file(open_file, false); in cifs_write_from_iter()
2845 if (rc == -EAGAIN) in cifs_write_from_iter()
2847 else if (rc) in cifs_write_from_iter()
2851 rc = server->ops->wait_mtu_credits(server, cifs_sb->wsize, in cifs_write_from_iter()
2853 if (rc) in cifs_write_from_iter()
2872 rc = result; in cifs_write_from_iter()
2885 rc = -ENOMEM; in cifs_write_from_iter()
2902 rc = -ENOMEM; in cifs_write_from_iter()
2907 rc = cifs_write_allocate_pages(wdata->pages, nr_pages); in cifs_write_from_iter()
2908 if (rc) { in cifs_write_from_iter()
2916 rc = wdata_fill_from_iovec( in cifs_write_from_iter()
2918 if (rc) { in cifs_write_from_iter()
2948 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in cifs_write_from_iter()
2950 if (!rc) { in cifs_write_from_iter()
2952 rc = -EAGAIN; in cifs_write_from_iter()
2954 rc = server->ops->async_writev(wdata, in cifs_write_from_iter()
2958 if (rc) { in cifs_write_from_iter()
2962 if (rc == -EAGAIN) { in cifs_write_from_iter()
2976 return rc; in cifs_write_from_iter()
2985 int rc; in collect_uncached_write_data() local
2997 rc = ctx->rc; in collect_uncached_write_data()
3005 if (!rc) { in collect_uncached_write_data()
3012 rc = wdata->result; in collect_uncached_write_data()
3017 if (rc == -EAGAIN) { in collect_uncached_write_data()
3025 rc = cifs_resend_wdata( in collect_uncached_write_data()
3031 rc = cifs_write_from_iter(wdata->offset, in collect_uncached_write_data()
3051 ctx->rc = (rc == 0) ? ctx->total_len : rc; in collect_uncached_write_data()
3056 ctx->iocb->ki_complete(ctx->iocb, ctx->rc, 0); in collect_uncached_write_data()
3072 int rc; in __cifs_writev() local
3084 rc = generic_write_checks(iocb, from); in __cifs_writev()
3085 if (rc <= 0) in __cifs_writev()
3086 return rc; in __cifs_writev()
3111 rc = setup_aio_ctx_iter(ctx, from, WRITE); in __cifs_writev()
3112 if (rc) { in __cifs_writev()
3114 return rc; in __cifs_writev()
3121 rc = cifs_write_from_iter(iocb->ki_pos, ctx->len, &saved_from, in __cifs_writev()
3131 rc = 0; in __cifs_writev()
3135 if (rc) { in __cifs_writev()
3137 return rc; in __cifs_writev()
3145 rc = wait_for_completion_killable(&ctx->done); in __cifs_writev()
3146 if (rc) { in __cifs_writev()
3148 ctx->rc = rc = -EINTR; in __cifs_writev()
3152 rc = ctx->rc; in __cifs_writev()
3159 return rc; in __cifs_writev()
3183 ssize_t rc; in cifs_writev() local
3192 rc = generic_write_checks(iocb, from); in cifs_writev()
3193 if (rc <= 0) in cifs_writev()
3199 rc = __generic_file_write_iter(iocb, from); in cifs_writev()
3201 rc = -EACCES; in cifs_writev()
3206 if (rc > 0) in cifs_writev()
3207 rc = generic_write_sync(iocb, rc); in cifs_writev()
3208 return rc; in cifs_writev()
3315 int rc = 0; in cifs_read_allocate_pages() local
3322 rc = -ENOMEM; in cifs_read_allocate_pages()
3328 if (rc) { in cifs_read_allocate_pages()
3336 return rc; in cifs_read_allocate_pages()
3481 int rc; in cifs_resend_rdata() local
3487 rc = cifs_reopen_file(rdata->cfile, true); in cifs_resend_rdata()
3488 if (rc == -EAGAIN) in cifs_resend_rdata()
3490 else if (rc) in cifs_resend_rdata()
3500 rc = server->ops->wait_mtu_credits(server, rdata->bytes, in cifs_resend_rdata()
3503 if (rc) in cifs_resend_rdata()
3513 rc = adjust_credits(server, &rdata->credits, rdata->bytes); in cifs_resend_rdata()
3514 if (!rc) { in cifs_resend_rdata()
3516 rc = -EAGAIN; in cifs_resend_rdata()
3518 rc = server->ops->async_readv(rdata); in cifs_resend_rdata()
3522 if (!rc) { in cifs_resend_rdata()
3530 } while (rc == -EAGAIN); in cifs_resend_rdata()
3534 return rc; in cifs_resend_rdata()
3547 int rc; in cifs_send_async_read() local
3566 rc = cifs_reopen_file(open_file, true); in cifs_send_async_read()
3567 if (rc == -EAGAIN) in cifs_send_async_read()
3569 else if (rc) in cifs_send_async_read()
3573 rc = server->ops->wait_mtu_credits(server, cifs_sb->rsize, in cifs_send_async_read()
3575 if (rc) in cifs_send_async_read()
3596 rc = result; in cifs_send_async_read()
3607 rc = -ENOMEM; in cifs_send_async_read()
3625 rc = -ENOMEM; in cifs_send_async_read()
3629 rc = cifs_read_allocate_pages(rdata, npages); in cifs_send_async_read()
3630 if (rc) { in cifs_send_async_read()
3652 rc = adjust_credits(server, &rdata->credits, rdata->bytes); in cifs_send_async_read()
3654 if (!rc) { in cifs_send_async_read()
3656 rc = -EAGAIN; in cifs_send_async_read()
3658 rc = server->ops->async_readv(rdata); in cifs_send_async_read()
3661 if (rc) { in cifs_send_async_read()
3665 if (rc == -EAGAIN) { in cifs_send_async_read()
3677 return rc; in cifs_send_async_read()
3686 int rc; in collect_uncached_read_data() local
3697 rc = ctx->rc; in collect_uncached_read_data()
3701 if (!rc) { in collect_uncached_read_data()
3721 rc = 0; in collect_uncached_read_data()
3723 rc = cifs_readdata_to_iov(rdata, to); in collect_uncached_read_data()
3724 if (rc) { in collect_uncached_read_data()
3736 rc = cifs_resend_rdata( in collect_uncached_read_data()
3740 rc = cifs_send_async_read( in collect_uncached_read_data()
3754 rc = rdata->result; in collect_uncached_read_data()
3756 rc = cifs_readdata_to_iov(rdata, to); in collect_uncached_read_data()
3760 rc = -ENODATA; in collect_uncached_read_data()
3772 if (rc == -ENODATA) in collect_uncached_read_data()
3773 rc = 0; in collect_uncached_read_data()
3775 ctx->rc = (rc == 0) ? ctx->total_len : rc; in collect_uncached_read_data()
3780 ctx->iocb->ki_complete(ctx->iocb, ctx->rc, 0); in collect_uncached_read_data()
3793 ssize_t rc, total_read = 0; in __cifs_readv() local
3839 rc = setup_aio_ctx_iter(ctx, to, READ); in __cifs_readv()
3840 if (rc) { in __cifs_readv()
3842 return rc; in __cifs_readv()
3850 rc = cifs_send_async_read(offset, len, cfile, cifs_sb, &ctx->list, ctx); in __cifs_readv()
3854 rc = 0; in __cifs_readv()
3858 if (rc) { in __cifs_readv()
3860 return rc; in __cifs_readv()
3868 rc = wait_for_completion_killable(&ctx->done); in __cifs_readv()
3869 if (rc) { in __cifs_readv()
3871 ctx->rc = rc = -EINTR; in __cifs_readv()
3875 rc = ctx->rc; in __cifs_readv()
3885 return rc; in __cifs_readv()
3907 int rc = -EACCES; in cifs_strict_readv() local
3933 rc = generic_file_read_iter(iocb, to); in cifs_strict_readv()
3935 return rc; in cifs_strict_readv()
3941 int rc = -EACCES; in cifs_read() local
3963 rc = -EBADF; in cifs_read()
3965 return rc; in cifs_read()
4000 rc = cifs_reopen_file(open_file, true); in cifs_read()
4001 if (rc != 0) in cifs_read()
4008 rc = server->ops->sync_read(xid, &open_file->fid, &io_parms, in cifs_read()
4011 } while (rc == -EAGAIN); in cifs_read()
4013 if (rc || (bytes_read == 0)) { in cifs_read()
4018 return rc; in cifs_read()
4050 int xid, rc = 0; in cifs_file_strict_mmap() local
4056 rc = cifs_zap_mapping(inode); in cifs_file_strict_mmap()
4057 if (!rc) in cifs_file_strict_mmap()
4058 rc = generic_file_mmap(file, vma); in cifs_file_strict_mmap()
4059 if (!rc) in cifs_file_strict_mmap()
4063 return rc; in cifs_file_strict_mmap()
4068 int rc, xid; in cifs_file_mmap() local
4072 rc = cifs_revalidate_file(file); in cifs_file_mmap()
4073 if (rc) in cifs_file_mmap()
4075 rc); in cifs_file_mmap()
4076 if (!rc) in cifs_file_mmap()
4077 rc = generic_file_mmap(file, vma); in cifs_file_mmap()
4078 if (!rc) in cifs_file_mmap()
4082 return rc; in cifs_file_mmap()
4226 int rc; in readpages_get_pages() local
4239 rc = add_to_page_cache_locked(page, mapping, in readpages_get_pages()
4243 if (rc) { in readpages_get_pages()
4245 return rc; in readpages_get_pages()
4275 return rc; in readpages_get_pages()
4281 int rc; in cifs_readpages() local
4297 rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list, in cifs_readpages()
4299 if (rc == 0) { in cifs_readpages()
4301 return rc; in cifs_readpages()
4309 rc = 0; in cifs_readpages()
4335 rc = cifs_reopen_file(open_file, true); in cifs_readpages()
4336 if (rc == -EAGAIN) in cifs_readpages()
4338 else if (rc) in cifs_readpages()
4342 rc = server->ops->wait_mtu_credits(server, cifs_sb->rsize, in cifs_readpages()
4344 if (rc) in cifs_readpages()
4359 rc = readpages_get_pages(mapping, page_list, rsize, &tmplist, in cifs_readpages()
4361 if (rc) { in cifs_readpages()
4375 rc = -ENOMEM; in cifs_readpages()
4396 rc = adjust_credits(server, &rdata->credits, rdata->bytes); in cifs_readpages()
4398 if (!rc) { in cifs_readpages()
4400 rc = -EAGAIN; in cifs_readpages()
4402 rc = server->ops->async_readv(rdata); in cifs_readpages()
4405 if (rc) { in cifs_readpages()
4427 return rc; in cifs_readpages()
4437 int rc; in cifs_readpage_worker() local
4440 rc = cifs_readpage_from_fscache(file_inode(file), page); in cifs_readpage_worker()
4441 if (rc == 0) in cifs_readpage_worker()
4447 rc = cifs_read(file, read_data, PAGE_SIZE, poffset); in cifs_readpage_worker()
4449 if (rc < 0) in cifs_readpage_worker()
4452 cifs_dbg(FYI, "Bytes read %d\n", rc); in cifs_readpage_worker()
4461 if (PAGE_SIZE > rc) in cifs_readpage_worker()
4462 memset(read_data + rc, 0, PAGE_SIZE - rc); in cifs_readpage_worker()
4470 rc = 0; in cifs_readpage_worker()
4477 return rc; in cifs_readpage_worker()
4483 int rc = -EACCES; in cifs_readpage() local
4489 rc = -EBADF; in cifs_readpage()
4491 return rc; in cifs_readpage()
4497 rc = cifs_readpage_worker(file, page, &offset); in cifs_readpage()
4500 return rc; in cifs_readpage()
4558 int rc = 0; in cifs_write_begin() local
4565 rc = -ENOMEM; in cifs_write_begin()
4622 return rc; in cifs_write_begin()
4644 int rc = 0; in cifs_launder_page() local
4657 rc = cifs_writepage_locked(page, &wbc); in cifs_launder_page()
4660 return rc; in cifs_launder_page()
4671 int rc = 0; in cifs_oplock_break() local
4691 rc = filemap_fdatawrite(inode->i_mapping); in cifs_oplock_break()
4693 rc = filemap_fdatawait(inode->i_mapping); in cifs_oplock_break()
4694 mapping_set_error(inode->i_mapping, rc); in cifs_oplock_break()
4697 cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc); in cifs_oplock_break()
4700 rc = cifs_push_locks(cfile); in cifs_oplock_break()
4701 if (rc) in cifs_oplock_break()
4702 cifs_dbg(VFS, "Push locks rc = %d\n", rc); in cifs_oplock_break()
4711 rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid, in cifs_oplock_break()
4713 cifs_dbg(FYI, "Oplock release rc = %d\n", rc); in cifs_oplock_break()