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()
234 return -EOPNOTSUPP; in nfs42_fallocate()
255 unsigned int bs = server->clone_blksize; in nfs42_remap_file_range()
260 return -EOPNOTSUPP; in nfs42_remap_file_range()
263 return -EINVAL; in nfs42_remap_file_range()
266 return -ETXTBSY; in nfs42_remap_file_range()
269 ret = -EINVAL; in nfs42_remap_file_range()
277 /* XXX: do we lock at all? what if server needs CB_RECALL_LAYOUT? */ in nfs42_remap_file_range()
279 /* flush all pending writes on both src and dst so that server in nfs42_remap_file_range()
295 truncate_inode_pages_range(&dst_inode->i_data, dst_off, dst_off + count - 1); in nfs42_remap_file_range()
318 server = NFS_SB(ss_mnt->mnt_sb); in __nfs42_ssc_open()
321 return ERR_PTR(-ENOMEM); in __nfs42_ssc_open()
329 if (!S_ISREG(fattr->mode)) { in __nfs42_ssc_open()
330 res = ERR_PTR(-EBADF); in __nfs42_ssc_open()
334 res = ERR_PTR(-ENOMEM); in __nfs42_ssc_open()
341 r_ino = nfs_fhget(ss_mnt->mnt_sb, src_fh, fattr); in __nfs42_ssc_open()
348 r_ino->i_fop); in __nfs42_ssc_open()
355 ctx = alloc_nfs_open_context(filep->f_path.dentry, in __nfs42_ssc_open()
356 flags_to_mode(filep->f_flags), filep); in __nfs42_ssc_open()
362 res = ERR_PTR(-EINVAL); in __nfs42_ssc_open()
363 sp = nfs4_get_state_owner(server, ctx->cred, GFP_KERNEL); in __nfs42_ssc_open()
367 ctx->state = nfs4_get_open_state(r_ino, sp); in __nfs42_ssc_open()
368 if (ctx->state == NULL) in __nfs42_ssc_open()
371 set_bit(NFS_SRV_SSC_COPY_STATE, &ctx->state->flags); in __nfs42_ssc_open()
372 memcpy(&ctx->state->open_stateid.other, &stateid->other, in __nfs42_ssc_open()
374 update_open_stateid(ctx->state, stateid, NULL, filep->f_mode); in __nfs42_ssc_open()
375 set_bit(NFS_OPEN_STATE, &ctx->state->flags); in __nfs42_ssc_open()
380 file_ra_state_init(&filep->f_ra, filep->f_mapping->host->i_mapping); in __nfs42_ssc_open()
400 ctx->state->flags = 0; in __nfs42_ssc_close()
409 * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in nfs_common
420 * nfs42_ssc_unregister_ops - wrapper to un-register NFS_V4 ops in nfs_common