Lines Matching refs:fhp
173 nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_lookup_dentry() argument
182 dprintk("nfsd: nfsd_lookup(fh %s, %.*s)\n", SVCFH_fmt(fhp), len,name); in nfsd_lookup_dentry()
184 dparent = fhp->fh_dentry; in nfsd_lookup_dentry()
185 exp = exp_get(fhp->fh_export); in nfsd_lookup_dentry()
207 fh_lock_nested(fhp, I_MUTEX_PARENT); in nfsd_lookup_dentry()
221 fh_unlock(fhp); in nfsd_lookup_dentry()
250 nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, in nfsd_lookup() argument
257 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC); in nfsd_lookup()
260 err = nfsd_lookup_dentry(rqstp, fhp, name, len, &exp, &dentry); in nfsd_lookup()
270 err = fh_compose(resfh, exp, dentry, fhp); in nfsd_lookup()
293 commit_metadata(struct svc_fh *fhp) in commit_metadata() argument
295 struct inode *inode = d_inode(fhp->fh_dentry); in commit_metadata()
297 if (!EX_ISSYNC(fhp->fh_export)) in commit_metadata()
332 nfsd_get_write_access(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_get_write_access() argument
335 struct inode *inode = d_inode(fhp->fh_dentry); in nfsd_get_write_access()
340 err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry, in nfsd_get_write_access()
352 nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap, in nfsd_setattr() argument
383 get_write_count = !fhp->fh_dentry; in nfsd_setattr()
386 err = fh_verify(rqstp, fhp, ftype, accmode); in nfsd_setattr()
390 host_err = fh_want_write(fhp); in nfsd_setattr()
395 dentry = fhp->fh_dentry; in nfsd_setattr()
418 err = nfsd_get_write_access(rqstp, fhp, iap); in nfsd_setattr()
423 fh_lock(fhp); in nfsd_setattr()
455 fh_unlock(fhp); in nfsd_setattr()
460 host_err = commit_metadata(fhp); in nfsd_setattr()
494 __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd4_set_nfs4_label() argument
501 error = fh_verify(rqstp, fhp, 0 /* S_IFREG */, NFSD_MAY_SATTR); in nfsd4_set_nfs4_label()
505 dentry = fhp->fh_dentry; in nfsd4_set_nfs4_label()
513 __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd4_set_nfs4_label() argument
571 __be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd4_vfs_fallocate() argument
582 error = commit_metadata(fhp); in nfsd4_vfs_fallocate()
644 nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *supported) in nfsd_access() argument
652 error = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP); in nfsd_access()
656 export = fhp->fh_export; in nfsd_access()
657 dentry = fhp->fh_dentry; in nfsd_access()
719 __nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, in __nfsd_open() argument
729 path.mnt = fhp->fh_export->ex_path.mnt; in __nfsd_open()
730 path.dentry = fhp->fh_dentry; in __nfsd_open()
776 nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, in nfsd_open() argument
795 err = fh_verify(rqstp, fhp, type, may_flags); in nfsd_open()
797 err = __nfsd_open(rqstp, fhp, type, may_flags, filp); in nfsd_open()
803 nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, in nfsd_open_verified() argument
809 err = __nfsd_open(rqstp, fhp, type, may_flags, filp); in nfsd_open_verified()
854 static __be32 nfsd_finish_read(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_finish_read() argument
859 nfsd_stats_io_read_add(fhp->fh_export, host_err); in nfsd_finish_read()
863 trace_nfsd_read_io_done(rqstp, fhp, offset, *count); in nfsd_finish_read()
866 trace_nfsd_read_err(rqstp, fhp, offset, host_err); in nfsd_finish_read()
871 __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_splice_read() argument
883 trace_nfsd_read_splice(rqstp, fhp, offset, *count); in nfsd_splice_read()
886 return nfsd_finish_read(rqstp, fhp, file, offset, count, eof, host_err); in nfsd_splice_read()
889 __be32 nfsd_readv(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_readv() argument
898 trace_nfsd_read_vector(rqstp, fhp, offset, *count); in nfsd_readv()
901 return nfsd_finish_read(rqstp, fhp, file, offset, count, eof, host_err); in nfsd_readv()
942 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf, in nfsd_vfs_write() argument
960 trace_nfsd_write_opened(rqstp, fhp, offset, *cnt); in nfsd_vfs_write()
978 exp = fhp->fh_export; in nfsd_vfs_write()
1022 trace_nfsd_write_io_done(rqstp, fhp, offset, *cnt); in nfsd_vfs_write()
1025 trace_nfsd_write_err(rqstp, fhp, offset, host_err); in nfsd_vfs_write()
1038 __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_read() argument
1046 trace_nfsd_read_start(rqstp, fhp, offset, *count); in nfsd_read()
1047 err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf); in nfsd_read()
1053 err = nfsd_splice_read(rqstp, fhp, file, offset, count, eof); in nfsd_read()
1055 err = nfsd_readv(rqstp, fhp, file, offset, vec, vlen, count, eof); in nfsd_read()
1059 trace_nfsd_read_done(rqstp, fhp, offset, *count); in nfsd_read()
1070 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, in nfsd_write() argument
1077 trace_nfsd_write_start(rqstp, fhp, offset, *cnt); in nfsd_write()
1079 err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_WRITE, &nf); in nfsd_write()
1083 err = nfsd_vfs_write(rqstp, fhp, nf, offset, vec, in nfsd_write()
1087 trace_nfsd_write_done(rqstp, fhp, offset, *cnt); in nfsd_write()
1115 nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_commit() argument
1130 err = nfsd_file_acquire(rqstp, fhp, in nfsd_commit()
1134 if (EX_ISSYNC(fhp->fh_export)) { in nfsd_commit()
1202 nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_create_locked() argument
1212 dentry = fhp->fh_dentry; in nfsd_create_locked()
1216 if (!fhp->fh_locked) { in nfsd_create_locked()
1223 err = nfsd_permission(rqstp, fhp->fh_export, dentry, NFSD_MAY_CREATE); in nfsd_create_locked()
1290 err2 = nfserrno(commit_metadata(fhp)); in nfsd_create_locked()
1314 nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_create() argument
1325 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_NOP); in nfsd_create()
1329 dentry = fhp->fh_dentry; in nfsd_create()
1331 host_err = fh_want_write(fhp); in nfsd_create()
1335 fh_lock_nested(fhp, I_MUTEX_PARENT); in nfsd_create()
1340 err = fh_compose(resfhp, fhp->fh_export, dchild, fhp); in nfsd_create()
1348 return nfsd_create_locked(rqstp, fhp, fname, flen, iap, type, in nfsd_create()
1358 do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, in do_nfsd_create() argument
1377 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC); in do_nfsd_create()
1381 dentry = fhp->fh_dentry; in do_nfsd_create()
1384 host_err = fh_want_write(fhp); in do_nfsd_create()
1388 fh_lock_nested(fhp, I_MUTEX_PARENT); in do_nfsd_create()
1400 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); in do_nfsd_create()
1405 err = fh_compose(resfhp, fhp->fh_export, dchild, fhp); in do_nfsd_create()
1464 fh_drop_write(fhp); in do_nfsd_create()
1473 fh_drop_write(fhp); in do_nfsd_create()
1500 err = nfserrno(commit_metadata(fhp)); in do_nfsd_create()
1509 fh_unlock(fhp); in do_nfsd_create()
1512 fh_drop_write(fhp); in do_nfsd_create()
1527 nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) in nfsd_readlink() argument
1535 err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP); in nfsd_readlink()
1539 path.mnt = fhp->fh_export->ex_path.mnt; in nfsd_readlink()
1540 path.dentry = fhp->fh_dentry; in nfsd_readlink()
1564 nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, in nfsd_symlink() argument
1580 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE); in nfsd_symlink()
1584 host_err = fh_want_write(fhp); in nfsd_symlink()
1588 fh_lock(fhp); in nfsd_symlink()
1589 dentry = fhp->fh_dentry; in nfsd_symlink()
1597 fh_unlock(fhp); in nfsd_symlink()
1599 err = nfserrno(commit_metadata(fhp)); in nfsd_symlink()
1601 fh_drop_write(fhp); in nfsd_symlink()
1603 cerr = fh_compose(resfhp, fhp->fh_export, dnew, fhp); in nfsd_symlink()
1839 nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, in nfsd_unlink() argument
1851 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_REMOVE); in nfsd_unlink()
1855 host_err = fh_want_write(fhp); in nfsd_unlink()
1859 fh_lock_nested(fhp, I_MUTEX_PARENT); in nfsd_unlink()
1860 dentry = fhp->fh_dentry; in nfsd_unlink()
1887 fh_unlock(fhp); in nfsd_unlink()
1889 host_err = commit_metadata(fhp); in nfsd_unlink()
1894 fh_drop_write(fhp); in nfsd_unlink()
1958 static __be32 nfsd_buffered_readdir(struct file *file, struct svc_fh *fhp, in nfsd_buffered_readdir() argument
2006 trace_nfsd_dirent(fhp, de->ino, de->name, de->namlen); in nfsd_buffered_readdir()
2033 nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp, in nfsd_readdir() argument
2045 err = nfsd_open(rqstp, fhp, S_IFDIR, may_flags, &file); in nfsd_readdir()
2055 err = nfsd_buffered_readdir(file, fhp, func, cdp, offsetp); in nfsd_readdir()
2070 nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access) in nfsd_statfs() argument
2074 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access); in nfsd_statfs()
2077 .mnt = fhp->fh_export->ex_path.mnt, in nfsd_statfs()
2078 .dentry = fhp->fh_dentry, in nfsd_statfs()
2133 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name, in nfsd_getxattr() argument
2142 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_READ); in nfsd_getxattr()
2147 dentry = fhp->fh_dentry; in nfsd_getxattr()
2206 nfsd_listxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char **bufp, in nfsd_listxattr() argument
2215 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_READ); in nfsd_listxattr()
2219 dentry = fhp->fh_dentry; in nfsd_listxattr()
2271 nfsd_removexattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name) in nfsd_removexattr() argument
2276 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_WRITE); in nfsd_removexattr()
2280 ret = fh_want_write(fhp); in nfsd_removexattr()
2284 fh_lock(fhp); in nfsd_removexattr()
2286 ret = __vfs_removexattr_locked(&init_user_ns, fhp->fh_dentry, in nfsd_removexattr()
2289 fh_unlock(fhp); in nfsd_removexattr()
2290 fh_drop_write(fhp); in nfsd_removexattr()
2296 nfsd_setxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name, in nfsd_setxattr() argument
2302 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_WRITE); in nfsd_setxattr()
2306 ret = fh_want_write(fhp); in nfsd_setxattr()
2309 fh_lock(fhp); in nfsd_setxattr()
2311 ret = __vfs_setxattr_locked(&init_user_ns, fhp->fh_dentry, name, buf, in nfsd_setxattr()
2314 fh_unlock(fhp); in nfsd_setxattr()
2315 fh_drop_write(fhp); in nfsd_setxattr()