Lines Matching +full:- +full:- +full:retry +full:- +full:all +full:- +full:errors

1 // SPDX-License-Identifier: GPL-2.0
34 unsigned openflags = filp->f_flags; in nfs4_file_open()
40 * opens in ->lookup() or ->create(). in nfs4_file_open()
44 * -EOPENSTALE. The VFS will retry the lookup/create/open. in nfs4_file_open()
69 filemap_write_and_wait(inode->i_mapping); in nfs4_file_open()
72 inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, NULL); in nfs4_file_open()
78 case -ENOENT: in nfs4_file_open()
79 case -ESTALE: in nfs4_file_open()
80 case -EISDIR: in nfs4_file_open()
81 case -ENOTDIR: in nfs4_file_open()
82 case -ELOOP: in nfs4_file_open()
92 filp->f_mode |= FMODE_CAN_ODIRECT; in nfs4_file_open()
102 err = -EOPENSTALE; in nfs4_file_open()
107 * Flush all dirty pages, and check for write errors.
118 if ((file->f_mode & FMODE_WRITE) == 0) in nfs4_file_flush()
126 return filemap_fdatawrite(file->f_mapping); in nfs4_file_flush()
128 /* Flush writes to the server and return any errors */ in nfs4_file_flush()
129 since = filemap_sample_wb_err(file->f_mapping); in nfs4_file_flush()
131 return filemap_check_wb_err(file->f_mapping, since); in nfs4_file_flush()
146 if (file_in->f_op != &nfs4_file_operations) in __nfs4_copy_file_range()
147 return -EXDEV; in __nfs4_copy_file_range()
150 return -EOPNOTSUPP; in __nfs4_copy_file_range()
152 return -EOPNOTSUPP; in __nfs4_copy_file_range()
156 if (count <= 2 * NFS_SERVER(file_inode(file_in))->rsize) in __nfs4_copy_file_range()
158 retry: in __nfs4_copy_file_range()
165 return -EOPNOTSUPP; in __nfs4_copy_file_range()
169 return -ENOMEM; in __nfs4_copy_file_range()
173 ret = -EOPNOTSUPP; in __nfs4_copy_file_range()
176 nss = &cn_resp->cnr_src; in __nfs4_copy_file_range()
177 cnrs = &cn_resp->cnr_stateid; in __nfs4_copy_file_range()
184 if (ret == -EAGAIN) in __nfs4_copy_file_range()
185 goto retry; in __nfs4_copy_file_range()
197 if (ret == -EOPNOTSUPP || ret == -EXDEV) in nfs4_copy_file_range()
211 if (ret != -EOPNOTSUPP) in nfs4_file_llseek()
224 if (!S_ISREG(inode->i_mode)) in nfs42_fallocate()
225 return -EOPNOTSUPP; in nfs42_fallocate()
228 return -EOPNOTSUPP; in nfs42_fallocate()
246 unsigned int bs = server->clone_blksize; in nfs42_remap_file_range()
252 return -EOPNOTSUPP; in nfs42_remap_file_range()
255 return -EINVAL; in nfs42_remap_file_range()
258 return -ETXTBSY; in nfs42_remap_file_range()
261 ret = -EINVAL; in nfs42_remap_file_range()
272 /* XXX: do we lock at all? what if server needs CB_RECALL_LAYOUT? */ in nfs42_remap_file_range()
283 /* flush all pending writes on both src and dst so that server in nfs42_remap_file_range()
297 truncate_inode_pages_range(&dst_inode->i_data, dst_off, dst_off + count - 1); in nfs42_remap_file_range()
328 server = NFS_SB(ss_mnt->mnt_sb); in __nfs42_ssc_open()
331 return ERR_PTR(-ENOMEM); in __nfs42_ssc_open()
339 if (!S_ISREG(fattr->mode)) { in __nfs42_ssc_open()
340 res = ERR_PTR(-EBADF); in __nfs42_ssc_open()
344 res = ERR_PTR(-ENOMEM); in __nfs42_ssc_open()
351 r_ino = nfs_fhget(ss_mnt->mnt_sb, src_fh, fattr); in __nfs42_ssc_open()
358 r_ino->i_fop); in __nfs42_ssc_open()
365 ctx = alloc_nfs_open_context(filep->f_path.dentry, in __nfs42_ssc_open()
366 flags_to_mode(filep->f_flags), filep); in __nfs42_ssc_open()
372 res = ERR_PTR(-EINVAL); in __nfs42_ssc_open()
373 sp = nfs4_get_state_owner(server, ctx->cred, GFP_KERNEL); in __nfs42_ssc_open()
377 ctx->state = nfs4_get_open_state(r_ino, sp); in __nfs42_ssc_open()
378 if (ctx->state == NULL) in __nfs42_ssc_open()
381 set_bit(NFS_SRV_SSC_COPY_STATE, &ctx->state->flags); in __nfs42_ssc_open()
382 memcpy(&ctx->state->open_stateid.other, &stateid->other, in __nfs42_ssc_open()
384 update_open_stateid(ctx->state, stateid, NULL, filep->f_mode); in __nfs42_ssc_open()
385 set_bit(NFS_OPEN_STATE, &ctx->state->flags); in __nfs42_ssc_open()
390 file_ra_state_init(&filep->f_ra, filep->f_mapping->host->i_mapping); in __nfs42_ssc_open()
410 ctx->state->flags = 0; in __nfs42_ssc_close()
419 * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in nfs_common
430 * nfs42_ssc_unregister_ops - wrapper to un-register NFS_V4 ops in nfs_common