Lines Matching +full:- +full:- +full:retry +full:- +full:all +full:- +full:errors
1 // SPDX-License-Identifier: GPL-2.0
35 unsigned openflags = filp->f_flags; in nfs4_file_open()
41 * opens in ->lookup() or ->create(). in nfs4_file_open()
45 * -EOPENSTALE. The VFS will retry the lookup/create/open. in nfs4_file_open()
70 filemap_write_and_wait(inode->i_mapping); in nfs4_file_open()
73 inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, NULL); in nfs4_file_open()
79 case -ENOENT: in nfs4_file_open()
80 case -ESTALE: in nfs4_file_open()
81 case -EISDIR: in nfs4_file_open()
82 case -ENOTDIR: in nfs4_file_open()
83 case -ELOOP: in nfs4_file_open()
93 filp->f_mode |= FMODE_CAN_ODIRECT; in nfs4_file_open()
103 err = -EOPENSTALE; in nfs4_file_open()
108 * Flush all dirty pages, and check for write errors.
119 if ((file->f_mode & FMODE_WRITE) == 0) in nfs4_file_flush()
127 return filemap_fdatawrite(file->f_mapping); in nfs4_file_flush()
129 /* Flush writes to the server and return any errors */ in nfs4_file_flush()
130 since = filemap_sample_wb_err(file->f_mapping); in nfs4_file_flush()
132 return filemap_check_wb_err(file->f_mapping, since); in nfs4_file_flush()
147 if (file_in->f_op != &nfs4_file_operations) in __nfs4_copy_file_range()
148 return -EXDEV; in __nfs4_copy_file_range()
151 return -EOPNOTSUPP; in __nfs4_copy_file_range()
153 return -EOPNOTSUPP; in __nfs4_copy_file_range()
157 if (count <= 2 * NFS_SERVER(file_inode(file_in))->rsize) in __nfs4_copy_file_range()
159 retry: in __nfs4_copy_file_range()
166 return -EOPNOTSUPP; in __nfs4_copy_file_range()
170 return -ENOMEM; in __nfs4_copy_file_range()
174 ret = -EOPNOTSUPP; in __nfs4_copy_file_range()
177 nss = &cn_resp->cnr_src; in __nfs4_copy_file_range()
178 cnrs = &cn_resp->cnr_stateid; in __nfs4_copy_file_range()
185 if (ret == -EAGAIN) in __nfs4_copy_file_range()
186 goto retry; in __nfs4_copy_file_range()
198 if (ret == -EOPNOTSUPP || ret == -EXDEV) in nfs4_copy_file_range()
212 if (ret != -EOPNOTSUPP) in nfs4_file_llseek()
225 if (!S_ISREG(inode->i_mode)) in nfs42_fallocate()
226 return -EOPNOTSUPP; in nfs42_fallocate()
229 return -EOPNOTSUPP; in nfs42_fallocate()
247 unsigned int bs = server->clone_blksize; in nfs42_remap_file_range()
253 return -EOPNOTSUPP; in nfs42_remap_file_range()
256 return -EINVAL; in nfs42_remap_file_range()
259 return -ETXTBSY; in nfs42_remap_file_range()
262 ret = -EINVAL; in nfs42_remap_file_range()
273 /* XXX: do we lock at all? what if server needs CB_RECALL_LAYOUT? */ in nfs42_remap_file_range()
284 /* flush all pending writes on both src and dst so that server in nfs42_remap_file_range()
298 truncate_inode_pages_range(&dst_inode->i_data, dst_off, dst_off + count - 1); in nfs42_remap_file_range()
329 server = NFS_SB(ss_mnt->mnt_sb); in __nfs42_ssc_open()
332 return ERR_PTR(-ENOMEM); in __nfs42_ssc_open()
340 if (!S_ISREG(fattr->mode)) { in __nfs42_ssc_open()
341 res = ERR_PTR(-EBADF); in __nfs42_ssc_open()
345 res = ERR_PTR(-ENOMEM); in __nfs42_ssc_open()
352 r_ino = nfs_fhget(ss_mnt->mnt_sb, src_fh, fattr); in __nfs42_ssc_open()
359 r_ino->i_fop); in __nfs42_ssc_open()
366 ctx = alloc_nfs_open_context(filep->f_path.dentry, in __nfs42_ssc_open()
367 flags_to_mode(filep->f_flags), filep); in __nfs42_ssc_open()
373 res = ERR_PTR(-EINVAL); in __nfs42_ssc_open()
374 sp = nfs4_get_state_owner(server, ctx->cred, GFP_KERNEL); in __nfs42_ssc_open()
378 ctx->state = nfs4_get_open_state(r_ino, sp); in __nfs42_ssc_open()
379 if (ctx->state == NULL) in __nfs42_ssc_open()
382 set_bit(NFS_SRV_SSC_COPY_STATE, &ctx->state->flags); in __nfs42_ssc_open()
383 memcpy(&ctx->state->open_stateid.other, &stateid->other, in __nfs42_ssc_open()
385 update_open_stateid(ctx->state, stateid, NULL, filep->f_mode); in __nfs42_ssc_open()
386 set_bit(NFS_OPEN_STATE, &ctx->state->flags); in __nfs42_ssc_open()
391 file_ra_state_init(&filep->f_ra, filep->f_mapping->host->i_mapping); in __nfs42_ssc_open()
411 ctx->state->flags = 0; in __nfs42_ssc_close()
420 * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in nfs_common
431 * nfs42_ssc_unregister_ops - wrapper to un-register NFS_V4 ops in nfs_common