Lines Matching refs:rc
107 int rc; in cifs_posix_open() local
123 rc = PTR_ERR(tlink); in cifs_posix_open()
131 rc = CIFSPOSIXCreate(xid, tcon, posix_flags, mode, pnetfid, presp_data, in cifs_posix_open()
136 if (rc) in cifs_posix_open()
152 rc = -ENOMEM; in cifs_posix_open()
157 rc = cifs_fattr_to_inode(*pinode, &fattr); in cifs_posix_open()
162 return rc; in cifs_posix_open()
170 int rc; in cifs_nt_open() local
231 rc = server->ops->open(xid, &oparms, oplock, buf); in cifs_nt_open()
233 if (rc) in cifs_nt_open()
238 rc = cifs_get_inode_info_unix(&inode, full_path, inode->i_sb, in cifs_nt_open()
241 rc = cifs_get_inode_info(&inode, full_path, buf, inode->i_sb, in cifs_nt_open()
244 if (rc) { in cifs_nt_open()
246 if (rc == -ESTALE) in cifs_nt_open()
247 rc = -EOPENSTALE; in cifs_nt_open()
252 return rc; in cifs_nt_open()
517 int rc = -EACCES; in cifs_open() local
550 rc = PTR_ERR(full_path); in cifs_open()
566 rc = cifs_get_readable_path(tcon, full_path, &cfile); in cifs_open()
567 if (rc == 0) { in cifs_open()
588 rc = cifs_posix_open(full_path, &inode, inode->i_sb, in cifs_open()
591 if (rc == 0) { in cifs_open()
594 } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { in cifs_open()
600 } else if ((rc != -EIO) && (rc != -EREMOTE) && in cifs_open()
601 (rc != -EOPNOTSUPP)) /* path not found or net err */ in cifs_open()
618 rc = cifs_nt_open(full_path, inode, cifs_sb, tcon, in cifs_open()
620 if (rc) { in cifs_open()
631 rc = -ENOMEM; in cifs_open()
659 return rc; in cifs_open()
674 int rc = 0; in cifs_relock_file() local
680 return rc; in cifs_relock_file()
686 rc = cifs_push_posix_locks(cfile); in cifs_relock_file()
688 rc = tcon->ses->server->ops->push_mand_locks(cfile); in cifs_relock_file()
691 return rc; in cifs_relock_file()
697 int rc = -EACCES; in cifs_reopen_file() local
758 rc = cifs_posix_open(full_path, NULL, inode->i_sb, in cifs_reopen_file()
761 if (rc == 0) { in cifs_reopen_file()
800 rc = server->ops->open(xid, &oparms, &oplock, NULL); in cifs_reopen_file()
801 if (rc == -ENOENT && oparms.reconnect == false) { in cifs_reopen_file()
803 rc = server->ops->open(xid, &oparms, &oplock, NULL); in cifs_reopen_file()
808 if (rc) { in cifs_reopen_file()
810 cifs_dbg(FYI, "cifs_reopen returned 0x%x\n", rc); in cifs_reopen_file()
821 rc = filemap_write_and_wait(inode->i_mapping); in cifs_reopen_file()
822 if (!is_interrupt_error(rc)) in cifs_reopen_file()
823 mapping_set_error(inode->i_mapping, rc); in cifs_reopen_file()
826 rc = smb311_posix_get_inode_info(&inode, full_path, inode->i_sb, xid); in cifs_reopen_file()
828 rc = cifs_get_inode_info_unix(&inode, full_path, in cifs_reopen_file()
831 rc = cifs_get_inode_info(&inode, full_path, NULL, in cifs_reopen_file()
857 return rc; in cifs_reopen_file()
960 int rc = 0; in cifs_closedir() local
970 return rc; in cifs_closedir()
982 rc = server->ops->close_dir(xid, tcon, &cfile->fid); in cifs_closedir()
984 rc = -ENOSYS; in cifs_closedir()
985 cifs_dbg(FYI, "Closing uncompleted readdir with rc %d\n", rc); in cifs_closedir()
987 rc = 0; in cifs_closedir()
1006 return rc; in cifs_closedir()
1082 bool rc = false; in cifs_find_lock_conflict() local
1087 rc = cifs_find_fid_lock_conflict(cur, offset, length, type, in cifs_find_lock_conflict()
1090 if (rc) in cifs_find_lock_conflict()
1094 return rc; in cifs_find_lock_conflict()
1108 int rc = 0; in cifs_lock_test() local
1128 rc = 1; in cifs_lock_test()
1133 return rc; in cifs_lock_test()
1158 int rc = 0; in cifs_lock_add_if() local
1170 return rc; in cifs_lock_add_if()
1174 rc = 1; in cifs_lock_add_if()
1176 rc = -EACCES; in cifs_lock_add_if()
1180 rc = wait_event_interruptible(lock->block_q, in cifs_lock_add_if()
1183 if (!rc) in cifs_lock_add_if()
1190 return rc; in cifs_lock_add_if()
1203 int rc = 0; in cifs_posix_lock_test() local
1215 rc = 1; in cifs_posix_lock_test()
1219 return rc; in cifs_posix_lock_test()
1233 int rc = FILE_LOCK_DEFERRED + 1; in cifs_posix_lock_set() local
1236 return rc; in cifs_posix_lock_set()
1241 return rc; in cifs_posix_lock_set()
1244 rc = posix_lock_file(file, flock, NULL); in cifs_posix_lock_set()
1246 return rc; in cifs_posix_lock_set()
1253 int rc = 0, stored_rc; in cifs_push_mandatory_locks() local
1306 rc = stored_rc; in cifs_push_mandatory_locks()
1317 rc = stored_rc; in cifs_push_mandatory_locks()
1323 return rc; in cifs_push_mandatory_locks()
1349 int rc = 0, xid, type; in cifs_push_posix_locks() local
1375 rc = -ENOMEM; in cifs_push_posix_locks()
1413 rc = stored_rc; in cifs_push_posix_locks()
1420 return rc; in cifs_push_posix_locks()
1435 int rc = 0; in cifs_push_locks() local
1441 return rc; in cifs_push_locks()
1447 rc = cifs_push_posix_locks(cfile); in cifs_push_locks()
1449 rc = tcon->ses->server->ops->push_mand_locks(cfile); in cifs_push_locks()
1453 return rc; in cifs_push_locks()
1507 int rc = 0; in cifs_getlk() local
1517 rc = cifs_posix_lock_test(file, flock); in cifs_getlk()
1518 if (!rc) in cifs_getlk()
1519 return rc; in cifs_getlk()
1525 rc = CIFSSMBPosixLock(xid, tcon, netfid, in cifs_getlk()
1529 return rc; in cifs_getlk()
1532 rc = cifs_lock_test(cfile, flock->fl_start, length, type, flock); in cifs_getlk()
1533 if (!rc) in cifs_getlk()
1534 return rc; in cifs_getlk()
1537 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, type, in cifs_getlk()
1539 if (rc == 0) { in cifs_getlk()
1540 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1543 if (rc != 0) in cifs_getlk()
1545 rc); in cifs_getlk()
1556 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1559 if (rc == 0) { in cifs_getlk()
1560 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1563 if (rc != 0) in cifs_getlk()
1565 rc); in cifs_getlk()
1595 int rc = 0, stored_rc; in cifs_unlock_range() local
1675 rc = stored_rc; in cifs_unlock_range()
1693 rc = stored_rc; in cifs_unlock_range()
1701 return rc; in cifs_unlock_range()
1709 int rc = 0; in cifs_setlk() local
1719 rc = cifs_posix_lock_set(file, flock); in cifs_setlk()
1720 if (rc <= FILE_LOCK_DEFERRED) in cifs_setlk()
1721 return rc; in cifs_setlk()
1731 rc = CIFSSMBPosixLock(xid, tcon, cfile->fid.netfid, in cifs_setlk()
1746 rc = cifs_lock_add_if(cfile, lock, wait_flag); in cifs_setlk()
1747 if (rc < 0) { in cifs_setlk()
1749 return rc; in cifs_setlk()
1751 if (!rc) in cifs_setlk()
1769 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_setlk()
1771 if (rc) { in cifs_setlk()
1773 return rc; in cifs_setlk()
1778 rc = server->ops->mand_unlock_range(cfile, flock, xid); in cifs_setlk()
1788 if (rc) { in cifs_setlk()
1789 cifs_dbg(VFS, "%s failed rc=%d\n", __func__, rc); in cifs_setlk()
1791 return rc; in cifs_setlk()
1793 rc = locks_lock_file_wait(file, flock); in cifs_setlk()
1795 return rc; in cifs_setlk()
1800 int rc, xid; in cifs_flock() local
1812 rc = -ENOLCK; in cifs_flock()
1814 return rc; in cifs_flock()
1834 rc = -EOPNOTSUPP; in cifs_flock()
1836 return rc; in cifs_flock()
1839 rc = cifs_setlk(file, fl, type, wait_flag, posix_lck, lock, unlock, in cifs_flock()
1842 return rc; in cifs_flock()
1849 int rc, xid; in cifs_lock() local
1858 rc = -EACCES; in cifs_lock()
1882 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); in cifs_lock()
1884 return rc; in cifs_lock()
1896 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, in cifs_lock()
1899 return rc; in cifs_lock()
1920 int rc = 0; in cifs_write() local
1943 rc = -EAGAIN; in cifs_write()
1944 while (rc == -EAGAIN) { in cifs_write()
1953 rc = cifs_reopen_file(open_file, false); in cifs_write()
1954 if (rc != 0) in cifs_write()
1967 rc = server->ops->sync_write(xid, &open_file->fid, in cifs_write()
1970 if (rc || (bytes_written == 0)) { in cifs_write()
1975 return rc; in cifs_write()
2042 int rc = -EBADF; in cifs_get_writable_file() local
2057 return rc; in cifs_get_writable_file()
2070 return rc; in cifs_get_writable_file()
2106 rc = cifs_reopen_file(inv_file, false); in cifs_get_writable_file()
2107 if (!rc) { in cifs_get_writable_file()
2122 return rc; in cifs_get_writable_file()
2129 int rc; in find_writable_file() local
2131 rc = cifs_get_writable_file(cifs_inode, flags, &cfile); in find_writable_file()
2132 if (rc) in find_writable_file()
2133 cifs_dbg(FYI, "Couldn't find writable handle rc=%d\n", rc); in find_writable_file()
2209 int rc = -EFAULT; in cifs_partialpagewrite() local
2238 rc = cifs_get_writable_file(CIFS_I(mapping->host), FIND_WR_ANY, in cifs_partialpagewrite()
2240 if (!rc) { in cifs_partialpagewrite()
2247 rc = 0; in cifs_partialpagewrite()
2249 rc = bytes_written; in cifs_partialpagewrite()
2251 rc = -EFAULT; in cifs_partialpagewrite()
2253 cifs_dbg(FYI, "No writable handle for write page rc=%d\n", rc); in cifs_partialpagewrite()
2254 if (!is_retryable_error(rc)) in cifs_partialpagewrite()
2255 rc = -EIO; in cifs_partialpagewrite()
2259 return rc; in cifs_partialpagewrite()
2362 int rc; in wdata_send_pages() local
2374 rc = adjust_credits(wdata->server, &wdata->credits, wdata->bytes); in wdata_send_pages()
2375 if (rc) in wdata_send_pages()
2376 return rc; in wdata_send_pages()
2379 rc = -EAGAIN; in wdata_send_pages()
2381 rc = wdata->server->ops->async_writev(wdata, in wdata_send_pages()
2384 return rc; in wdata_send_pages()
2397 int rc = 0; in cifs_writepages() local
2432 rc = cifs_get_writable_file(CIFS_I(inode), FIND_WR_ANY, &cfile); in cifs_writepages()
2435 if (rc) in cifs_writepages()
2436 get_file_rc = rc; in cifs_writepages()
2438 rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->wsize, in cifs_writepages()
2440 if (rc != 0) { in cifs_writepages()
2450 rc = -ENOMEM; in cifs_writepages()
2481 rc = get_file_rc; in cifs_writepages()
2483 rc = -EBADF; in cifs_writepages()
2485 rc = wdata_send_pages(wdata, nr_pages, mapping, wbc); in cifs_writepages()
2491 if (rc != 0) { in cifs_writepages()
2494 if (is_retryable_error(rc)) in cifs_writepages()
2502 if (!is_retryable_error(rc)) in cifs_writepages()
2503 mapping_set_error(mapping, rc); in cifs_writepages()
2507 if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN) { in cifs_writepages()
2513 if (is_interrupt_error(rc)) { in cifs_writepages()
2518 if (rc != 0 && saved_rc == 0) in cifs_writepages()
2519 saved_rc = rc; in cifs_writepages()
2539 rc = saved_rc; in cifs_writepages()
2549 return rc; in cifs_writepages()
2555 int rc; in cifs_writepage_locked() local
2576 rc = cifs_partialpagewrite(page, 0, PAGE_SIZE); in cifs_writepage_locked()
2577 if (is_retryable_error(rc)) { in cifs_writepage_locked()
2578 if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN) in cifs_writepage_locked()
2581 } else if (rc != 0) { in cifs_writepage_locked()
2583 mapping_set_error(page->mapping, rc); in cifs_writepage_locked()
2590 return rc; in cifs_writepage_locked()
2595 int rc = cifs_writepage_locked(page, wbc); in cifs_writepage() local
2597 return rc; in cifs_writepage()
2604 int rc; in cifs_write_end() local
2637 rc = cifs_write(cfile, pid, page_data + offset, copied, &pos); in cifs_write_end()
2643 rc = copied; in cifs_write_end()
2648 if (rc > 0) { in cifs_write_end()
2662 return rc; in cifs_write_end()
2669 int rc = 0; in cifs_strict_fsync() local
2676 rc = file_write_and_wait_range(file, start, end); in cifs_strict_fsync()
2677 if (rc) { in cifs_strict_fsync()
2678 trace_cifs_fsync_err(inode->i_ino, rc); in cifs_strict_fsync()
2679 return rc; in cifs_strict_fsync()
2688 rc = cifs_zap_mapping(inode); in cifs_strict_fsync()
2689 if (rc) { in cifs_strict_fsync()
2690 cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc); in cifs_strict_fsync()
2691 rc = 0; /* don't care about it in fsync */ in cifs_strict_fsync()
2699 rc = -ENOSYS; in cifs_strict_fsync()
2706 rc = server->ops->flush(xid, tcon, &smbfile->fid); in cifs_strict_fsync()
2711 rc = server->ops->flush(xid, tcon, &smbfile->fid); in cifs_strict_fsync()
2716 return rc; in cifs_strict_fsync()
2722 int rc = 0; in cifs_fsync() local
2729 rc = file_write_and_wait_range(file, start, end); in cifs_fsync()
2730 if (rc) { in cifs_fsync()
2731 trace_cifs_fsync_err(file_inode(file)->i_ino, rc); in cifs_fsync()
2732 return rc; in cifs_fsync()
2744 rc = -ENOSYS; in cifs_fsync()
2751 rc = server->ops->flush(xid, tcon, &smbfile->fid); in cifs_fsync()
2756 rc = server->ops->flush(xid, tcon, &smbfile->fid); in cifs_fsync()
2761 return rc; in cifs_fsync()
2771 int rc = 0; in cifs_flush() local
2774 rc = filemap_write_and_wait(inode->i_mapping); in cifs_flush()
2776 cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc); in cifs_flush()
2777 if (rc) in cifs_flush()
2778 trace_cifs_flush_err(inode->i_ino, rc); in cifs_flush()
2779 return rc; in cifs_flush()
2785 int rc = 0; in cifs_write_allocate_pages() local
2796 rc = -ENOMEM; in cifs_write_allocate_pages()
2801 if (rc) { in cifs_write_allocate_pages()
2805 return rc; in cifs_write_allocate_pages()
2906 int rc; in cifs_resend_wdata() local
2911 rc = cifs_reopen_file(wdata->cfile, false); in cifs_resend_wdata()
2912 if (rc == -EAGAIN) in cifs_resend_wdata()
2914 else if (rc) in cifs_resend_wdata()
2925 rc = server->ops->wait_mtu_credits(server, wdata->bytes, in cifs_resend_wdata()
2927 if (rc) in cifs_resend_wdata()
2937 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in cifs_resend_wdata()
2939 if (!rc) { in cifs_resend_wdata()
2941 rc = -EAGAIN; in cifs_resend_wdata()
2950 rc = server->ops->async_writev(wdata, in cifs_resend_wdata()
2956 if (!rc) { in cifs_resend_wdata()
2963 } while (rc == -EAGAIN); in cifs_resend_wdata()
2967 return rc; in cifs_resend_wdata()
2976 int rc = 0; in cifs_write_from_iter() local
3002 rc = cifs_reopen_file(open_file, false); in cifs_write_from_iter()
3003 if (rc == -EAGAIN) in cifs_write_from_iter()
3005 else if (rc) in cifs_write_from_iter()
3009 rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->wsize, in cifs_write_from_iter()
3011 if (rc) in cifs_write_from_iter()
3028 rc = result; in cifs_write_from_iter()
3041 rc = -ENOMEM; in cifs_write_from_iter()
3058 rc = -ENOMEM; in cifs_write_from_iter()
3063 rc = cifs_write_allocate_pages(wdata->pages, nr_pages); in cifs_write_from_iter()
3064 if (rc) { in cifs_write_from_iter()
3072 rc = wdata_fill_from_iovec( in cifs_write_from_iter()
3074 if (rc) { in cifs_write_from_iter()
3105 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in cifs_write_from_iter()
3107 if (!rc) { in cifs_write_from_iter()
3109 rc = -EAGAIN; in cifs_write_from_iter()
3111 rc = server->ops->async_writev(wdata, in cifs_write_from_iter()
3115 if (rc) { in cifs_write_from_iter()
3119 if (rc == -EAGAIN) { in cifs_write_from_iter()
3133 return rc; in cifs_write_from_iter()
3142 ssize_t rc; in collect_uncached_write_data() local
3154 rc = ctx->rc; in collect_uncached_write_data()
3162 if (!rc) { in collect_uncached_write_data()
3169 rc = wdata->result; in collect_uncached_write_data()
3174 if (rc == -EAGAIN) { in collect_uncached_write_data()
3182 rc = cifs_resend_wdata( in collect_uncached_write_data()
3188 rc = cifs_write_from_iter(wdata->offset, in collect_uncached_write_data()
3208 ctx->rc = (rc == 0) ? ctx->total_len : rc; in collect_uncached_write_data()
3213 ctx->iocb->ki_complete(ctx->iocb, ctx->rc, 0); in collect_uncached_write_data()
3229 int rc; in __cifs_writev() local
3241 rc = generic_write_checks(iocb, from); in __cifs_writev()
3242 if (rc <= 0) in __cifs_writev()
3243 return rc; in __cifs_writev()
3268 rc = setup_aio_ctx_iter(ctx, from, WRITE); in __cifs_writev()
3269 if (rc) { in __cifs_writev()
3271 return rc; in __cifs_writev()
3278 rc = cifs_write_from_iter(iocb->ki_pos, ctx->len, &saved_from, in __cifs_writev()
3288 rc = 0; in __cifs_writev()
3292 if (rc) { in __cifs_writev()
3294 return rc; in __cifs_writev()
3302 rc = wait_for_completion_killable(&ctx->done); in __cifs_writev()
3303 if (rc) { in __cifs_writev()
3305 ctx->rc = rc = -EINTR; in __cifs_writev()
3309 rc = ctx->rc; in __cifs_writev()
3316 return rc; in __cifs_writev()
3343 ssize_t rc; in cifs_writev() local
3352 rc = generic_write_checks(iocb, from); in cifs_writev()
3353 if (rc <= 0) in cifs_writev()
3359 rc = __generic_file_write_iter(iocb, from); in cifs_writev()
3361 rc = -EACCES; in cifs_writev()
3366 if (rc > 0) in cifs_writev()
3367 rc = generic_write_sync(iocb, rc); in cifs_writev()
3368 return rc; in cifs_writev()
3475 int rc = 0; in cifs_read_allocate_pages() local
3482 rc = -ENOMEM; in cifs_read_allocate_pages()
3488 if (rc) { in cifs_read_allocate_pages()
3496 return rc; in cifs_read_allocate_pages()
3641 int rc; in cifs_resend_rdata() local
3649 rc = cifs_reopen_file(rdata->cfile, true); in cifs_resend_rdata()
3650 if (rc == -EAGAIN) in cifs_resend_rdata()
3652 else if (rc) in cifs_resend_rdata()
3662 rc = server->ops->wait_mtu_credits(server, rdata->bytes, in cifs_resend_rdata()
3665 if (rc) in cifs_resend_rdata()
3675 rc = adjust_credits(server, &rdata->credits, rdata->bytes); in cifs_resend_rdata()
3676 if (!rc) { in cifs_resend_rdata()
3678 rc = -EAGAIN; in cifs_resend_rdata()
3687 rc = server->ops->async_readv(rdata); in cifs_resend_rdata()
3692 if (!rc) { in cifs_resend_rdata()
3700 } while (rc == -EAGAIN); in cifs_resend_rdata()
3704 return rc; in cifs_resend_rdata()
3717 int rc; in cifs_send_async_read() local
3736 rc = cifs_reopen_file(open_file, true); in cifs_send_async_read()
3737 if (rc == -EAGAIN) in cifs_send_async_read()
3739 else if (rc) in cifs_send_async_read()
3748 rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize, in cifs_send_async_read()
3750 if (rc) in cifs_send_async_read()
3769 rc = result; in cifs_send_async_read()
3780 rc = -ENOMEM; in cifs_send_async_read()
3798 rc = -ENOMEM; in cifs_send_async_read()
3802 rc = cifs_read_allocate_pages(rdata, npages); in cifs_send_async_read()
3803 if (rc) { in cifs_send_async_read()
3826 rc = adjust_credits(server, &rdata->credits, rdata->bytes); in cifs_send_async_read()
3828 if (!rc) { in cifs_send_async_read()
3830 rc = -EAGAIN; in cifs_send_async_read()
3832 rc = server->ops->async_readv(rdata); in cifs_send_async_read()
3835 if (rc) { in cifs_send_async_read()
3839 if (rc == -EAGAIN) { in cifs_send_async_read()
3851 return rc; in cifs_send_async_read()
3860 int rc; in collect_uncached_read_data() local
3871 rc = ctx->rc; in collect_uncached_read_data()
3875 if (!rc) { in collect_uncached_read_data()
3895 rc = 0; in collect_uncached_read_data()
3897 rc = cifs_readdata_to_iov(rdata, to); in collect_uncached_read_data()
3898 if (rc) { in collect_uncached_read_data()
3910 rc = cifs_resend_rdata( in collect_uncached_read_data()
3914 rc = cifs_send_async_read( in collect_uncached_read_data()
3928 rc = rdata->result; in collect_uncached_read_data()
3930 rc = cifs_readdata_to_iov(rdata, to); in collect_uncached_read_data()
3934 rc = -ENODATA; in collect_uncached_read_data()
3946 if (rc == -ENODATA) in collect_uncached_read_data()
3947 rc = 0; in collect_uncached_read_data()
3949 ctx->rc = (rc == 0) ? (ssize_t)ctx->total_len : rc; in collect_uncached_read_data()
3954 ctx->iocb->ki_complete(ctx->iocb, ctx->rc, 0); in collect_uncached_read_data()
3967 ssize_t rc, total_read = 0; in __cifs_readv() local
4013 rc = setup_aio_ctx_iter(ctx, to, READ); in __cifs_readv()
4014 if (rc) { in __cifs_readv()
4016 return rc; in __cifs_readv()
4022 rc = filemap_write_and_wait_range(file->f_inode->i_mapping, in __cifs_readv()
4024 if (rc) { in __cifs_readv()
4033 rc = cifs_send_async_read(offset, len, cfile, cifs_sb, &ctx->list, ctx); in __cifs_readv()
4037 rc = 0; in __cifs_readv()
4041 if (rc) { in __cifs_readv()
4043 return rc; in __cifs_readv()
4051 rc = wait_for_completion_killable(&ctx->done); in __cifs_readv()
4052 if (rc) { in __cifs_readv()
4054 ctx->rc = rc = -EINTR; in __cifs_readv()
4058 rc = ctx->rc; in __cifs_readv()
4068 return rc; in __cifs_readv()
4090 int rc = -EACCES; in cifs_strict_readv() local
4116 rc = generic_file_read_iter(iocb, to); in cifs_strict_readv()
4118 return rc; in cifs_strict_readv()
4124 int rc = -EACCES; in cifs_read() local
4146 rc = -EBADF; in cifs_read()
4148 return rc; in cifs_read()
4183 rc = cifs_reopen_file(open_file, true); in cifs_read()
4184 if (rc != 0) in cifs_read()
4192 rc = server->ops->sync_read(xid, &open_file->fid, &io_parms, in cifs_read()
4195 } while (rc == -EAGAIN); in cifs_read()
4197 if (rc || (bytes_read == 0)) { in cifs_read()
4202 return rc; in cifs_read()
4239 int xid, rc = 0; in cifs_file_strict_mmap() local
4245 rc = cifs_zap_mapping(inode); in cifs_file_strict_mmap()
4246 if (!rc) in cifs_file_strict_mmap()
4247 rc = generic_file_mmap(file, vma); in cifs_file_strict_mmap()
4248 if (!rc) in cifs_file_strict_mmap()
4252 return rc; in cifs_file_strict_mmap()
4257 int rc, xid; in cifs_file_mmap() local
4261 rc = cifs_revalidate_file(file); in cifs_file_mmap()
4262 if (rc) in cifs_file_mmap()
4264 rc); in cifs_file_mmap()
4265 if (!rc) in cifs_file_mmap()
4266 rc = generic_file_mmap(file, vma); in cifs_file_mmap()
4267 if (!rc) in cifs_file_mmap()
4271 return rc; in cifs_file_mmap()
4418 int rc; in readpages_get_pages() local
4431 rc = add_to_page_cache_locked(page, mapping, in readpages_get_pages()
4435 if (rc) { in readpages_get_pages()
4437 return rc; in readpages_get_pages()
4458 rc = add_to_page_cache_locked(page, mapping, page->index, gfp); in readpages_get_pages()
4459 if (rc) { in readpages_get_pages()
4468 return rc; in readpages_get_pages()
4474 int rc; in cifs_readpages() local
4491 rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list, in cifs_readpages()
4493 if (rc == 0) { in cifs_readpages()
4495 return rc; in cifs_readpages()
4503 rc = 0; in cifs_readpages()
4529 rc = cifs_reopen_file(open_file, true); in cifs_readpages()
4530 if (rc == -EAGAIN) in cifs_readpages()
4532 else if (rc) in cifs_readpages()
4541 rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize, in cifs_readpages()
4543 if (rc) in cifs_readpages()
4575 rc = -ENOMEM; in cifs_readpages()
4597 rc = adjust_credits(server, &rdata->credits, rdata->bytes); in cifs_readpages()
4599 if (!rc) { in cifs_readpages()
4601 rc = -EAGAIN; in cifs_readpages()
4603 rc = server->ops->async_readv(rdata); in cifs_readpages()
4606 if (rc) { in cifs_readpages()
4628 return rc; in cifs_readpages()
4638 int rc; in cifs_readpage_worker() local
4641 rc = cifs_readpage_from_fscache(file_inode(file), page); in cifs_readpage_worker()
4642 if (rc == 0) in cifs_readpage_worker()
4648 rc = cifs_read(file, read_data, PAGE_SIZE, poffset); in cifs_readpage_worker()
4650 if (rc < 0) in cifs_readpage_worker()
4653 cifs_dbg(FYI, "Bytes read %d\n", rc); in cifs_readpage_worker()
4662 if (PAGE_SIZE > rc) in cifs_readpage_worker()
4663 memset(read_data + rc, 0, PAGE_SIZE - rc); in cifs_readpage_worker()
4671 rc = 0; in cifs_readpage_worker()
4678 return rc; in cifs_readpage_worker()
4684 int rc = -EACCES; in cifs_readpage() local
4690 rc = -EBADF; in cifs_readpage()
4692 return rc; in cifs_readpage()
4698 rc = cifs_readpage_worker(file, page, &offset); in cifs_readpage()
4701 return rc; in cifs_readpage()
4759 int rc = 0; in cifs_write_begin() local
4766 rc = -ENOMEM; in cifs_write_begin()
4823 return rc; in cifs_write_begin()
4845 int rc = 0; in cifs_launder_page() local
4858 rc = cifs_writepage_locked(page, &wbc); in cifs_launder_page()
4861 return rc; in cifs_launder_page()
4874 int rc = 0; in cifs_oplock_break() local
4903 rc = filemap_fdatawrite(inode->i_mapping); in cifs_oplock_break()
4905 rc = filemap_fdatawait(inode->i_mapping); in cifs_oplock_break()
4906 mapping_set_error(inode->i_mapping, rc); in cifs_oplock_break()
4909 cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc); in cifs_oplock_break()
4914 rc = cifs_push_locks(cfile); in cifs_oplock_break()
4915 if (rc) in cifs_oplock_break()
4916 cifs_dbg(VFS, "Push locks rc = %d\n", rc); in cifs_oplock_break()
4942 rc = server->ops->oplock_response(tcon, persistent_fid, in cifs_oplock_break()
4944 cifs_dbg(FYI, "Oplock release rc = %d\n", rc); in cifs_oplock_break()